Start here

Errors and retries

Parse the standard JSON error envelope and decide when a retry is safe.

Error envelope

JSON API failures use one top-level error object with a human-readable message, the numeric HTTP status, and an optional stable code. The OpenAPI contract references this schema for expected and unexpected failures.

Error response
{
  "error": {
    "code": "invalid_request",
    "message": "A verified From domain is required",
    "status": 403
  }
}

Client errors

Correct 400 input errors before retrying. Replace or revoke invalid credentials after 401. A 402 requires paid entitlement, 403 marks a policy or permission boundary, 404 is a missing tenant-scoped resource, 409 is a state or idempotency conflict, 413 exceeds attachment limits, and 422 covers validation or suppression.

Retry decisions

Do not automatically retry authentication, validation, suppression, conflict, or 402 subscription_required failures. A 402 means the workspace has no active subscription; choose a plan, then send. A 423 with code sender_paused means the exact From identity is paused. A 423 with code account_paused means the workspace is paused for review: the body includes the measured bounce and complaint rates and the limits they crossed (bounce_rate vs bounce_limit, complaint_rate vs complaint_limit). Stop that stream. A 429 with code daily_limit_reached is the workspace daily ladder, not a short backoff. Wait until resets_at (midnight UTC). Retry-After is the seconds until then. hourly_limit_reached waits until the next UTC hour. gmail_recipient_limit waits until midnight UTC. The refused message was not queued. Other 429 responses (quota_exhausted) wait until that monthly, per-sender, or attachment limit resets. A caller may retry a transient 502 or 503 with bounded exponential backoff and jitter. Preserve the same Idempotency-Key and identical JSON payload when retrying one logical send.

Support context

Record the request time, route, HTTP status, SendHQ resource ID, and non-secret error fields. Never include an API key, session cookie, message body, or recipient list in a support report.