Skip to main content
When a request fails, Dairo returns one predictable shape and a stable 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.
Branch on code, never on message (the prose can change) and never on HTTP status alone (one status maps to several codes: a 429 can be rate_limited, plan_limit_reached, budget_exceeded, or spend_cap_reached). The code names the exact condition, so your app can self-correct: invalid_domain → verify the domain; scope_missing → request the missing scope; idempotency_key_mismatch → fix the reused key.

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 typed DairoError 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.