Skip to content

List bots

GET https://rest.haasapi.com/v1/bots

Returns the user’s trading bots as lean rows, sorted by bot_id and paged by a keyset cursor - a bot created or deleted mid-walk never shifts the remaining pages. The bot_id is the join key the bot-scoped endpoints take.

Requires the read scope.

Parameter Type Required Description
limit integer no Page size, 1–500. Defaults to 100.
cursor string no Opaque cursor from a previous response’s next_cursor.
Terminal window
curl "https://rest.haasapi.com/v1/bots?limit=100" \
-H "Authorization: Bearer hk_live_YOUR_KEY"

200 OK. Returns a BotsPage.

{
"data": [
{
"bot_id": "7a44bb9565c848b58ff8f34cbc14fb59",
"name": "Cypress Grid Bot (Spot)",
"account_id": "af85799d-a214-4fd2-92ea-443c5eed18ad",
"market_tag": "GEMINI_BTC_USDT",
"script_id": "315414fb4dfe4e718e4a58ce313adf12",
"is_activated": false,
"is_paused": false,
"realized_profit": "0",
"unrealized_profit": "0",
"roi": "0"
}
],
"next_cursor": null
}
Field Type Description
data array of Bot One page of bots, sorted by bot_id.
next_cursor string, nullable Pass as cursor to fetch the next page; null on the last page. Opaque - never construct or decode one.
Field Type Description
bot_id string Bot identifier - the id every other bot endpoint accepts. Copy it from this endpoint; never construct one.
name string User-chosen bot name.
account_id string The exchange account the bot trades on - joins against account_id on /v1/accounts.
market_tag string, nullable The market the bot trades - joins against market_tag on /v1/markets. null when the bot has no market assigned.
script_id string The HaasScript the bot runs.
is_activated boolean Whether the bot is currently activated (running).
is_paused boolean Whether the bot is paused - activated but not processing ticks.
realized_profit string (decimal) Realized profit since activation, in the bot’s profit currency.
unrealized_profit string (decimal) Unrealized profit of open positions, in the bot’s profit currency.
roi string (decimal) Return on investment since activation, percent.

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)
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"
}