Errors and limits
The API answers with the usual HTTP status codes. An error has a JSON body that says why, with two exceptions: a 404 has no body, and neither has a 400 for a body that is not JSON or has a field of the wrong type (a string where a list belongs, say). A method or a content type that a path does not take answers 404 too; send JSON with Content-Type: application/json.
Status codes
| Status | Body | When |
|---|---|---|
200, 201, 202, 204 | the result (none for 204) | success; 202 means accepted, the work happens afterwards |
400 | validation problem | a field is not valid; the body lists the fields |
401 | {"error": "invalid_api_key"} | no key, or a key that does not exist or was revoked |
403 | {"error": "…"} | insufficient_scope, client_ip_not_allowed, organization_suspended or project_suspended, see Authentication |
404 | none | no such resource in this key's project and mode, or no such path |
409 | {"error": "…"} | conflicts with what is there, see the codes below |
413 | {"error": "…", "message": "…"} | too large: the message, its size times its recipients, or the request body; the message names the limit, see Message size |
422 | {"error": "…"} | valid, but cannot be done now, see the codes below |
429 | {"error": "…"} | a limit; wait as long as the Retry-After header says (in seconds) |
500 | problem with a traceId | an error at Postilio; quote the traceId when you contact support |
503 | {"error": "…"} | service_degraded when sending: Postilio takes no new messages for now, wait as long as Retry-After says; or dns_unavailable from a domain check |
Validation problems
A 400 is application/problem+json with the problems per field:
{
"type": "https://tools.ietf.org/html/rfc9110#section-15.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"errors": {
"to": ["Between 1 and 50 recipients are required."],
"body": ["Either text or html is required."]
},
"traceId": "00-4d6a1c9b71484cc59ac852cda603b93c-28de36d1c118bc08-00"
}
The keys of errors are the request's field names; body stands for text and html together, and idempotencyKey for the Idempotency-Key header. Fix the request before you send it again: the same request gets the same answer.
404, never 403, for what is not yours
A resource of another project answers 404, just like one that does not exist, so ids cannot be probed. The same goes for the other mode: a test key does not find live messages, and a live key does not find test messages.
Error codes
| Status | error | Meaning |
|---|---|---|
401 | invalid_api_key | the key is missing, unknown or revoked |
403 | insufficient_scope | the key lacks the scope of this call |
403 | client_ip_not_allowed | the key may not be used from this address |
403 | organization_suspended | Postilio suspended your organization: no project sends until it is resumed |
403 | project_suspended | the key's project is paused or suspended; your other projects keep sending |
403 | inbound_not_in_plan | inbound mail is not available to your organization, see Inbound mail |
409 | idempotency_key_reused_with_different_request | the Idempotency-Key was used for another request in the last 24 hours |
409 | domain_exists | the project has this domain already |
409 | address_already_suppressed | the address is on the suppression list already |
413 | message_too_large | the message is over 10 MB, see Message size |
413 | message_too_large_for_recipients | the message's size times its recipients is over 25 MB; send to fewer recipients at a time |
413 | payload_too_large | the request body is over what the endpoint reads (21 MB for sending, 1 MB elsewhere); it is not read further |
409 | domain_limit_reached | your plan allows no more domains, see Plan limits |
409 | webhook_endpoint_limit_reached | the project has 10 webhook endpoints, or your plan allows no more |
409 | delivery_still_pending | the delivery is still being retried |
409 | email_not_scheduled | the message is not waiting for its sendAt (any more): it was not scheduled, was canceled, or is on its way |
409 | scheduled_limit_reached | the project holds 10,000 scheduled messages, see Scheduled sending |
409 | scheduled_size_limit_reached | the project's scheduled messages would hold more than 256 MB together |
409 | endpoint_paused | resume the webhook endpoint first |
409 | inbound_domain_exists, inbound_domain_taken, inbound_domain_has_mx, inbound_domain_limit_reached | adding a receiving domain, see Inbound mail |
409 | inbound_route_exists, inbound_route_limit_reached | adding an inbound route, see Routes |
409 | inbound_route_has_no_endpoint, inbound_still_processing | redelivering a received message, see Redeliver |
410 | inbound_content_deleted | the received message's content went, see Content is kept briefly |
422 | unverified_sender_domain | the sender's domain is not verified, or has been failing for over 72 hours |
422 | sender_domain_not_allowed_for_key | the key is restricted to other sending domains |
422 | sandbox_recipient_not_allowed | in the sandbox: a recipient outside your team and verified domains |
422 | send_at_too_soon | sendAt is less than a minute ahead, or in the past |
422 | send_at_too_far | sendAt is more than 30 days ahead |
422 | attachment_type_not_allowed | an attachment is an executable file, such as .exe or .js; the message names it, see Attachments |
422 | cc_bcc_require_single_to | cc or bcc with more than one address in to, see Cc and Bcc |
422 | inbound_domain_reserved, inbound_domain_not_found, webhook_endpoint_not_found, webhook_endpoint_mode_mismatch | see Inbound mail |
422 | reason_required | removing a complaint from the suppression list needs a reason |
422 | test_recipient_not_confirmed | a test email to an address that is neither confirmed for test emails nor a member's, see Test emails |
429 | sandbox_daily_limit_reached | in the sandbox: the day's recipients are used up |
429 | sandbox_rate_limit_reached | in the sandbox: this minute's recipients are used up |
429 | probation_daily_limit_reached | in the first weeks after the sandbox: the day's recipients are used up, see Probation |
429 | probation_rate_limit_reached | in the first weeks after the sandbox: this minute's recipients are used up |
429 | project_daily_limit_reached | the project's own limit: the day's recipients are used up |
429 | project_rate_limit_reached | the project's own limit: this minute's recipients are used up |
429 | plan_monthly_limit_reached | your plan's month is used up, see Plan limits |
429 | plan_daily_limit_reached | your plan's day is used up |
429 | plan_rate_limit_reached | your plan's minute is used up |
429 | platform_rate_limit_reached | the platform's safety limit per key or project, or on a project's test keys: this minute's recipients are used up, see Platform limits |
429 | platform_daily_limit_reached | the platform's safety limit per project, or on its test keys: the day's recipients are used up |
429 | test_mail_daily_limit_reached | the project's test emails for the day (UTC) are used up |
429 | too_many_checks | a domain can be checked once a minute |
503 | service_degraded | Postilio takes no new messages for now, to protect its storage; nothing was stored, so send it again after Retry-After |
503 | dns_unavailable | the domain check got no answer from DNS |
Handle a code you do not know by its status code.
The sandbox
A new organization starts in the sandbox. By default its live mail:
- goes only to the organization's active members and to addresses on the verified domains of its projects. A message with any other recipient answers
422 sandbox_recipient_not_allowed, and nothing of it is sent; - is limited to 100 recipients per day (UTC) and 10 recipients per minute, for the whole organization, through the API and SMTP together. Over a limit the answer is
429withsandbox_daily_limit_reachedorsandbox_rate_limit_reached, and aRetry-Afteruntil the next UTC day or minute. A message that is refused uses up nothing, and a suppressed recipient doesn't count.
Your plan's own limits apply in the sandbox too; the lower of the two counts, and names the error: sandbox_… when the sandbox's limit is as low as the plan's or lower, plan_… when the plan's is lower.
Test keys are never limited by the sandbox. The Sandbox page in the portal shows your organization's limits, the day's usage and how to ask for full access, which lifts them.
Probation after the sandbox
Full access starts with four weeks of probation. Your live mail goes to any address, but the whole organization sends under a cap that rises each week, counted from the day you got full access:
| Week | Recipients per day (UTC) | Recipients per minute |
|---|---|---|
| 1 | 1,000 | 60 |
| 2 | 5,000 | 200 |
| 3 and 4 | 20,000 | 500 |
After that only your plan's limits apply. The cap is counted as the sandbox's is: live recipients that aren't suppressed, through the API and SMTP together; a refused message uses up nothing. Over it the answer is 429 with probation_daily_limit_reached or probation_rate_limit_reached, and a Retry-After until the next UTC day or minute; over SMTP the reply is 451 4.7.1, so a mail server tries again later.
{ "error": "probation_daily_limit_reached" }
Your plan's limits apply too; the lower of the two counts and names the error: probation_… when the cap is as low as the plan's or lower, plan_… when the plan's is lower. Test keys are never limited by it.
Why: a new sender's mail is new to the mailbox providers too, and they trust an address that starts small and grows steadily. During these weeks Postilio may send your mail from addresses it keeps for new organizations, and it pauses a project sooner than usual when its bounce or complaint rate is high (see Paused projects). The Sandbox page in the portal shows the current cap and when the probation ends. If you expect more volume early on, contact support before you start: Postilio can end the probation sooner or extend it.
Plan limits
Your organization's plan limits how many messages it sends per UTC month, per UTC day and per minute, for all its projects together, through the API and SMTP. It counts live recipients that aren't suppressed when the message is accepted, which is also what is billed; test keys, repeats with the same Idempotency-Key and refused messages count nothing. The Usage & plan page in the portal shows where you stand.
The limits themselves depend on your organization's plan and can change; this page doesn't list them. The Usage & plan page in the portal shows the current values for your organization, or ask support. When a limit is reached:
- The month: a plan's monthly limit is either hard, and sending stops at the limit, or soft, and sending goes on up to a cap above it and stops there. The answer is
429 plan_monthly_limit_reachedwith aRetry-Afteruntil the 1st of the next month, 00:00 UTC. - The day and the minute always stop at the limit:
429 plan_daily_limit_reacheduntil 00:00 UTC, or429 plan_rate_limit_reacheduntil the next minute, with aRetry-After. - Over SMTP each of these is
451 4.7.1, also for the month: a mail server tries again later, and gets through once the limit is raised or the period ends. - Projects, domains, members, keys and webhook endpoints are checked when you add one:
409withproject_limit_reached,domain_limit_reached,member_limit_reached,api_key_limit_reachedorwebhook_endpoint_limit_reached. Nothing you have is ever removed or switched off when a plan has a lower limit; you can't add more until you are under it.
Mail that was accepted is always delivered: the limits apply when a message is accepted, never in the queue.
Postilio e-mails the Owners and Billing members when the month reaches 80 % and 100 %, and when sending pauses at the limit or the cap (the Admins too), each once a month. They also get a mail on the first day a daily or per-minute limit refuses mail. Every member sees a banner in the portal from 80 %. A plan that gets stricter starts on the 1st of a month, and a shorter message log only 30 days after the change, so there is time to export.
Project limits
An Owner or Admin can give a project a limit of its own, per day (UTC) and per minute, under Settings → Projects: a brake for when a key leaks or an app misbehaves, so one project can't use up what the organization may send. Over it, a live message answers 429 with project_daily_limit_reached or project_rate_limit_reached and a Retry-After until the next UTC day or minute; over SMTP the reply is 451 4.7.1, so a mail server tries again later. It counts live recipients that aren't suppressed, through the API and SMTP together; test keys and repeats with the same Idempotency-Key don't count, and a refused message uses up nothing. The organization's own limits (the plan's and the sandbox's or probation's) still apply on top, and the first that is reached names the error.
Platform limits
Apart from your plan and your projects' own limits, Postilio limits every API key to 3,000 live recipients a minute and every project to 3,000 a minute and 250,000 a UTC day: a safety brake for a key that leaked or an app stuck in a loop, far above what any plan allows. Over it, a live message answers 429 with platform_rate_limit_reached or platform_daily_limit_reached and a Retry-After until the next minute or UTC day; over SMTP the reply is 451 4.7.1. It counts as the project limits do: live recipients that aren't suppressed, API and SMTP together. Postilio looks into it well before a project gets there; contact support if you need more.
Test keys have limits of their own: a project's test keys together may send 3,000 recipients a minute and 100,000 a UTC day. They answer with the same two codes and a Retry-After, over SMTP with 451 4.7.1. Test and live are counted apart, so a test run never uses up what your live mail may send, nor the other way round. In this limit every recipient counts, suppressed ones too (such as suppressed@simulator.postilio.eu), because every test message is stored. A refused message and a repeat with the same Idempotency-Key don't count. The sandbox's, probation's, project's and plan's limits don't count test keys; the message size and SMTP limits hold for them as for live keys.
Paused and suspended projects
Sending can stop for one project while the rest of your organization goes on. Its keys then answer 403 project_suspended (over SMTP 554 5.7.1 project_suspended), and mail it already accepted waits in the queue: it goes out when the project is resumed within a day, and expires after that. A scheduled message has that day from its sendAt. The portal shows a banner on the project with what happened. There are three ways in:
- Pause sending: an Owner or Admin pauses the project in the portal (Settings → Projects), for example after a key leaked. They resume it there too.
- Paused automatically: when too many of a project's live messages bounce or get a complaint. Postilio weighs the last 24 hours every 15 minutes: at 10 % bounces (of at least 100 messages with an outcome) or 0.3 % complaints (of at least 300 delivered messages, from at least 10 different recipients: see A complaint after delivery) it pauses the project and mails its Owners and Admins. From 5 % bounces or 0.1 % complaints they get a warning first, at most once a day. Find and fix the cause (an old list, a form bots fill in, a leaked key), then an Owner or Admin resumes it under Settings → Projects with a short note, once every 30 days; after that Postilio reviews it. After a resume only newer messages count. In the probation after the sandbox the pause comes sooner: at 5 % bounces (of at least 50 messages with an outcome) or 0.3 % complaints of at least 100 delivered messages from at least 3 different recipients. From 0.1 % complaints Postilio also takes a look itself; that alone doesn't pause anything.
- Suspended by Postilio: after an abuse report, say. Only Postilio lifts it; the banner says what to do.
A suspension of the whole organization comes first: then every key answers 403 organization_suspended.
Message size
A message is at most 10 MB: from, replyTo, subject, tag, text and html in UTF-8 bytes, plus each attachment's decoded content (not its base64) with its fileName, contentType and contentId. Over it the answer is 413 message_too_large. Every recipient gets a copy, so the size times the recipients is at most 25 MB, for example a 1 MB message to 25 recipients; over it the answer is 413 message_too_large_for_recipients, and you send to fewer recipients at a time. The request body of POST /v1/emails is read up to 21 MB (base64 makes attachments a third larger); a larger body is not read and answers 413 payload_too_large, as does a body over 1 MB on any other endpoint. Each 413 has a message that names the limit:
{ "error": "message_too_large", "message": "A message may be at most 10485760 bytes; this one is 10485761." }
Over SMTP the same limits hold, see SMTP limits.
Limits
| What | Limit |
|---|---|
| Recipients per message | 50 |
| Message size | 10 MB, attachments included; size times recipients at most 25 MB, see Message size |
| Attachments | 20 |
| Subject | 998 characters |
| Tag | 64 characters: letters, digits, -, _ |
Idempotency-Key | 1 to 256 characters, remembered for 24 hours |
| Scheduled sending | sendAt a minute to 30 days ahead; 10,000 scheduled messages per project, together 256 MB |
| Test emails | 10 a day (UTC) per project, to confirmed addresses and members only, see Test emails |
| Sandbox (live mail) | 100 recipients a day, 10 a minute, per organization (by default) |
| Your plan | messages a month, a day and a minute, and how many projects, domains, members, keys and webhook endpoints, see Plan limits |
| Project limit (optional) | up to 1,000,000 recipients a day and 100,000 a minute, set per project |
| Platform limit | 3,000 recipients a minute per key, 3,000 a minute and 250,000 a day per project, see Platform limits |
| Test keys | 3,000 recipients a minute and 100,000 a day per project, apart from live mail, see Platform limits |
| Domain check on request | once a minute per domain |
| Webhook endpoints | 10 per project, and your plan's limit for the organization |
| API key restrictions | 20 domains, 20 networks |
List pages (limit) | 1 to 100, 50 by default |
| Request body | 21 MB for POST /v1/emails, 1 MB for every other endpoint |
| SMTP | 10 MB per message, 20 messages per connection, 600 messages per key per minute (see SMTP) |