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.

CodeHTTP statusWhat to do
invalid_request400A field is missing or invalid. fields names each one and says what to change.
idempotency_key_required400Send an Idempotency-Key header of 1-128 characters.
quota_exceeded402The 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_found404The ID is wrong, or the resource belongs to another workspace than the API key.
idempotency_conflict409This idempotency key was used with a different body. Retry with the original body, or use a new key for a new message.
idempotency_in_progress409The first request with this key is still running. Wait for Retry-After, then retry with the same key and body.
payload_too_large413The request body is larger than this endpoint accepts.
rate_limited429Too many requests. Wait for Retry-After, then retry with the same idempotency key.
provider_failure502An upstream provider failed. Retry with backoff.
send_temporarily_unavailable503Sending is briefly unavailable. Wait for Retry-After, then retry with the same idempotency key.

Sending email

Emails, templates, attachments, webhooks and blocked addresses.

CodeHTTP statusWhat to do
duplicate_recipient400Remove duplicate recipient addresses and try again.
invalid_template400A template field is missing or invalid. fields names each one.
invalid_api_key401The API key is missing, malformed, unknown, revoked or expired. message says which. Send Authorization: Bearer em_live_... or em_test_....
missing_scope403The API key lacks the scope this operation needs. requiredScope names it. Create a key that includes it.
idempotency_record_deleted409The first request with this key created a webhook endpoint that was deleted since. Use a new key to create another.
attachment_upload_not_open409The attachment upload is not open.
attachment_upload_expired409The attachment upload has expired.
attachment_upload_mismatch409The attachment upload does not match this request.
template_name_conflict409Choose a different template name.
template_limit_reached409You have reached the email template limit for this organization.
template_storage_limit_reached409Delete or shrink existing email templates before adding more content.
template_in_use409A 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_reached409You have reached the webhook endpoint limit for this organization.
webhook_url_taken409An endpoint with this URL already exists. Update or delete that endpoint instead.
domain_in_workspace409This workspace already has this domain. A domain sends one kind of email, so add a second subdomain for the other kind.
receiving_address_taken409This address already receives email.
receiving_address_limit_reached409The domain has as many receiving addresses as the plan allows. limit gives the number.
receiving_unavailable403Email receiving isn't available yet. Try again later.
inbound_email_content_unavailable410The content of this email was removed after 30 days. Only its summary is kept.
message_too_large413The encoded message is over the size limit. actualBytes and limitBytes give the numbers.
sender_domain_inactive422The from address is not on an active sending domain of this workspace.
sender_domain_not_found422The sender's domain isn't added to this account. Add it on the Domains page.
sender_domain_not_allowed422This 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_purpose422The sender's domain is set up for a different kind of email. Transactional and marketing email each need their own domain.
sandbox_sender_address422The 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_member422The 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_reached422This 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_allowed422Marketing email and broadcasts can't be sent from the sandbox sender. Add and verify a marketing domain on the Domains page.
organization_cannot_send422This organization is not allowed to send email right now.
subscription_inactive422Activate billing before sending email.
live_sending_not_approved403, 422Sending is paused for this organization. Check the dashboard or contact support.
recipient_suppressed422Nothing was sent to anyone. addresses lists the blocked recipients. Remove them and send again.
attachment_not_clean422Wait for attachment scanning to finish before sending.
template_not_found422No template has this templateId. Copy the ID from the Templates page.
template_render_failed422The template could not be filled in with the values you sent. missing names the values it needs.
test_recipient_not_member422Test copies can only go to verified members of this organization.
invalid_webhook_url422Enter a valid HTTPS webhook URL.
forward_address_not_member422Email can be forwarded only to the verified email address of a member of your organization.
mailbox_provider_domain400This domain belongs to a mailbox provider, so its DNS records cannot be added. Use a domain you own.
invalid_local_part400Enter the part before the @ using letters, digits and . _ + -, starting and ending with a letter or digit.
temporarily_unavailable503The 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

CodeHTTP statusWhat to do
live_key_required403Domain calls need a live API key with the send scope. Test keys cannot manage domains.
api_key_domain_restricted403This 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_reached409You have reached the domain limit for this organization.
domain_taken409This domain is already connected to an account.
tenant_missing409Sending is still being set up for this organization. Try again in a few minutes.
plan_missing409Choose a plan before adding a domain.
invalid_domain400Enter a valid domain name.

Newsletters

Contacts, audiences, imports, broadcasts and automations.

CodeHTTP statusWhat to do
marketing_single_recipient_required400Marketing email goes to exactly one to recipient, with no cc or bcc.
marketing_list_management_not_allowed400Ternwire generates unsubscribe headers for marketing email. Remove listManagement.
marketing_disabled403Marketing email is not enabled for this account.
marketing_live_key_required403Contacts, audiences and imports are managed with a live API key.
contact_limit_exceeded403This list would take your organization past the contacts its plan can hold. Upgrade the plan, or import a smaller list.
audience_too_large403This 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_configured404This broadcast has no A/B test.
marketing_stream_not_approved409, 422Marketing email is not turned on for this organization yet. Save sender details and verify a newsletter domain in the dashboard.
audience_archived409This audience is archived and no longer accepts changes or subscriptions.
broadcast_active409Another broadcast is scheduled, testing, sending or paused. Wait for it to finish or cancel it first.
invalid_transition409This action is not allowed in the current state.
ab_test_tracking_required409The 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_chosen409The A/B test already has a different winner.
automation_not_editable409Pause the automation before changing it. The audience can change only before the first activation.
import_batch_incomplete409Some parts of this file have not arrived. Upload the rest before continuing.
import_batch_mismatch409A part must follow the one before it and use the same audience, consent and source. Upload the file again with a new key.
import_expired410This import expired before it was applied. Upload the file again.
marketing_stream_paused422Marketing email is paused for this account. Transactional email is unaffected.
marketing_warmup_limit_reached422During its first 14 days, an organization can send up to 200 marketing emails a day. Try again after midnight UTC.
preview_contact_missing422The 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_invalid422Upload 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_unverified422Send confirmations from an address on a verified marketing sending domain.
marketing_sender_unverified422Send broadcasts from an address on a verified marketing sending domain.
schedule_out_of_range422Schedule the broadcast for a future time no more than 30 days ahead.
ab_test_variant_not_found422The A/B test has no variant with that name.
automation_step_not_email422Only a send_email step can be sent as a test copy.