Postilio docs

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

StatusBodyWhen
200, 201, 202, 204the result (none for 204)success; 202 means accepted, the work happens afterwards
400validation problema 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
404noneno 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)
500problem with a traceIdan 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

StatuserrorMeaning
401invalid_api_keythe key is missing, unknown or revoked
403insufficient_scopethe key lacks the scope of this call
403client_ip_not_allowedthe key may not be used from this address
403organization_suspendedPostilio suspended your organization: no project sends until it is resumed
403project_suspendedthe key's project is paused or suspended; your other projects keep sending
403inbound_not_in_planinbound mail is not available to your organization, see Inbound mail
409idempotency_key_reused_with_different_requestthe Idempotency-Key was used for another request in the last 24 hours
409domain_existsthe project has this domain already
409address_already_suppressedthe address is on the suppression list already
413message_too_largethe message is over 10 MB, see Message size
413message_too_large_for_recipientsthe message's size times its recipients is over 25 MB; send to fewer recipients at a time
413payload_too_largethe request body is over what the endpoint reads (21 MB for sending, 1 MB elsewhere); it is not read further
409domain_limit_reachedyour plan allows no more domains, see Plan limits
409webhook_endpoint_limit_reachedthe project has 10 webhook endpoints, or your plan allows no more
409delivery_still_pendingthe delivery is still being retried
409email_not_scheduledthe message is not waiting for its sendAt (any more): it was not scheduled, was canceled, or is on its way
409scheduled_limit_reachedthe project holds 10,000 scheduled messages, see Scheduled sending
409scheduled_size_limit_reachedthe project's scheduled messages would hold more than 256 MB together
409endpoint_pausedresume the webhook endpoint first
409inbound_domain_exists, inbound_domain_taken, inbound_domain_has_mx, inbound_domain_limit_reachedadding a receiving domain, see Inbound mail
409inbound_route_exists, inbound_route_limit_reachedadding an inbound route, see Routes
409inbound_route_has_no_endpoint, inbound_still_processingredelivering a received message, see Redeliver
410inbound_content_deletedthe received message's content went, see Content is kept briefly
422unverified_sender_domainthe sender's domain is not verified, or has been failing for over 72 hours
422sender_domain_not_allowed_for_keythe key is restricted to other sending domains
422sandbox_recipient_not_allowedin the sandbox: a recipient outside your team and verified domains
422send_at_too_soonsendAt is less than a minute ahead, or in the past
422send_at_too_farsendAt is more than 30 days ahead
422attachment_type_not_allowedan attachment is an executable file, such as .exe or .js; the message names it, see Attachments
422cc_bcc_require_single_tocc or bcc with more than one address in to, see Cc and Bcc
422inbound_domain_reserved, inbound_domain_not_found, webhook_endpoint_not_found, webhook_endpoint_mode_mismatchsee Inbound mail
422reason_requiredremoving a complaint from the suppression list needs a reason
422test_recipient_not_confirmeda test email to an address that is neither confirmed for test emails nor a member's, see Test emails
429sandbox_daily_limit_reachedin the sandbox: the day's recipients are used up
429sandbox_rate_limit_reachedin the sandbox: this minute's recipients are used up
429probation_daily_limit_reachedin the first weeks after the sandbox: the day's recipients are used up, see Probation
429probation_rate_limit_reachedin the first weeks after the sandbox: this minute's recipients are used up
429project_daily_limit_reachedthe project's own limit: the day's recipients are used up
429project_rate_limit_reachedthe project's own limit: this minute's recipients are used up
429plan_monthly_limit_reachedyour plan's month is used up, see Plan limits
429plan_daily_limit_reachedyour plan's day is used up
429plan_rate_limit_reachedyour plan's minute is used up
429platform_rate_limit_reachedthe 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
429platform_daily_limit_reachedthe platform's safety limit per project, or on its test keys: the day's recipients are used up
429test_mail_daily_limit_reachedthe project's test emails for the day (UTC) are used up
429too_many_checksa domain can be checked once a minute
503service_degradedPostilio takes no new messages for now, to protect its storage; nothing was stored, so send it again after Retry-After
503dns_unavailablethe 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:

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:

WeekRecipients per day (UTC)Recipients per minute
11,00060
25,000200
3 and 420,000500

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:

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:

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

WhatLimit
Recipients per message50
Message size10 MB, attachments included; size times recipients at most 25 MB, see Message size
Attachments20
Subject998 characters
Tag64 characters: letters, digits, -, _
Idempotency-Key1 to 256 characters, remembered for 24 hours
Scheduled sendingsendAt a minute to 30 days ahead; 10,000 scheduled messages per project, together 256 MB
Test emails10 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 planmessages 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 limit3,000 recipients a minute per key, 3,000 a minute and 250,000 a day per project, see Platform limits
Test keys3,000 recipients a minute and 100,000 a day per project, apart from live mail, see Platform limits
Domain check on requestonce a minute per domain
Webhook endpoints10 per project, and your plan's limit for the organization
API key restrictions20 domains, 20 networks
List pages (limit)1 to 100, 50 by default
Request body21 MB for POST /v1/emails, 1 MB for every other endpoint
SMTP10 MB per message, 20 messages per connection, 600 messages per key per minute (see SMTP)