Service Unavailable
The gateway returns503 Service Unavailable when it deliberately sheds a
request it cannot serve safely. This can happen when database read capacity is
exhausted, a response cache is stale or unprimed, or a bounded deferred-write
queue is full. It is temporary overload protection, not a gateway crash.
500 Internal Server Error with
internal_error means the gateway encountered an unexpected error.
Transient Overload (503)
Any endpoint can answer 503 with error: service_unavailable when the
serving replica sheds load at its in-flight request cap. The rejection happens
before the request is parsed or dispatched, so it says nothing about the
request itself:
- The response carries a
Retry-Afterheader (whole seconds). Honor it and retry — the condition is transient by design. - Batch endpoints keep their one-element array envelope, exactly like other whole-request rejections; parse it as applying to the whole batch.
Order Placement Errors
Modify Order Errors
Modify Order returns one result per requested order. A rejected modification does not change the live order, although a separately processed fill or cancellation can still change its state.
Shared account, instrument, margin, position, reduce-only, and rate-limit errors
can also reject a modification under the same conditions as a new order.
Order Cancellation Errors
Auto-Cancel Errors
Returned when arming the auto-cancel switch withPATCH /v1/trade/auto-cancel.
Disarming skips these checks and is always allowed. A deadline already in the
past is rejected earlier with a plain 400 message.
auto_cancel_in_flight is transient. Arming succeeds once the engine finishes
the earlier cancellation.
Isolated Margin Adjustment Errors
These stable identifiers are returned when an isolated margin adjustment is rejected after sequencing. Gateway signature validation can reject a stale or future-skewed timestamp earlier asinvalid signature; that request never reaches sequencing.