Error Codes

All REST responses share the same shape: { "code": N, "data": { ... }, "timestamp": "...", "request_id": "..." }. On error, data is replaced by message. See Base URLs.

Error Code Reference

CodeHTTPCategoryDescription
0200SuccessOperation completed successfully
1000401Authinvalid_request — malformed auth request
1001401Authinvalid_client — unknown client_id, bad client_secret, or bad passphrase
1002401Authtoken_expired — bearer token past its expires_in window
1003401Authtoken_revoked — bearer token was revoked
1004401Authnot_authenticated — missing Authorization header
1005400Authunsupported_grant_type — only client_credentials is supported
1006403Authinsufficient_scope — token lacks required scope
1100500SystemInternal server error
1101400SystemInvalid JSON format
1102415SystemInvalid or missing Content-Type
1200409AccountAccount already exists
1201404AccountAccount not found
1300500DatabaseDatabase operation failed
1301409DatabaseDatabase constraint violation
1400404TradingOrder not found or in a terminal state
1401403TradingOrder belongs to a different account
1402400TradingOrder type does not support the requested operation
1403400ValidationMissing or invalid required fields
1404409Tradingduplicate_client_order_idclient_order_id collides with another live order
1405503TradingBook full — per-symbol order book capacity reached
1406400TradingNo counterparty available
1407400TradingInsufficient liquidity — FOK order cannot be fully filled
1410400RiskMargin insufficient
1411400RiskPosition limit exceeded
1412400RiskAccount in liquidation; new orders blocked
1413400RiskRequested leverage above instrument max_leverage
1414410Riskinstrument_halted — instrument not currently accepting orders
1429429Rate LimitRate limit exceeded — see Rate Limits
1430400Trade RulesTrade rule violation (minimum notional, quote rest period)
1500500SystemUnexpected internal server error
1501503SystemService unavailable
1502202SystemService degraded — order queued; higher latency expected
1503503SystemTemporarily unavailable — matching engine paused, retry later

HTTP Status Codes

StatusDescription
200Success
202Accepted — request queued (see System Status)
204No content (e.g. successful token revoke)
304Not Modified (conditional GET, see Get Instruments)
400Bad request
401Unauthorized
403Forbidden
404Not found
409Conflict (idempotency / constraint)
410Gone / halted (instrument status)
415Unsupported media type
429Rate limited
500Server error
503Service unavailable

Error Response Example

{
  "code": 1410,
  "message": "Margin insufficient: available 1200.00 USDC, required 5000.00 USDC",
  "timestamp": "2026-04-20T10:30:00.123Z",
  "request_id": "req_01HXYZ..."
}

Handling Errors

  1. Inspect code — HTTP status is a coarse hint, code is the authoritative classifier.
  2. Auth (10001006) — refresh the bearer via POST /auth/token, then retry.
  3. Validation (1403, 11011102) — fix the request; retries will keep failing.
  4. Trading (14001407, 1414) — inspect message; 1404 means use a fresh client_order_id; 1407 means switch from FOK to IOC or reduce size.
  5. Risk (14101413) — check margin and position state via GET /positions before retrying. See Margin & Liquidation and Pre-Trade Risk Validation.
  6. Rate limit (1429) — back off exponentially; rate-limit headers (X-RateLimit-Remaining, X-RateLimit-Reset) tell you when to retry.
  7. Degraded (1502) — your order is queued; do not resubmit.
  8. System (15001501, 1503) — retry with exponential backoff starting at 1s.