How do I enable delivery webhooks?
Instead of having to poll the API or use our UI to check on the delivery status and get delivery details for an email you sent, you can instead receive updates pushed to you in real-time (as JSON) when an email is delivered. By setting up delivery webhooks for your Server(s) in Postmark, you can confirm the delivery details for emails you send without having to log into Postmark or poll our Messages API. You can set your delivery webhook URL(s) using both our API and UI.
Set delivery webhook URL using Postmark UI
Log into Postmark and open the Server you want to configure the delivery webhooks URL for. Go to the server settings page and click the“Add webhook” button. Add your webhook URL in the“Webhook URL” field and then click the“delivery” checkbox. Before saving your changes, be sure to test your webhook to confirm that it works.
Set delivery webhook URL when creating a new Server using the API
- Accept: application/json
- Content-Type: application/json
- X-Postmark-Account-Token: YourAccountAPIToken
{ "Name":"Delivery Webhook Test Server", "Color":"blue", "SmtpApiActivated": true, "RawEmailEnabled": false, "InboundHookUrl": null, "BounceHookUrl": null, "OpenHookUrl": null, "PostFirstOpenOnly": false, "TrackOpens": false, "InboundDomain": null, "InboundSpamThreshold": 5, "DeliveryHookUrl":"http://yourdomain.com/webhooks/delivery" }
Set delivery webhook URL for an existing Server using the API
- Accept: application/json
- Content-Type: application/json
- X-Postmark-Server-Token: YourServerAPIToken
{ "DeliveryHookUrl":"http://yourdomain.com/webhooks/delivery" }
Example delivery webhook event
{ "MessageID":"a94dfe84-8ab9-43cf-8a1c-ac234c296e25", "Recipient":"recipeint@example.com", "Tag":"Your Tag", "DeliveredAt":"2016-12-01T15:41:45-05:00", "Details":"smtp;250 2.0.0 OK 1480624905 l186si10190883ite.73- gsmtp" }