Skip to content

API

Errors

The error format, the error names and what to do for each one.

Format

An error responds with an HTTP status and always a JSON body (here with Accept-Language: en):

JSON
{
  "statusCode": 422,
  "name": "validation_error",
  "message": "to: at least one recipient",
  "error": "to: at least one recipient"
}
  • name is stable: it is what your code tests.
  • message says which field and why, in the language of the request (Accept-Language; seven languages: French, English, Spanish, Italian, Russian, Chinese, German), with Content-Language when it is translated. error repeats the same text.
  • There is no per-field error array: the first error found is returned.

The names

StatusnameWhat to do
400, 415, 422validation_errorfix the request (the message names the field): unreadable JSON, unknown field, wrong type, wrong Content-Type, invalid filter
422invalid_attachmentattachment: base64, name, type, content_id, or unsupported path
413message_too_largeVoaaro Cloud: message larger than the plan's maximum size (max_message_bytes); send the files as links
422attachment_quota_exceededVoaaro Cloud: the plan's monthly attachment allowance is used up (attachment_bytes_per_month, attachment_bytes_used)
422invalid_idempotency_keyIdempotency-Key of 1 to 256 ASCII characters
401missing_api_keyadd Authorization: Bearer mlk_…
401invalid_api_keyunknown or revoked key, or inactive account
401restricted_api_keya full_access key is needed, a personal key with receiving, or an application key (domains, suppression list, newsletters)
401unauthorizedsending_access key on the domains API: full_access is needed
403invalid_accessdomain outside the key, sending disabled, domain not yet verified
403restricted_api_keypersonal keys disabled, key without the send scope, or the domain's organization suspended
403, 429plan_limitpersonal key of an account on a plan: plan limit reached (recipients per message, sends per day); the body adds code, limit, plan and upgrade (a larger plan exists)
403billing_holdpersonal key of an account suspended for non-payment
403operator_api_disabled/organizations routes disabled: enable them in the administration
403sender_identity_violationpersonal key: a from that is not its owner's address (warning counted)
403api_sending_suspendedAPI sending suspended after three warnings: an administrator must restore it
400challenge_requiredbrowser signup API: ask for a challenge and send the proof of work (anti-bot)
403origin_not_allowedbrowser API: add the page's origin to the form's allowed_origins (origins)
404invalid_tokeninvalid unsubscribe token, or from another domain (unsubscribing)
404not_foundnot found, outside the key's scope, or unknown route
405method_not_allowedmethod not allowed on this route; the Allow header lists the allowed ones
409conflictthe current state does not allow it (already sent, not a draft…)
409invalid_idempotent_requestsame Idempotency-Key, different request (body, path or parameters)
409concurrent_idempotent_requeststhe same request is already in progress: retry
413payload_too_largerequest body too large
429daily_quota_exceededdaily quota reached: wait or have the quota raised
429rate_limit_exceededtoo many requests for the key (600 per minute) or too many webhook replays: wait Retry-After; daily sending quota of the organization reached: wait; too many invalid keys from this IP address: wait 15 minutes
503service_unavailablestorage or dependency unavailable: retry later
500application_errorinternal error (details in the server logs)

Always JSON

Every error response from /api/v1 has the body above, even when the request reaches no route:

CaseResponse
unknown route (/api/v1/emial)404 not_found
method not allowed (DELETE /api/v1/emails)405 method_not_allowed, with the Allow header
unreadable JSON, unknown field or field of the wrong type400 or 422 validation_error
body too large413 payload_too_large

The HTTP status does not change from one version to the next; test it first, then name.

Retrying or not

  • Retry (with the same Idempotency-Key for a creation): network errors, 409 concurrent_idempotent_requests, 5xx.
  • Retry after Retry-After: 429 rate_limit_exceeded.
  • Do not retry as is: the other 4xx (fix the request), except 429 daily_quota_exceeded, later.

The SDKs retry network errors, 429 rate_limit_exceeded and 5xx on their own, and translate the errors: {data, error} in Node, typed exceptions in Python and PHP, *voaaro.Error in Go (SDKs).

Esc