Bot Orchestration

Stop Bot

Stop a bot with the specified configuration.

Sends a stop command to a running bot instance via MQTT. This gracefully stops the trading script, optionally cancels open orders, and updates the bot run record in the database with final performance status.

Important: This endpoint only stops the trading script within the container. The Docker container continues running and can be restarted with start-bot. To completely remove a bot and archive its data, use stop-and-archive-bot instead.

The endpoint captures the bot's final performance status before stopping, which is then persisted to the database for historical tracking.

post/bot-orchestration/stop-bot

Request body

bot_namestring required

Name of the bot instance to act upon. This should match the instance_name used when the bot was deployed (e.g., 'my-trading-bot-20240115-143022').

skip_order_cancellationboolean

Controls whether to cancel open orders on the exchange when stopping. When False (default), all open orders are cancelled before stopping. When True, orders remain open on the exchange. Use True for quick stops or when you want to manually manage existing orders.

async_backendboolean

When True, the stop command is sent asynchronously and returns immediately. When False (default), waits for confirmation that the bot has stopped.

Example request

{
  "bot_name": "my-trading-bot-20240115-143022"
}

Response

Successful Response

{"stackTrail":"paths:/bot-orchestration/stop-bot:post:responses:200:content:application/json:schema","oasType":"schema","type":"unknown"}

Changes