PATCH /flexi/stop/bulk
Schedule stop-and-withdraw for multiple bots. Each bot finishes its current swap, then withdraws remaining funds.
Async: each bot finishes its current swap, then drains remaining funds to
sWithdrawWalletAddress (or the user's master wallet).
Use case
Campaign over or funds need to move — end the whole group cleanly and reclaim SOL in one call.
Body
| Field | Type | Required | Description |
|---|---|---|---|
botIds | string[] | yes | 1–100 bot ObjectIds, no duplicates. |
sWithdrawWalletAddress | string | no | Destination for remaining funds. Defaults to the user's own wallet. Cannot equal a bot's own address; system addresses rejected. |
Response 200
{ "message": "Bots marked to be stopped" }
Errors
| Status | Meaning |
|---|---|
400 | No matching bots. |
404 | Some ids missing; response includes missing. |
Example
curl -X PATCH "$BASE_URL/flexi/stop/bulk" \
-H "Authorization: Bearer $ACCESS" \
-H "x-user-id: $USER_ID" \
-H "Content-Type: application/json" \
-d '{ "botIds": ["<id1>", "<id2>"], "sWithdrawWalletAddress": "<wallet>" }'