Postmark webhooks: events, retries, security and IPs
Postmark retries an outbound webhook (Delivery, Bounce, SpamComplaint, Open, Click, SubscriptionChange) only when your endpoint returns 5xx, 408 or 429 or the connection fails, at 1, 5, 10, 10, 10 and 15 minutes; any other 4xx drops the event. Inbound webhooks are separate: 10 retries from 1 minute up to 6 hours, stopped by a 403. Postmark doesn't sign webhooks, so protect the URL with basic auth, custom headers and its webhook IP addresses.
Webhook event types
Outbound webhooks belong to a message stream; you choose which triggers each one sends. The JSON's RecordType tells you which event arrived:
| RecordType | Sent when | Options |
|---|---|---|
Delivery | The receiving server accepted the message | |
Bounce | Postmark processed a bounce (see bounce types) | IncludeContent adds the full bounce |
SpamComplaint | A recipient marked a message as spam | IncludeContent |
Open | A tracked message was opened | PostFirstOpenOnly |
Click | A tracked link was clicked | |
SubscriptionChange | An address was added to or removed from the stream's suppression list | |
| Inbound (no RecordType trigger) | Postmark parsed an email sent to your inbound address | One URL per inbound stream, set in its Settings |
Spam complaints, subscription changes and manual deactivations don't fire the Bounce webhook. If you want a single feed of addresses becoming inactive or active again, use SubscriptionChange: it carries SuppressSending, SuppressionReason and Origin (Recipient, Customer or Admin).
Retry schedules: outbound vs inbound
| Outbound webhooks | Inbound webhook | |
|---|---|---|
| Retried on | 5xx, 408, 429, timeouts and connection failures | Any response other than 200 |
| Not retried on | Other 4xx (400, 401, 403, 404, 405, 410, 422…) | 403 |
| Schedule | 1, 5, 10, 10, 10, 15 minutes | 1, 5, 10, 10, 10, 15, 30 minutes, 1, 2, 6 hours (10 retries) |
| When retries run out | That event is dropped | The message shows as Inbound Error; you can retry it |
Redirects are followed, up to 10 hops. Each outbound request carries X-PM-Retries-Remaining and an X-PM-Webhook-Trace-Id that stays the same across retries of one event.
The mistake to avoid: returning 401 or 404 while your app is mid-deploy loses outbound events for good. Return 503 if you want Postmark to try again.
Separately, Postmark watches each event type. If every delivery of one type fails, it emails a warning; if nothing gets through for 48 hours it disables that event type until you verify the webhook again, and events from that gap are never sent. Inbound failures are handled differently: retrying failed inbound messages.

Securing a Postmark webhook
Postmark's documentation says it does not currently support HMAC webhook signature verification, so there is no signing secret to check. Use these instead:
- Basic auth in the URL:
https://user:[email protected]/webhooks/postmark, or theHttpAuthobject in the Webhooks API. Always over HTTPS. - A custom header through
HttpHeaders, for example a long random value your endpoint compares in constant time. - An IP allowlist. Postmark lists these addresses for every webhook it sends (inbound, bounce, open and so on):
3.134.147.250,50.31.156.6,50.31.156.77,18.217.206.57. The origin IP can change between attempts, and the list can change, so check Postmark's IPs for Firewalls page before relying on it. - Validate the payload: reject bodies without the
RecordTypeandMessageIDyou expect.
Create and verify a webhook with the API
curl "https://api.postmarkapp.com/webhooks" \
-X POST \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "X-Postmark-Server-Token: $POSTMARK_SERVER_TOKEN" \
-d '{
"Url": "https://example.com/webhooks/postmark",
"MessageStream": "outbound",
"HttpAuth": {"Username": "postmark", "Password": "xxxx-xxxx"},
"HttpHeaders": [{"Name": "X-Webhook-Secret", "Value": "xxxx-xxxx"}],
"Triggers": {
"Open": {"Enabled": false},
"Click": {"Enabled": false},
"Delivery": {"Enabled": true},
"Bounce": {"Enabled": true, "IncludeContent": false},
"SpamComplaint": {"Enabled": true, "IncludeContent": false},
"SubscriptionChange": {"Enabled": true}
}
}'On create and edit, Postmark sends a test event for every enabled trigger and expects 200 from each. If one fails, the call returns HTTP 422 with ErrorCode 1364, a Results array showing each trigger's StatusCode, and a summary such as 4/5 triggers verified successfully; nothing is saved. To register an endpoint that isn't live yet, send "Verify": false, then call POST /webhooks/{id}/verify when it is ready. An unverified webhook receives no events. GET /webhooks/{id}/statistics shows recent successes and failures per event type.
A handler that survives retries
- Check the basic auth or header, then store the raw body.
- Return
200straight away and process from a queue. A slow response counts as a failure and causes a retry. - Make processing idempotent: the same event can arrive twice. Key on
X-PM-Webhook-Trace-Id, or onRecordTypeplusMessageIDplus the event's timestamp, since one message can produce several events. - On a temporary failure of your own, return
500or503, never a 4xx. - Branch on
RecordType, and acknowledge types you don't handle with200.
Timestamps in webhook payloads are ISO 8601, except an inbound message's Date, which keeps the sending server's format.
Questions
Does Postmark sign its webhooks?
No. Postmark doesn't support HMAC webhook signatures; it recommends basic HTTP authentication in the webhook URL combined with allowlisting its webhook IP addresses.
What IP addresses do Postmark webhooks come from?
Postmark's IPs for Firewalls page lists 3.134.147.250, 50.31.156.6, 50.31.156.77 and 18.217.206.57 for all webhooks. Check that page for changes before you lock a firewall down.
Does Postmark retry a webhook that returns 404?
Not for outbound events: any 4xx other than 408 and 429 is treated as permanent and the event is dropped. The inbound webhook retries everything except 403.
Can I get events that were missed while a webhook was disabled?
Not through the webhook; Postmark doesn't send them later. Fetch them from the API instead, for example the Bounce API or message details, for the period it was down.
Related
- 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.
- Postmark hard bounce meaning, and every bounce typePostmark HardBounce (TypeCode 1): the mailbox doesn't exist or refused mail for good, so the address is deactivated. All 22 bounce types explained.
- Postmark spam complaints: what they mean, what to doA Postmark spam complaint (SpamComplaint, 100001) deactivates the address at once, and only Postmark support can reactivate it. How to cut the rate.
- 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 API error codes: every code and what to doPostmark returns an ErrorCode with a Message, mostly with HTTP 422. Table of codes from 10 to 1502 with meanings, HTTP status and whether to retry.
- Bouncewise alerts: bounce spikes, spam, inboundTurn on Bouncewise alerts for bounce spikes, spam complaints, failed inbound mail and a daily summary. They come from background checks, not instant push.