Skip to content

List accounts

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

Returns every exchange account on the authenticated user, real and simulated. The account_id is the join key the account-scoped endpoints take. Returned whole - no pagination.

Requires the read scope.

Terminal window
curl "https://rest.haasapi.com/v1/accounts" \
-H "Authorization: Bearer hk_live_YOUR_KEY"

200 OK. Returns a AccountsPage.

{
"data": [
{
"account_id": "45130505-7d48-4abb-ab01-8859f5624dad",
"name": "asdf",
"exchange": "BYBITSPOT",
"market_type": "spot",
"status": "connected",
"is_simulated": true,
"is_testnet": false
},
{
"account_id": "af85799d-a214-4fd2-92ea-443c5eed18ad",
"name": "SIM Cypress Gemini",
"exchange": "GEMINI",
"market_type": "spot",
"status": "connected",
"is_simulated": true,
"is_testnet": false
}
]
}
Field Type Description
data array of Account Every exchange account on the user, real and simulated.
Field Type Description
account_id string Account identifier - the id every other endpoint accepts wherever an account is referenced (balance, bot creation). Copy it from this endpoint; never construct one.
name string User-chosen account name.
exchange string Exchange code - joins against /v1/exchanges and the exchange field on /v1/markets.
market_type AccountMarketType
status AccountStatus
is_simulated boolean Whether this is a simulated (paper-trading) account rather than one holding real exchange keys.
is_testnet boolean Whether the account trades against the exchange’s testnet environment.

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