Skip to content

API reference

The HaasOnline public REST API: programmatic access to your markets, bots, backtests, labs, scripts, and accounts - everything the app can do.

Authentication: every request carries Authorization: Bearer <api key>. Keys are prefixed hk_live_ (production) and are created in Settings → API Keys. No other credential type is accepted on this surface.

Errors are RFC 9457 problem details, served as application/problem+json. The code member is the stable machine-readable slug to match on; type links this error’s documentation.

Pagination is cursor-based: pass limit, follow next_cursor until it is null. Cursors are opaque - never construct or decode one.

Market tags are opaque identifiers. Copy market_tag from GET /markets and hand it back wherever a market is referenced; use the structured fields (exchange, base, quote, contract) when you need the components. Never construct or split a tag.

Idempotency: every POST and PUT accepts an optional Idempotency-Key header (recommended on anything you retry). The first request under a key stores its outcome for 24 hours; a retry with the same key and the same request returns the stored response with Idempotency-Replayed: true instead of repeating the operation, and a request reusing a key with a different body answers 422 idempotency_key_reuse. DELETE needs no key - it is naturally idempotent.

Endpoint
GET /markets List markets
GET /exchanges List exchanges
GET /accounts List accounts
GET /accounts/{account_id}/balance Get account balance
GET /accounts/{account_id}/orders List open orders
GET /accounts/{account_id}/positions List open positions
POST /orders Place an order
DELETE /orders/{order_id} Cancel an order
GET /bots List bots
POST /bots Create a bot
GET /bots/{bot_id} Get bot
DELETE /bots/{bot_id} Delete a bot
POST /bots/{bot_id}/start Start a bot
POST /bots/{bot_id}/stop Stop a bot
GET /scripts List scripts
POST /scripts Create a script
GET /scripts/{script_id} Get script
DELETE /scripts/{script_id} Delete a script
PUT /scripts/{script_id}/source Update script source
POST /backtests Run a backtest
GET /backtests/{backtest_id} Get backtest status
DELETE /backtests/{backtest_id} Delete a backtest
GET /backtests/{backtest_id}/logs Get backtest logs
GET /backtests/{backtest_id}/positions Get backtest positions
GET /labs List labs
GET /labs/{lab_id} Get lab
POST /labs/{lab_id}/start Start a lab execution
POST /labs/{lab_id}/cancel Cancel a lab execution
GET /partner/users List end-users
POST /partner/users Create an end-user
GET /partner/users/{user_id} Get an end-user
DELETE /partner/users/{user_id} Delete an end-user
GET /partner/bots List all bots
GET /partner/users/{user_id}/bots List an end-user’s bots
POST /partner/users/{user_id}/bots Create a bot
GET /partner/strategies List strategy templates
POST /partner/signals Push a signal
GET /partner/signals/{signal_token} Get the last signal
GET /partner/exchanges List enabled exchanges
GET /partner/markets List available markets
POST /partner/users/{user_id}/backtests Run a backtest
GET /partner/backtests/{backtest_id}/status Get backtest status
GET /partner/backtests/{backtest_id}/results Get backtest results
GET /partner/backtests/{backtest_id}/logs Get backtest logs
GET /partner/backtests/{backtest_id}/positions List backtest positions
DELETE /partner/backtests/{backtest_id} Cancel a backtest
POST /partner/users/{user_id}/bots/{bot_id}/start Start a bot
POST /partner/users/{user_id}/bots/{bot_id}/stop Stop a bot
DELETE /partner/users/{user_id}/bots/{bot_id} Delete a bot
PUT /partner/users/{user_id}/bots/{bot_id} Edit a bot
GET /partner/users/{user_id}/bots/{bot_id} Get a bot
POST /partner/users/{user_id}/bots/{bot_id}/copy Copy a bot
POST /partner/users/{user_id}/bots/preview Preview a grid
GET /partner/users/{user_id}/bots/{bot_id}/orders List a bot’s open orders
GET /partner/users/{user_id}/bots/{bot_id}/positions List a bot’s open positions
GET /partner/users/{user_id}/bots/{bot_id}/positions/{position_id}/orders List a position’s orders
GET /partner/users/{user_id}/bots/{bot_id}/logs List a bot’s logs
GET /partner/users/{user_id}/bots/{bot_id}/positions/closed List a bot’s closed positions