← Back to docs

Errors & Rate Limits

The error format every EuroMail API call uses, what each error code means, and how to handle 429 responses and retries.

Menu

Error format

Every failed request returns a JSON body with a single error object:

{
  "error": {
    "type": "validation_error",
    "code": "VALIDATION_ERROR",
    "message": "Domain 'acme.fi' isn't verified yet, so sends are limited to your own account email ([email protected]). Verify the domain (DKIM + return-path) on the Domains page to send to anyone."
  }
}
  • code is the field to branch on in your code. It is stable and upper-case.
  • type is a broader group (auth_error, validation_error, rate_limited and so on). Several codes can share one type.
  • message is meant for people. It names the field, address or limit involved, and its wording can change, so don't parse it.
  • Some errors also carry docs_url, a link to the relevant part of this page. Not every error has one, so treat it as optional.

A few errors add fields of their own, listed below.

Error codes

HTTP statuscodetypeWhat it meansRetry?
401AUTH_MISSINGauth_errorThe request carried no API key.No. Send the key.
401AUTH_MALFORMEDauth_errorA header was sent, but it isn't an API key: another scheme such as Basic, a value that doesn't start with em_live_ or is far too short, or the placeholder em_live_... from the docs.No. Send Authorization: Bearer em_live_... with a real key.
401AUTH_INVALID_KEYauth_errorThe key is well formed, but EuroMail doesn't accept it. It may be mistyped or deleted; the response doesn't say which.No. Check the key on the API Keys page.
401AUTH_FAILEDauth_errorSign-in or dashboard-session failure, such as a wrong password or an expired session.No. Sign in again.
403FORBIDDENforbiddenThe key is valid but may not do this.No
403SENDER_DOMAIN_NOT_REGISTEREDsender_domain_not_registeredThe from domain isn't on the account. A subdomain such as mail.acme.fi is a separate domain from acme.fi: add and verify it on its own.No. Add the domain.
403INSUFFICIENT_SCOPEpermission_errorThe key lacks the scope this endpoint needs. The message names the scope.No. Use a key with that scope.
403ACCOUNT_SUSPENDEDaccount_suspendedSending is paused on the account. The body adds suspended_at.No. Contact support.
403ACCOUNT_UNDER_REVIEWaccount_under_reviewA newsletter can't start while an account without a sending history is under review: one of its messages was flagged, receiving servers refused its mail because of the sender, or our content check ran out of time on its messages. The message says which. Other mail is accepted and held for the review.After the review. Reply to the email we sent you.
403CSRF_FAILEDauth_errorA browser session request that changes data was sent without X-Requested-With: XMLHttpRequest. API-key requests never get this.No. Add the header.
404NOT_FOUNDnot_foundThe resource doesn't exist or belongs to another account.No
408NO_MESSAGEtimeoutA mailbox long poll ended with no message to lease.Yes, poll again
409CONFLICTconflictThe resource already exists, such as a second signup form for the same list.No
422VALIDATION_ERRORvalidation_errorThe request body is invalid, or the send breaks a rule: an unverified domain sending to someone other than you, a field over its limit.No. Fix the request.
422RECIPIENT_SUPPRESSEDrecipient_suppressedThe recipient is on your suppression list. The body adds reason and suppressed_at.No. See Suppressed recipients.
422ATTACHMENT_REFUSEDattachment_refusedAn attachment is a blocked file type or failed the virus scan. Nothing was sent.No
429RATE_LIMIT_EXCEEDEDrate_limitedToo many requests or sends. See Rate limits.Yes, after a pause
429QUOTA_EXCEEDEDquota_exceededThe monthly sending allowance is used up.Yes, once retry-after has passed or the allowance is raised
500INTERNAL_ERRORinternal_errorSomething failed on our side.Yes, with backoff
503SERVICE_UNAVAILABLEservice_unavailableA dependency is briefly unavailable.Yes, with backoff
503ATTACHMENT_SCAN_UNAVAILABLEservice_unavailableThe virus scanner couldn't answer, so nothing was sent. The response has retry-after.Yes, the whole request

A small number of internal failures report DATABASE_ERROR or REDIS_ERROR with status 500. Treat them like INTERNAL_ERROR.

Authentication

A 401 says which of three things went wrong:

  • AUTH_MISSING: no key was sent. Send it as Authorization: Bearer em_live_... (or in the X-EuroMail-Api-Key header).
  • AUTH_MALFORMED: something was sent, but it isn't an API key. The usual causes are the wrong scheme (Basic, or no scheme at all), a value that doesn't start with em_live_, and the literal em_live_... from an example. A key copied only in part usually still looks right, so it comes back as AUTH_INVALID_KEY.
  • AUTH_INVALID_KEY: the key looks right but isn't accepted. Check it on the API Keys page and create a new one if it was deleted.

A 403 means the key works but lacks permission: check its scopes on the API Keys page. See API Keys & Authentication.

Sender domain

SENDER_DOMAIN_NOT_REGISTERED means the from address uses a domain that isn't on the account. Each domain is added and verified on its own, so having acme.fi doesn't cover mail.acme.fi. If a parent domain is on the account, the message says so. Add the domain on the Domains page; see Domain Verification.

