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 or client_ip_not_allowed, 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
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": "dns_unavailable"}only from a domain check: DNS gave no answer

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
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
409webhook_endpoint_limit_reachedthe project has 10 webhook endpoints
409delivery_still_pendingthe delivery is still being retried
409endpoint_pausedresume the webhook endpoint first
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
422reason_requiredremoving a complaint from the suppression list needs a reason
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
429too_many_checksa domain can be checked once a minute
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:

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.

Limits

WhatLimit
Recipients per message50
Attachments20, at most 10 MB together; size times recipients at most 25 MB
Subject998 characters
Tag64 characters: letters, digits, -, _
Idempotency-Key1 to 256 characters, remembered for 24 hours
Sandbox (live mail)100 recipients a day, 10 a minute, per organization (by default)
Domain check on requestonce a minute per domain
Webhook endpoints10 per project
API key restrictions20 domains, 20 networks
List pages (limit)1 to 100, 50 by default
SMTP10 MB per message, 20 messages per connection, 600 messages per key per minute (see SMTP)