Bouncewise

Bouncewise › Guides › Postmark API error codes: every code and what to do

Postmark guide

Postmark API error codes: every code and what to do

Updated · 5 min read

Short answer

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 statusMeaningRetry?
200Success. In a batch send, still check each message's ErrorCode.—
401Missing or incorrect API token in the header (ErrorCode 10).No: fix the token or header
404The resource or ID doesn't exist.No
413Payload too large: 10 MB for the Email API, 50 MB total for the batch endpoint.No: shrink attachments
415The request is missing headers the endpoint expects; check Accept and Content-Type.No
422Malformed JSON or invalid fields. The body has an ErrorCode and Message.No: fix the request
429Rate limit exceeded.Yes, after backing off
500Error on Postmark's side; the message is usually lost (ErrorCode 101).Yes, with care to avoid duplicates
503Planned 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).

ErrorCodeHTTPPostmark's descriptionWhat to do
10401Request 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.
11422Multiple errors occurred. Inspect the Errors property.Read Errors in the body.
12404Bulk send not found.Check the bulk request ID.
13422Invalid pagination key.Restart paging.
14422This endpoint requires approval. Contact support to use the Bulk API.Ask Postmark for Bulk API access.
100503The Postmark API is offline for maintenance.Queue and retry later.
101500An error that shouldn't have occurred; the response includes an Error ID.Retry; send the Error ID to support if it repeats.
300422Send validation: zero recipients, invalid address, missing TextBody/HtmlBody, recipient, metadata, attachment or header limits.Read Message; it names the problem.
402422Invalid JSON.Check quoting and escaping in the body.
403422Invalid request field(s).The message names the field, e.g. 'From'.
406422Inactive recipient.Address is suppressed; see error 406.
410422You may only send up to 500 messages in a single batched request.Split the batch.
411422Attachment file type not allowed.Remove that attachment or link to the file instead.
412422While your account is pending approval, all recipients must share the From address's domain.Get the account approved.
413422This account is not approved to send email.Contact Postmark.
422422Invalid Server or Account.Check the token belongs to an active server.
1235422The stream provided does not exist on this server.Fix MessageStream; see message streams.
1236422Sending is not supported for this stream type.Don't send through an inbound stream.
1480422You 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

ErrorCodeAreaPostmark's description
700MessagesPaging or parameter validation for messages, opens, clicks and activity.
701MessagesThis message was not found, or cannot be bypassed or retried.
702InboundCould not bypass this blocked message. Please contact support.
703InboundCould not retry this failed message. Please contact support.
1000BouncesBounces query validation (count up to 500, count plus offset, illegal bounce type).
1001BouncesThe bounce was not found, or its dump is no longer available.
1002BouncesA bounceID parameter is required (HTTP 400).
1003BouncesDue to the type of bounce, this address cannot be reactivated.
1400–1405SuppressionsInvalid or missing count, offset, SuppressionReason or Origin parameters.
1406SuppressionsYou do not have the required authority to change this suppression (per address, inside an HTTP 200 body).
1407SuppressionsSomething went wrong when processing the request.
1408SuppressionsAn invalid email address was provided.
1409–1411SuppressionsMissing request body, too many suppressions in one request, or missing emailAddress.
800–812Inbound rulesTrigger paging and validation (800), no data (809), rule already exists (810), can't remove (811), not found (812).
900StatsA parameter should be a date/time value.
1500–1502StatsFromDate older than one year, invalid count, or FromDate not before ToDate.
1300–1302Data removalInvalid 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.

ErrorCodeAreaPostmark's description
600–615ServersPaging (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–523Signatures and domainsNot 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).
709DomainsDKIM verification failed due to invalid configuration. Contact support (HTTP 500).
1220–1241Message streamsNo 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–1364WebhooksArchived or inbound stream (1350, 1351), webhook not found (1352), invalid Url (1354), webhook limit for the stream (1359), verification failed (1364).
1450–1460SMTP tokensMissing server, token not found, invalid stream, inbound stream (1457), token limit (1458), SMTP disabled for the server (1460).
601, 1100–1131TemplatesPush 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_TEST as 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.

Sources