Postmark API error codes: every code and what to do
When Postmark rejects an API request it returns JSON with a numeric ErrorCode and a human-readable Message, and repeats the code in the X-PM-ApiErrorCode header. Most are HTTP 422 and mean the request needs fixing, so don't retry them unchanged; 401 (ErrorCode 10) is a token problem, 429 means slow down, and 500/503 are on Postmark's side. The codes you'll see most when sending are 300 (validation), 406 (inactive recipient), 403 (invalid field) and 10 (bad token).
HTTP status codes
| HTTP status | Meaning | Retry? |
|---|---|---|
| 200 | Success. In a batch send, still check each message's ErrorCode. | — |
| 401 | Missing or incorrect API token in the header (ErrorCode 10). | No: fix the token or header |
| 404 | The resource or ID doesn't exist. | No |
| 413 | Payload too large: 10 MB for the Email API, 50 MB total for the batch endpoint. | No: shrink attachments |
| 415 | The request is missing headers the endpoint expects; check Accept and Content-Type. | No |
| 422 | Malformed JSON or invalid fields. The body has an ErrorCode and Message. | No: fix the request |
| 429 | Rate limit exceeded. | Yes, after backing off |
| 500 | Error on Postmark's side; the message is usually lost (ErrorCode 101). | Yes, with care to avoid duplicates |
| 503 | Planned maintenance (ErrorCode 100). | Yes, later |
Error codes when sending email
These come back from POST /email, POST /email/batch and the template send endpoints. In a batch, the request returns HTTP 200 and each message in the response has its own ErrorCode (0 with "Message": "OK" for success).
| ErrorCode | HTTP | Postmark's description | What to do |
|---|---|---|---|
| 10 | 401 | Request does not contain a valid Server or Account token, or the wrong token type was used for the endpoint. | Use X-Postmark-Server-Token for sending; see server vs account token. |
| 11 | 422 | Multiple errors occurred. Inspect the Errors property. | Read Errors in the body. |
| 12 | 404 | Bulk send not found. | Check the bulk request ID. |
| 13 | 422 | Invalid pagination key. | Restart paging. |
| 14 | 422 | This endpoint requires approval. Contact support to use the Bulk API. | Ask Postmark for Bulk API access. |
| 100 | 503 | The Postmark API is offline for maintenance. | Queue and retry later. |
| 101 | 500 | An error that shouldn't have occurred; the response includes an Error ID. | Retry; send the Error ID to support if it repeats. |
| 300 | 422 | Send validation: zero recipients, invalid address, missing TextBody/HtmlBody, recipient, metadata, attachment or header limits. | Read Message; it names the problem. |
| 402 | 422 | Invalid JSON. | Check quoting and escaping in the body. |
| 403 | 422 | Invalid request field(s). | The message names the field, e.g. 'From'. |
| 406 | 422 | Inactive recipient. | Address is suppressed; see error 406. |
| 410 | 422 | You may only send up to 500 messages in a single batched request. | Split the batch. |
| 411 | 422 | Attachment file type not allowed. | Remove that attachment or link to the file instead. |
| 412 | 422 | While your account is pending approval, all recipients must share the From address's domain. | Get the account approved. |
| 413 | 422 | This account is not approved to send email. | Contact Postmark. |
| 422 | 422 | Invalid Server or Account. | Check the token belongs to an active server. |
| 1235 | 422 | The stream provided does not exist on this server. | Fix MessageStream; see message streams. |
| 1236 | 422 | Sending is not supported for this stream type. | Don't send through an inbound stream. |
| 1480 | 422 | You are not authorized to send emails from your current IP address. | The sending IP isn't on your Postmark IP allowlist. |
Bounces, messages, inbound, suppressions and stats
| ErrorCode | Area | Postmark's description |
|---|---|---|
| 700 | Messages | Paging or parameter validation for messages, opens, clicks and activity. |
| 701 | Messages | This message was not found, or cannot be bypassed or retried. |
| 702 | Inbound | Could not bypass this blocked message. Please contact support. |
| 703 | Inbound | Could not retry this failed message. Please contact support. |
| 1000 | Bounces | Bounces query validation (count up to 500, count plus offset, illegal bounce type). |
| 1001 | Bounces | The bounce was not found, or its dump is no longer available. |
| 1002 | Bounces | A bounceID parameter is required (HTTP 400). |
| 1003 | Bounces | Due to the type of bounce, this address cannot be reactivated. |
| 1400–1405 | Suppressions | Invalid or missing count, offset, SuppressionReason or Origin parameters. |
| 1406 | Suppressions | You do not have the required authority to change this suppression (per address, inside an HTTP 200 body). |
| 1407 | Suppressions | Something went wrong when processing the request. |
| 1408 | Suppressions | An invalid email address was provided. |
| 1409–1411 | Suppressions | Missing request body, too many suppressions in one request, or missing emailAddress. |
| 800–812 | Inbound rules | Trigger paging and validation (800), no data (809), rule already exists (810), can't remove (811), not found (812). |
| 900 | Stats | A parameter should be a date/time value. |
| 1500–1502 | Stats | FromDate older than one year, invalid count, or FromDate not before ToDate. |
| 1300–1302 | Data removal | Invalid request, missing or wrong request ID, or no permission to use the data removal API. |
Account management: servers, domains, streams, webhooks, templates
Grouped by range; codes within each group are from Postmark's API reference.
| ErrorCode | Area | Postmark's description |
|---|---|---|
| 600–615 | Servers | Paging (600), inbound domain in use (602), name exists (603), no permission to delete servers by API (604), invalid hook URL (606), invalid name (608), MX record not found (610), InboundSpamThreshold outside 0–30 (611), entitlement limit reached (614), action not supported (615). |
| 500–523 | Signatures and domains | Not found (501, 510), public domains not allowed (503), already exists (504, 512), not yours (507, 513), invalid fields or format (511, 516, 522), CNAME not pointing to the expected value (523). |
| 709 | Domains | DKIM verification failed due to invalid configuration. Contact support (HTTP 500). |
| 1220–1241 | Message streams | No access to the API (1220), invalid type (1221), too many streams (1225), stream not found (1226), invalid ID (1227), one inbound stream only (1228), can't archive default streams (1229), ID exists (1230), ID can't start with pm- (1233), ID reserved (1237). |
| 1350–1364 | Webhooks | Archived or inbound stream (1350, 1351), webhook not found (1352), invalid Url (1354), webhook limit for the stream (1359), verification failed (1364). |
| 1450–1460 | SMTP tokens | Missing server, token not found, invalid stream, inbound stream (1457), token limit (1458), SMTP disabled for the server (1460). |
| 601, 1100–1131 | Templates | Push server not found (601), template or alias not found (1101), template limit (1105), missing or too-long fields (1120, 1121), invalid type or alias (1122), layout in use (1130). |
How to read and handle an error
Use -i to see the status and header together. This send has no TextBody or HtmlBody, so it fails validation:
curl -i "https://api.postmarkapp.com/email" \
-X POST \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "X-Postmark-Server-Token: $POSTMARK_SERVER_TOKEN" \
-d '{"From": "[email protected]", "To": "[email protected]", "Subject": "Hi"}'
HTTP/1.1 422 Unprocessable Entity
X-PM-ApiErrorCode: 300
...
{"ErrorCode": 300, "Message": "..."}- Branch on
ErrorCode, not the text. One code can cover several messages (300 alone covers dozens of validation problems), and the wording can change. - Don't retry 4xx unchanged. A 422 fails the same way every time. Log the
Message, which usually names the field or address. - Back off on 429 and retry later.
- Retry 500 and 503 carefully. A 500 usually means the message was lost, but make your sends idempotent on your side so a retry can't send twice.
- Handle 406 per address: mark that recipient as undeliverable instead of retrying the whole send.
- Test without sending by passing
POSTMARK_API_TESTas the server token; Postmark validates the request without delivering it.
Questions
What does Postmark ErrorCode 0 mean?
Success. You see it in batch responses, where every message has an ErrorCode and 0 comes with the message "OK".
What is the difference between HTTP 401 and ErrorCode 10?
They go together: Postmark answers 401 with ErrorCode 10 when the token is missing or wrong, or when you used a server token where an account token is needed (or the other way round).
Why do I get ErrorCode 300?
It is the general send validation error: no recipients, an invalid address, no TextBody or HtmlBody, or a limit on recipients, metadata, attachments or headers. The Message says which.
Should I retry a Postmark 422?
No. A 422 means the request itself is wrong; fix what the Message describes first. Retry only 429, 500 and 503.
Related
- Postmark error 406 inactive recipient: cause and fixPostmark ErrorCode 406 means the address is suppressed after a hard bounce, spam complaint or manual suppression. Find which, and when to reactivate it.
- Postmark Server API token vs Account API tokenThe Server token (X-Postmark-Server-Token) sends mail and reads one server. The Account token (X-Postmark-Account-Token) manages servers and domains.
- Postmark message streams: transactional, broadcast, inboundEach Postmark server has an outbound transactional stream and an inbound stream; you add broadcast streams. Pick one per email with MessageStream.
- Postmark inbound failed: why, and how to retry messagesFailed means your inbound webhook didn't return 200 after 10 retries over about 10.5 hours. Fix the endpoint, then PUT /messages/inbound/{id}/retry.
- SMTP bounce codes: full list and what to do for eachEvery SMTP reply code (421 to 555) and enhanced status code (X.1.1 to X.7.7) from RFC 5321 and RFC 3463, with what each means and what to do next.