Suppressed recipients

RECIPIENT_SUPPRESSED carries reason, one of bounce, complaint, unsubscribe, duplicate_flood, inactive or manual, and suppressed_at. The note you may have typed when adding an entry is not repeated here; read it from the suppression list. What to do depends on the reason:

reasonWhat happenedWhat to do
bounceMail to the address bounced.If the address works now, remove it from the suppression list.
complaintThe recipient marked a message as spam.Remove it only if they have asked to hear from you again.
unsubscribeThe recipient unsubscribed.A receipt or password reset can still go out if you send it with "transactional": true. For marketing mail they have to opt in again first.
duplicate_floodThe account sent the same subject to this address more than 50 times in 24 hours.Fix the retry loop, then remove the address. Sends to your own addresses are never counted.
inactiveThe address got many emails from you and has not opened or clicked anything for months.If you know it is still read, remove it.
manualSomeone on your team, or an import, added it.Remove it to send again.

Request format

A 422 comes with a message that says what to change. The most common causes when sending:

  • the from domain is added but not verified, and the recipient isn't your own account email (see Sandbox mode);
  • a required field is missing, or a value is over its limit.

The Sending Emails guide lists every field.

Not found

A 404 is also what you get for another account's resource, so a correct ID used with the wrong account's key looks the same as a wrong ID.

Rate limits

Several limits apply at once. Each one answers with 429:

LimitValueApplies to
Per account50 requests per secondEvery authenticated API request
Whole API500 requests per secondAll traffic, before authentication
Send rate, first 24 hours5 emails a minute, 25 an hour, whether or not a paid plan's invoice has settledSends to anyone but yourself
Send rate, days 2 to 7, no settled paid plan15 emails a minute, 75 an hourSends to anyone but yourself
Send rate, from day 8, no settled paid plan100 emails a minute, 500 an hourSends to anyone but yourself
Send rate, from day 2, once a paid plan's invoice has settledA tenth of the monthly allowance of the plan you paid for, per hour, and a tenth of that per minute. An upgrade raises the rate once its invoice is paid; a downgrade lowers it at once. A free account that once paid, and a sub-account, follow the age rows. Starter (30,000 a month): 3,000 an hour, 300 a minute. Scale (350,000 a month): 35,000 an hour, 3,500 a minute. Never below 100 a minute and 500 an hour.Sends to anyone but yourself
New-account allowance20 recipients, refilling at 2 an hour, for the first 24 hours, whether or not you have paidCounted per recipient, including cc and bcc
Monthly allowanceYour plan's volume; 3,000 until a non-zero invoice has been paidCounted per recipient

Account age is counted from when the account was created. Sandbox sends (from an unverified domain to your own address) skip the send-rate limits and the new-account allowance. Each email in a batch counts on its own against the send rate.

Rate-limit headers

HeaderWhen it is setMeaning
x-ratelimit-limitEvery authenticated response, and on a 429 from the request limitsOn a normal response, the per-account limit (50 requests per second). On a 429, the limit that tripped: 50 for the per-account limit, or 500 for the whole-API limit
x-ratelimit-remainingOnly on a 429 from the request limitsAlways 0. It is not a live countdown.
retry-afterOn a 429 from the request limits, the send rate, the new-account allowance and the monthly allowance, and on ATTACHMENT_SCAN_UNAVAILABLESeconds to wait before trying again
x-quota-limit, x-quota-usedOn QUOTA_EXCEEDEDThe monthly allowance and how much of it is used

When the per-minute or per-hour send rate blocks a send, the 429 carries a retry-after with the seconds until that minute or hour ends. The message names the limit, the window, and what lifts it: the account turning 24 hours or 7 days old, or a paid plan from day 2. The code is RATE_LIMIT_EXCEEDED, the same as for the other request limits.

In a batch, an email refused by the send rate or the new-account allowance is listed in errors as before and also in rate_limited, with code set to RATE_LIMIT_EXCEEDED and a retry_after_seconds; the rest of the batch goes through. If no email in the batch was accepted and every refusal is such a limit, the whole response is a 429 with retry-after set to the longest wait, and the body is the same. Retry only the emails in rate_limited.

Retrying safely

  • Retry 429, 500 and 503. Don't retry other 4xx errors: the same request will fail the same way.
  • Wait for retry-after when it is present. Otherwise back off exponentially, for example 1, 2, 4 and 8 seconds, with some random jitter.
  • Put an idempotency_key in the JSON body of every send you might retry. It makes a retry return the original email instead of sending a second one. The key must be in the body: an Idempotency-Key HTTP header is ignored. See Idempotency.
  • The TypeScript SDK retries network errors, 429 and 5xx responses for you (maxRetries, default 2), and the PHP SDK does when you set max_retries. With the other SDKs, add the retry yourself. See SDKs.

Send your first email in about 90 seconds

The free tier includes 3,000 emails a month. Email storage and AI processing in Finland, with a DPA on every plan.

Create free account See live delivery data