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."
}
}
codeis the field to branch on in your code. It is stable and upper-case.typeis a broader group (auth_error,validation_error,rate_limitedand so on). Several codes can share one type.messageis 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 status | code | type | What it means | Retry? |
|---|---|---|---|---|
| 401 | AUTH_MISSING | auth_error | The request carried no API key. | No. Send the key. |
| 401 | AUTH_MALFORMED | auth_error | A 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. |
| 401 | AUTH_INVALID_KEY | auth_error | The 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. |
| 401 | AUTH_FAILED | auth_error | Sign-in or dashboard-session failure, such as a wrong password or an expired session. | No. Sign in again. |
| 403 | FORBIDDEN | forbidden | The key is valid but may not do this. | No |
| 403 | SENDER_DOMAIN_NOT_REGISTERED | sender_domain_not_registered | The 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. |
| 403 | INSUFFICIENT_SCOPE | permission_error | The key lacks the scope this endpoint needs. The message names the scope. | No. Use a key with that scope. |
| 403 | ACCOUNT_SUSPENDED | account_suspended | Sending is paused on the account. The body adds suspended_at. | No. Contact support. |
| 403 | ACCOUNT_UNDER_REVIEW | account_under_review | A 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. |
| 403 | CSRF_FAILED | auth_error | A browser session request that changes data was sent without X-Requested-With: XMLHttpRequest. API-key requests never get this. | No. Add the header. |
| 404 | NOT_FOUND | not_found | The resource doesn't exist or belongs to another account. | No |
| 408 | NO_MESSAGE | timeout | A mailbox long poll ended with no message to lease. | Yes, poll again |
| 409 | CONFLICT | conflict | The resource already exists, such as a second signup form for the same list. | No |
| 422 | VALIDATION_ERROR | validation_error | The 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. |
| 422 | RECIPIENT_SUPPRESSED | recipient_suppressed | The recipient is on your suppression list. The body adds reason and suppressed_at. | No. See Suppressed recipients. |
| 422 | ATTACHMENT_REFUSED | attachment_refused | An attachment is a blocked file type or failed the virus scan. Nothing was sent. | No |
| 429 | RATE_LIMIT_EXCEEDED | rate_limited | Too many requests or sends. See Rate limits. | Yes, after a pause |
| 429 | QUOTA_EXCEEDED | quota_exceeded | The monthly sending allowance is used up. | Yes, once retry-after has passed or the allowance is raised |
| 500 | INTERNAL_ERROR | internal_error | Something failed on our side. | Yes, with backoff |
| 503 | SERVICE_UNAVAILABLE | service_unavailable | A dependency is briefly unavailable. | Yes, with backoff |
| 503 | ATTACHMENT_SCAN_UNAVAILABLE | service_unavailable | The 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 asAuthorization: Bearer em_live_...(or in theX-EuroMail-Api-Keyheader).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 withem_live_, and the literalem_live_...from an example. A key copied only in part usually still looks right, so it comes back asAUTH_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:
reason | What happened | What to do |
|---|---|---|
bounce | Mail to the address bounced. | If the address works now, remove it from the suppression list. |
complaint | The recipient marked a message as spam. | Remove it only if they have asked to hear from you again. |
unsubscribe | The 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_flood | The 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. |
inactive | The address got many emails from you and has not opened or clicked anything for months. | If you know it is still read, remove it. |
manual | Someone 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
fromdomain 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:
| Limit | Value | Applies to |
|---|---|---|
| Per account | 50 requests per second | Every authenticated API request |
| Whole API | 500 requests per second | All traffic, before authentication |
| Send rate, first 24 hours | 5 emails a minute, 25 an hour, whether or not a paid plan's invoice has settled | Sends to anyone but yourself |
| Send rate, days 2 to 7, no settled paid plan | 15 emails a minute, 75 an hour | Sends to anyone but yourself |
| Send rate, from day 8, no settled paid plan | 100 emails a minute, 500 an hour | Sends to anyone but yourself |
| Send rate, from day 2, once a paid plan's invoice has settled | A 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 allowance | 20 recipients, refilling at 2 an hour, for the first 24 hours, whether or not you have paid | Counted per recipient, including cc and bcc |
| Monthly allowance | Your plan's volume; 3,000 until a non-zero invoice has been paid | Counted 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
| Header | When it is set | Meaning |
|---|---|---|
x-ratelimit-limit | Every authenticated response, and on a 429 from the request limits | On 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-remaining | Only on a 429 from the request limits | Always 0. It is not a live countdown. |
retry-after | On a 429 from the request limits, the send rate, the new-account allowance and the monthly allowance, and on ATTACHMENT_SCAN_UNAVAILABLE | Seconds to wait before trying again |
x-quota-limit, x-quota-used | On QUOTA_EXCEEDED | The 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,500and503. Don't retry other4xxerrors: the same request will fail the same way. - Wait for
retry-afterwhen it is present. Otherwise back off exponentially, for example 1, 2, 4 and 8 seconds, with some random jitter. - Put an
idempotency_keyin 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: anIdempotency-KeyHTTP header is ignored. See Idempotency. - The TypeScript SDK retries network errors,
429and5xxresponses for you (maxRetries, default 2), and the PHP SDK does when you setmax_retries. With the other SDKs, add the retry yourself. See SDKs.