Mailgun can make an HTTP POST to a callback URL when events occur with your messages.
Webhooks are at the domain level so you can provide a unique URL for each domain. We recommend using bin.mailgun.net for creating temporary URLs to test and debug your webhooks.
For Webhook POSTs, Mailgun listens for the following codes from your server and reacts accordingly:
- If Mailgun receives a 200 (Success) code it will determine the webhook POST is successful and not retry.
- If Mailgun receives a 406 (Not Acceptable) code, Mailgun will determine the POST is rejected and not retry.
- For any other code, Mailgun will retry POSTing according to the following schedule (other than the delivery notification): 10 minutes, 10 minutes, 15 minutes, 30 minutes, 1 hour, 2 hour and 4 hours.
You can find our webhooks manual here.