Skip to main content

PATCH /flexi/merge

Merge SOL from multiple running bots into the first one. Sources are stopped once their funds are drained.

Async — target is botIds[0], the rest are sources.

Use case

Consolidate stragglers — combine several low-balance bots into one well-funded bot rather than run them to depletion separately.

Body

FieldTypeRequiredDescription
botIdsstring[]yes2–100 bot ObjectIds, no duplicates. The first id is the merge target; the rest are sources.

Requirements

Every bot must be:

  • Owned by the caller
  • In RUNNING state
  • Not already merging, splitting, or scheduled to stop

Response 200

{ "message": "Bots prepared to be merged" }

Errors

StatusMeaning
400Fewer than 2 ids, or any bot not in RUNNING state.
403Any bot not owned by the caller (cross-tenant merge rejected).
404Any id unknown.

Example

curl -X PATCH "$BASE_URL/flexi/merge" \
-H "Authorization: Bearer $ACCESS" \
-H "x-user-id: $USER_ID" \
-H "Content-Type: application/json" \
-d '{ "botIds": ["<target>", "<source1>", "<source2>"] }'