response.data.statuses. Check each result: HTTP 200 and top-level status: "ok" can still
contain rejected items.
Batched Action Errors
Orders returnstatus: "rejected" with an error message and an optional code. Cancels return
{ "error": "..." } objects; modifies can also include code. Rejected orders and modifies
include free with CLOSE_CAPACITY_EXCEEDED. Cancel and modify responses also include per-item
details in metadata.results.
Common batch errors are listed below. Use code when present; a dash means the example has no
separate error code.
PORTFOLIO_MARGIN_LIMIT applies while portfolio margin decides account health: the order would
leave the portfolio margin ratio at or above its liquidation entry line once filled at its worst
permitted price, which for a market order is its slippage limit. Reduce the size or the slippage.
Cross perp orders and modifications are admitted on initial margin and do not return it.
Closing orders and modifications can also return CLOSE_CAPACITY_EXCEEDED, with free indicating
the remaining size available to close, or CLOSE_IN_PROGRESS while another immediate close is
superseding resting close orders. Venue rejections and market-specific checks can return other messages.
In normalTpsl and positionTpsl batches, if one leg fails validation, the other legs are also
returned as rejected with <grouping> batch rejected because another leg failed validation. If
the parent order failed, its TP/SL children use PARENT_REJECTED.
Whole-Batch Errors
Some failures reject the entire request before individual results are returned, including invalid signatures, malformed fields, empty batches, and batches of more than 20 orders or 256 cancels. Handle a single request error as well as per-item errors. See Order history for terminal order states.Request Errors
field and retryAfter are optional; retryAfter is in seconds and is also sent as the
Retry-After header. timestamp is in Unix milliseconds.
Some info errors contain only { "error": "..." }. Use code when present.
Account and position reads return HTTP 503 with code: "SERVICE_UNAVAILABLE" when the
required account data cannot be evaluated. This is separate from a malformed request.
Error Codes
/exchange may answer 429 with RATE_LIMITED, a Retry-After header and retryAfter in the body
when an account sends actions faster than its allowance. Actions signed by an account’s API wallets
count against that account. Orders and modifies count one per item. Cancels, TWAP cancels, isolated
margin additions, reduce-only TWAP orders, and orders and modifies whose every item is reduce-only
have an allowance separate from other trading actions, and withdrawals have their own. A modify item
counts as reduce-only only when it sends r: true. A refused action was not submitted and its nonce
is unused. The same signed request is accepted after Retry-After while its
nonce is still in the signer’s window and
its expiresAfter, if any, has not passed.
Account update codes appear in a "failed" result for hexadecimal-asset
updateLeverage and
updateIsolatedMargin requests, which
can also use INVALID_STATE or SERVICE_UNAVAILABLE. Protocol transfer quotes return 429 with
BACKPRESSURE when rate limited. Order rejections on
userOrderRejections can also use
VENUE_POSITION_LIMIT, WALLET_RISK_LIMIT, and CIRCUIT_BREAKER_OPEN.
Order, cancel, and modify signature failures return 401 with UNAUTHORIZED. Read credential
failures return 401 or 403 with UNAUTHORIZED. Nonce rejections return 400 with
VALIDATION_FAILED and the reason in error, such as Nonce rejected: NONCE_ALREADY_USED.
Leverage and isolated-margin updates return a reused nonce as 503 with SERVICE_UNAVAILABLE
because the outcome is unknown; numeric-asset requests return other rejections as HTTP 200 with
status: "err" and the message in response.
Rejected transfer or outcome-operation retries can return HTTP 200 with top-level
status: "error".
Retries
RespectRetry-After when present. After a timeout, disconnect, or 500, query account, order,
or operation state before submitting a new signed action; the original may have been accepted.
Order and modify retries can return code: "RETRY_OUTCOME_UNKNOWN" with a message and no
error. Orders use status: "unknown"; modifies use unknown: { cloid }. This means there is
no authenticated outcome evidence. Check orders and fills before placing or modifying again.
/exchange diagnostic headers: X-Request-Id, X-Client-Request-Id, and X-Transaction-Id.
Browsers can read these and Retry-After from cross-origin responses.