Reference
Errors
Every error code the API returns, grouped by area, with what to do about each one.
On this page
Every error body carries its code in code, and repeats it in status for clients written before code was on every error. Branch on the code, not on the message text, which can change. Errors and retry decisions shows the body and how to read it in each SDK.
Every request
These can come back from any endpoint: a bad key, a missing idempotency key, the rate limit, or a temporary failure on our side.
| Code | HTTP status | What to do |
|---|---|---|
invalid_request | 400 | A field is missing or invalid. fields names each one and says what to change. |
idempotency_key_required | 400 | Send an Idempotency-Key header of 1-128 characters. |
quota_exceeded | 402 | The workspace reached a plan or spending limit. kind says what ran out (recipients, attachment_bytes or money_cents), window says which limit (daily on Free, or monthly), and resetsAt says when it starts over. Upgrade or raise the limit in the dashboard, or retry after resetsAt. |
not_found | 404 | The ID is wrong, or the resource belongs to another workspace than the API key. |
idempotency_conflict | 409 | This idempotency key was used with a different body. Retry with the original body, or use a new key for a new message. |
idempotency_in_progress | 409 | The first request with this key is still running. Wait for Retry-After, then retry with the same key and body. |
payload_too_large | 413 | The request body is larger than this endpoint accepts. |
rate_limited | 429 | Too many requests. Wait for Retry-After, then retry with the same idempotency key. |
provider_failure | 502 | An upstream provider failed. Retry with backoff. |
send_temporarily_unavailable | 503 | Sending is briefly unavailable. Wait for Retry-After, then retry with the same idempotency key. |
Sending email
Emails, templates, attachments, webhooks and blocked addresses.
| Code | HTTP status | What to do |
|---|---|---|
duplicate_recipient | 400 | Remove duplicate recipient addresses and try again. |
invalid_template | 400 | A template field is missing or invalid. fields names each one. |
invalid_api_key | 401 | The API key is missing, malformed, unknown, revoked or expired. message says which. Send Authorization: Bearer em_live_... or em_test_.... |
missing_scope | 403 | The API key lacks the scope this operation needs. requiredScope names it. Create a key that includes it. |
idempotency_record_deleted | 409 | The first request with this key created a webhook endpoint that was deleted since. Use a new key to create another. |
attachment_upload_not_open | 409 | The attachment upload is not open. |
attachment_upload_expired | 409 | The attachment upload has expired. |
attachment_upload_mismatch | 409 | The attachment upload does not match this request. |
template_name_conflict | 409 | Choose a different template name. |
template_limit_reached | 409 | You have reached the email template limit for this organization. |
template_storage_limit_reached | 409 | Delete or shrink existing email templates before adding more content. |
template_in_use | 409 | A scheduled or sending broadcast, or an active or paused automation, uses the template. Give it another template, or stop it, then delete again. |
webhook_endpoint_limit_reached | 409 | You have reached the webhook endpoint limit for this organization. |
webhook_url_taken | 409 | An endpoint with this URL already exists. Update or delete that endpoint instead. |
domain_in_workspace | 409 | This workspace already has this domain. A domain sends one kind of email, so add a second subdomain for the other kind. |
receiving_address_taken | 409 | This address already receives email. |
receiving_address_limit_reached | 409 | The domain has as many receiving addresses as the plan allows. limit gives the number. |
receiving_unavailable | 403 | Email receiving isn't available yet. Try again later. |
inbound_email_content_unavailable | 410 | The content of this email was removed after 30 days. Only its summary is kept. |
message_too_large | 413 | The encoded message is over the size limit. actualBytes and limitBytes give the numbers. |
sender_domain_inactive | 422 | The from address is not on an active sending domain of this workspace. |
sender_domain_not_found | 422 | The sender's domain isn't added to this account. Add it on the Domains page. |
sender_domain_not_allowed | 422 | This API key can only send from the domains chosen when it was created. Send from one of them, or use a key that allows this domain. |
sender_domain_wrong_purpose | 422 | The sender's domain is set up for a different kind of email. Transactional and marketing email each need their own domain. |
sandbox_sender_address | 422 | The sandbox domain has one sender address, onboarding@ followed by the sandbox domain. Send from that address, or add and verify your own domain on the Domains page. |
sandbox_recipient_not_member | 422 | The sandbox sender only sends to verified members of this workspace. To email anyone else, add and verify your own domain on the Domains page. |
sandbox_daily_limit_reached | 422 | This workspace has sent its 10 sandbox emails for the last 24 hours. Try again later, or add and verify your own domain on the Domains page to send without this limit. |
sandbox_marketing_not_allowed | 422 | Marketing email and broadcasts can't be sent from the sandbox sender. Add and verify a marketing domain on the Domains page. |
organization_cannot_send | 422 | This organization is not allowed to send email right now. |
subscription_inactive | 422 | Activate billing before sending email. |
live_sending_not_approved | 403, 422 | Sending is paused for this organization. Check the dashboard or contact support. |
recipient_suppressed | 422 | Nothing was sent to anyone. addresses lists the blocked recipients. Remove them and send again. |
attachment_not_clean | 422 | Wait for attachment scanning to finish before sending. |
template_not_found | 422 | No template has this templateId. Copy the ID from the Templates page. |
template_render_failed | 422 | The template could not be filled in with the values you sent. missing names the values it needs. |
test_recipient_not_member | 422 | Test copies can only go to verified members of this organization. |
invalid_webhook_url | 422 | Enter a valid HTTPS webhook URL. |
forward_address_not_member | 422 | Email can be forwarded only to the verified email address of a member of your organization. |
mailbox_provider_domain | 400 | This domain belongs to a mailbox provider, so its DNS records cannot be added. Use a domain you own. |
invalid_local_part | 400 | Enter the part before the @ using letters, digits and . _ + -, starting and ending with a letter or digit. |
temporarily_unavailable | 503 | The request took too long on our side and was stopped. Wait for Retry-After, then retry; for a send, use the same idempotency key. |
Domains
| Code | HTTP status | What to do |
|---|---|---|
live_key_required | 403 | Domain calls need a live API key with the send scope. Test keys cannot manage domains. |
api_key_domain_restricted | 403 | This API key can only send from some domains, so it can't manage domains. Use a key that isn't limited to domains. |
domain_limit_reached | 409 | You have reached the domain limit for this organization. |
domain_taken | 409 | This domain is already connected to an account. |
tenant_missing | 409 | Sending is still being set up for this organization. Try again in a few minutes. |
plan_missing | 409 | Choose a plan before adding a domain. |
invalid_domain | 400 | Enter a valid domain name. |
Newsletters
Contacts, audiences, imports, broadcasts and automations.
| Code | HTTP status | What to do |
|---|---|---|
marketing_single_recipient_required | 400 | Marketing email goes to exactly one to recipient, with no cc or bcc. |
marketing_list_management_not_allowed | 400 | Ternwire generates unsubscribe headers for marketing email. Remove listManagement. |
marketing_disabled | 403 | Marketing email is not enabled for this account. |
marketing_live_key_required | 403 | Contacts, audiences and imports are managed with a live API key. |
contact_limit_exceeded | 403 | This list would take your organization past the contacts its plan can hold. Upgrade the plan, or import a smaller list. |
audience_too_large | 403 | This audience has more confirmed contacts than your plan can send to right now. Upgrade the plan, or send to a smaller segment. |
ab_test_not_configured | 404 | This broadcast has no A/B test. |
marketing_stream_not_approved | 409, 422 | Marketing email is not turned on for this organization yet. Save sender details and verify a newsletter domain in the dashboard. |
audience_archived | 409 | This audience is archived and no longer accepts changes or subscriptions. |
broadcast_active | 409 | Another broadcast is scheduled, testing, sending or paused. Wait for it to finish or cancel it first. |
invalid_transition | 409 | This action is not allowed in the current state. |
ab_test_tracking_required | 409 | The A/B test picks its winner on a metric that tracking does not record. Turn on click or open tracking in marketing settings, or change the winner metric. |
ab_test_winner_chosen | 409 | The A/B test already has a different winner. |
automation_not_editable | 409 | Pause the automation before changing it. The audience can change only before the first activation. |
import_batch_incomplete | 409 | Some parts of this file have not arrived. Upload the rest before continuing. |
import_batch_mismatch | 409 | A part must follow the one before it and use the same audience, consent and source. Upload the file again with a new key. |
import_expired | 410 | This import expired before it was applied. Upload the file again. |
marketing_stream_paused | 422 | Marketing email is paused for this account. Transactional email is unaffected. |
marketing_warmup_limit_reached | 422 | During its first 14 days, an organization can send up to 200 marketing emails a day. Try again after midnight UTC. |
preview_contact_missing | 422 | The template could not be rendered, and the audience has no contacts to preview it with. Add a contact to the audience, then preview again. |
contact_import_invalid | 422 | Upload a CSV export with an email column. One request holds at most 10,000 rows, and the upload commands split a larger file for you. |
confirmation_sender_unverified | 422 | Send confirmations from an address on a verified marketing sending domain. |
marketing_sender_unverified | 422 | Send broadcasts from an address on a verified marketing sending domain. |
schedule_out_of_range | 422 | Schedule the broadcast for a future time no more than 30 days ahead. |
ab_test_variant_not_found | 422 | The A/B test has no variant with that name. |
automation_step_not_email | 422 | Only a send_email step can be sent as a test copy. |