Skip to content

Create a bot

POST https://rest.haasapi.com/v1/partner/users/{user_id}/bots

Creates and starts a bot for an end-user from a strategy template. config carries the strategy’s settings by their snake_case keys (see GET /v1/partner/strategies), including symbol (the market). Answers 201 with the created bot. Grid and DCA strategies are supported; signal (webhook) bots are not yet available here.

Requires the partner scope.

{
"type": "spot_grid",
"config": {
"symbol": "BTC_USDT",
"lower_limit": 25000,
"upper_limit": 35000,
"grid_count": 20,
"investment_asset": "USDT",
"investment_amount": 500
},
"master_bot_id": null
}
Field Type Description
type WhiteLabelScriptType The strategy type (e.g. spot_grid), from GET /v1/partner/strategies. Signal (webhook) bots are not yet supported here.
config object The strategy configuration: the snake_case keys from the strategy’s schema, including symbol (the market, e.g. BTC_USDT).
master_bot_id string, nullable To create a copy-trading follower of an existing bot, that bot’s bot_id. Omit for a standalone bot.
Terminal window
curl "https://rest.haasapi.com/v1/partner/users/{user_id}/bots" \
-X POST \
-H "Authorization: Bearer hk_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"type":"spot_grid","config":{"symbol":"BTC_USDT","lower_limit":25000,"upper_limit":35000,"grid_count":20,"investment_asset":"USDT","investment_amount":500},"master_bot_id":null}'

201 Created. Returns a PartnerBot.

{
"bot_id": "7b90995d7434433f81cb652d7bc0ce25",
"user_id": "8f14e45f-ceea-467a-9c9a-2b0f1d6a3c77",
"status": "running",
"type": "spot_grid",
"exchange": "BINANCE",
"master_bot_id": null,
"created_at": "2026-08-28T19:04:11Z",
"profit": "128.44",
"roi": "0.062",
"cloned": 0,
"followers": 0,
"config": {
"symbol": "BTC_USDT",
"lower_limit": 25000,
"upper_limit": 35000,
"grid_count": 20,
"investment_asset": "USDT",
"investment_amount": 500
}
}
Field Type Description
bot_id string The bot identifier.
user_id string The end-user that owns this bot.
status BotStatus Whether the bot is currently running or stopped.
type WhiteLabelScriptType The strategy type the bot runs.
exchange string, nullable Exchange the bot trades on.
master_bot_id string, nullable The master bot this one copies, if it is a copy; null for an original bot.
created_at string When the bot was created. RFC 3339 UTC.
profit string (decimal) Realized profit in the quote currency, as a decimal string.
roi string (decimal) Return on investment as a decimal string (0.15 = 15%).
cloned integer (int32) How many times this bot has been copied.
followers integer (int32) Copies currently following this bot’s updates.
config object, nullable The bot’s current strategy configuration, keyed by the same snake_case keys create and edit take (see GET /v1/partner/strategies). Read it to pre-fill an edit, then send the changed keys back to PUT …/bots/{bot_id}. Null when the bot has no stored config.

All errors are RFC 9457 problem documents.

Status Description
400 The request is malformed (invalid limit, unusable cursor, …). (code: invalid_request)
401 Missing, malformed, disabled, or revoked API key. (code: invalid_api_key)
404 No accessible end-user with that id. (code: user_not_found)
409 A request with this Idempotency-Key is still being processed. (code: idempotency_in_progress)
422 The strategy is not valid for this end-user’s market, or is not supported here. (code: strategy_not_allowed) The strategy configuration was rejected - see the message. (code: invalid_config) The Idempotency-Key was already used with a different request. (code: idempotency_key_reuse)
500 An unexpected error inside the API. Nothing about the request caused it; retry, and quote the instance value if it persists. (code: internal_error)
502 An internal service answered in a way the API could not serve. Retry. (code: upstream_error)
503 The request could not be served right now. Retry with the same key - do not discard it. (code: temporarily_unavailable)
504 An internal service did not answer within the deadline. Retry with backoff. (code: upstream_timeout)
{
"type": "https://docs.haasapi.com/errors/invalid_request",
"title": "Invalid request",
"status": 400,
"detail": "The request is malformed (invalid limit, unusable cursor, …).",
"code": "invalid_request"
}