code that says
exactly what went wrong, so your app or your agent can react instead of parsing English.
A few structured errors add a
details object. Deleting a domain that still owns inboxes
returns 409 with code cascade_confirmation_required and
details: { requiresCascadeConfirmation, inboxes, messages }, so a client can prompt
before deleting.
The full code list
Every code an API key request can return, with its typical HTTP status:
Some endpoints return a more specific
code for a particular condition, in the same
envelope: letter_not_cancelable (409, a letter already dispatched),
upload_link_consumed (409, a one-time upload link reused), and
cascade_confirmation_required (409, the domain-delete case above).
The type classes
type groups codes into a coarse class, so you can switch at a high level before drilling
into code:
Handling errors in the SDKs
The SDKs raise a typedDairoError that surfaces status, type, code, param, and
(when present) requestId. Branch on code:
The status column above carries each code’s HTTP status; for the
201-on-create and
204-on-delete conventions, see Response shape.
provider_unavailable, service_unavailable, and internal_error are the codes that
carry no actionable detail; all three are safe to retry with backoff. A reused
idempotency key is handled separately from errors; see
Idempotency.