Errors

The error format of the exx.sh API, which errors to retry and which to fix, and every error name with its HTTP status.

When the API refuses a request, it answers with an HTTP status and a JSON body in Resend's format: the status again, a stable name and a message for people.

{ "statusCode": 422, "name": "missing_required_field", "message": "Missing `subject` field." }

Match on name in your code, never on the message: messages may change wording, names do not. The SDKs keep name as the API sent it. A request that got no answer at all, such as a timeout, becomes application_error with no status in the SDKs.

Retry or fix

Each error belongs to one of four groups, and the group decides what your code does next:

AnswerWhat to do
400, 401, 403, 404, 405, 422Fix the request. Sending it again gets the same answer.
409 concurrent_idempotent_requestsThe first request with this Idempotency-Key is still running. Retry the same request after a moment.
409 invalid_idempotent_requestThis Idempotency-Key was used with another body. Use a new key for a new email.
429 rate_limit_exceededWait the seconds in retry-after, then retry.
429 daily_quota_exceeded, 429 monthly_quota_exceededStop until the next UTC day or month (rate limits and quotas).
500, 503, or no answerRetry with a growing wait, with the same Idempotency-Key so the email is sent once.

The SDKs follow this table for you: they retry rate limits, server errors and timeouts, and add an Idempotency-Key to every send they may retry. Retries and idempotency explains the key.

The request id

Every answer to a request made with a valid API key carries an x-request-id header, an error included. Keep it with your own logs: it names the request in your project's request logs in the dashboard (method, path, status, timing, key, client address; never the body), and it is the fastest way to point support at one request.

Every error

StatusNameExample message
400invalid_idempotency_keyIdempotency keys, if present, must have between 1 and 256 characters.
400validation_errorAn error was found with one or more fields in the request.
400exx_challenge_failedComplete the challenge: `turnstile_token` is missing or was refused.
400exx_invalid_codeThe code or passkey answer is not valid.
401missing_api_keyMissing API Key
401restricted_api_keyThis API key is restricted to only send emails.
401validation_errorAPI key is invalid
401exx_unauthorizedLog in to continue.
403validation_errorThe `{domain}` domain is not verified. Please, add and verify your domain.
403exx_project_pausedThis project is paused: {reason}
403exx_account_suspendedThis account is {status}.
403exx_sandbox_restrictedThe sandbox sender is restricted: {why}.
403exx_invalid_csrf_tokenThe `X-CSRF-Token` header is missing or does not match the session.
403exx_insufficient_roleThis needs the `owner`, `admin` or `developer` role in the organization.
403exx_free_org_limitYou already own an organization on the free plan; upgrade it to create more.
403exx_invalid_signatureThis download link is not valid.
403exx_email_quarantinedThis email is held for review: its attachments and raw message can be downloaded once it is released.
403exx_forbidden_sourceThe admin API is reachable from the staff network only.
403exx_second_factor_requiredConfirm with your passkey or authenticator code first.
403exx_domain_limitThe organization's plan allows {cap} domains; remove one or change the plan.
403exx_tracking_hostname_limitThe plan allows {cap} tracking hostnames per project; remove one or change the plan.
404not_foundThe requested endpoint does not exist.
405method_not_allowedMethod is not allowed for the requested path.
409concurrent_idempotent_requestsThere is another request in progress with the same idempotency key.
409invalid_idempotent_requestThis idempotency key has been used with this HTTP method and endpoint within the last 24 hours, but the request body was modified and doesn't match the original request.
409exx_subscription_activeCancel the subscription first; the organization can be deleted once it has ended.
409exx_org_deletedThe organization is deleted: it can no longer subscribe.
409exx_delivery_pendingThis delivery is still being sent; replay it once it has finished.
409exx_webhook_disabledEnable the webhook before replaying its deliveries.
409exx_contact_existsA contact with this email address already exists.
409exx_already_member`{email}` is already a member of this organization.
409exx_invite_in_progressAnother invite of this organization is being sent; try again in a moment.
409exx_property_deletingThe property `{key}` is still being deleted; create it again once its values are gone.
409exx_property_in_useThe property `{key}` is used by the segment `{name}`; change or delete the segment first.
409exx_topic_in_useThe topic `{name}` is used by the segment `{segment}`; change or delete the segment first.
409exx_export_in_progressThis project already has {count} exports in progress; ask again once one is ready.
409exx_import_in_progressThis project has an import in progress; upload the next file once it is done.
409exx_property_changedThe property `{key}` was deleted or changed type during the import.
409exx_review_decidedThis item was already decided.
409exx_project_not_changedThe project is {status}, not {wanted}.
409exx_hostname_not_failedThe hostname is {status}: only a failed one is made again.
409exx_not_deadJob {id} is not dead.
409exx_ip_not_changed{ip} is not quarantined.
409exx_broadcast_stateOnly a draft broadcast can be sent; this one is {state}.
410exx_link_expiredThis sign-in link has expired or was already used.
413exx_file_too_largeThe file must be at most {max} bytes.
422invalid_attachmentAttachment must have either a `content` or `path`.
422invalid_parameterThe `{parameter}` must be a valid UUID.
422invalid_regionThe region `{region}` is not available.
422missing_required_fieldThe request body is missing one or more required fields.
422validation_errorAn email to test addresses only may be at most {max} bytes.
422exx_content_refusedThe message links to domains on spam blocklists and was refused.
422exx_broadcast_blockedThe broadcast does not pass its checks ({ids}): see POST /broadcasts/{id}/check.
429daily_quota_exceededYou have exceeded your daily email sending quota.
429monthly_quota_exceededYou have exceeded your monthly email sending quota.
429rate_limit_exceededToo many requests. Please limit the number of requests per second.
429exx_signup_limitedToo many accounts were created from this network today.
500application_errorAn unexpected error occurred.
503service_unavailableAPI is temporarily unavailable
503exx_challenge_unavailableThe sign-in check is unavailable right now. Try again shortly.
503exx_billing_unavailableBilling is not configured on this deployment.
503exx_stream_unavailableNo IP pool can send the {stream} stream yet. Please try again later.
503exx_marketing_pool_unavailableNo IP of the marketing pool can send broadcasts yet. Please try again later.

Common questions

Why does an invalid key answer 401 on one endpoint and 400 on another?

Resend does the same, and exx.sh keeps its behaviour so that Resend code works unchanged: an unknown, revoked or malformed key answers 401 on POST /emails and POST /emails/batch and 400 elsewhere, both named validation_error.

What does 403 validation_error "domain is not verified" mean?

The from address is on a domain that is not verified in this project. Verify it (domains guide) or send from a domain that is.

On this page