Prompt
How do I get delivery and bounce webhooks from an email API?
Latest observation
Oct 8, 2026
OpenAI APIWeb search: off
To get delivery and bounce webhooks from an email API, you generally need to do three things:
1) Make sure the provider supports event webhooks
Most email APIs expose events like:
- delivered: the recipient’s mail server accepted the message
- bounce: the message was rejected or couldn’t be delivered
- sometimes also deferred, opened, clicked, complained, etc.
Look for documentation sections named:
- Webhooks
- Event callbacks
- Message events
- Inbound/Outbound notifications
2) Register a webhook endpoint in your app
Create a public HTTPS endpoint on your server that can receive POST requests, for example:
https://yourdomain.com/webhooks/email
Your endpoint should:
- accept JSON
- quickly return a
200 OKafter verifying and storing the event - validate the webhook signature if the provider signs requests
Example flow
- Email API sends an event to your webhook URL
- Your server verifies it’s legitimate
- You parse the event type:
deliveredbounce
- You update your database / user status / analytics
3) Configure the email provider to send events
In the provider dashboard or API, enable event notifications and select the event types you want.
Common configuration options:
- webhook URL
- secret/signing key
- event types to subscribe to
- retry policy
Typical webhook payload
A delivery event might look like:
{
"event": "delivered",
"message_id": "abc123",
"recipient": "user@example.com",
"timestamp": "2026-10-08T12:34:56Z"
}
A bounce event might look like:
{
"event": "bounce",
"message_id": "abc123",
"recipient": "user@example.com",
"bounce_type": "hard",
"reason": "Mailbox does not exist",
"timestamp": "2026-10-08T12:35:10Z"
}
Important implementation notes
- Use HTTPS
- Verify webhook signatures to prevent spoofing
- Handle retries/idempotency because providers may resend events
- Distinguish:
- hard bounce = permanent failure
- soft bounce = temporary issue
- “Delivered” usually means accepted by recipient mail server, not necessarily read
If you tell me which email API you’re using
I can give you the exact setup steps and sample code for:
- SendGrid
- Mailgun
- SES
- Postmark
- Brevo/Sendinblue
- SparkPost
- others
If you want, I can also show a complete webhook handler example in Node.js, Python, or PHP.