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.
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–20 bot ids, no duplicates. |
sWithdrawWalletAddress | string | yes | Destination for remaining funds. Must be a valid Solana public key and not the system program address (11111111111111111111111111111111). |
Response 200
{ "message": "Bots marked to be stopped" }
Errors
| Status | Meaning |
|---|---|
400 | Validation failed, or one of the running bots is already merging, splitting or scheduled to stop. |
404 | None of the ids is a running bot of the caller. |
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>" }'