Skip to main content

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

FieldTypeRequiredDescription
botIdsstring[]yes1–100 bot ObjectIds, no duplicates.
sWithdrawWalletAddressstringnoDestination 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

StatusMeaning
400No matching bots.
404Some 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>" }'