Prompt
How do I add webhooks for delivered, bounced, and complained events?
Latest observation
Nov 16, 2026
OpenAI APIWeb search: off
To add webhooks for delivered, bounced, and complained events, you generally need to:
-
Create a webhook endpoint on your server
- Expose a public HTTPS URL that can accept
POSTrequests. - Make sure it returns a
2xxresponse quickly.
- Expose a public HTTPS URL that can accept
-
Register that endpoint in your email provider / messaging service
- In your provider’s dashboard or API, add the webhook URL.
- Select the event types you want:
deliveredbouncedcomplained
-
Verify incoming webhook requests
- Check the provider’s signature or secret token to confirm the event really came from them.
-
Handle the event payload
- Store or process the event data, such as:
- message ID
- recipient
- timestamp
- bounce reason
- complaint details
- Store or process the event data, such as:
Example webhook handler
If you’re using Node.js with Express:
app.post('/webhooks/email', express.json(), (req, res) => {
const event = req.body;
switch (event.eventType) {
case 'delivered':
// mark message as delivered
break;
case 'bounced':
// mark message as bounced
break;
case 'complained':
// mark message as complained
break;
}
res.sendStatus(200);
});
If you’re using AWS SES
If this is for Amazon SES, you typically:
- Create a configuration set
- Add a event destination
- Send events to SNS, Kinesis Data Firehose, or CloudWatch
- Subscribe your webhook endpoint to SNS, and then map SES events like:
DeliveryBounceComplaint
If you want, I can give you:
- exact steps for Amazon SES
- a Node/Python example
- or instructions for a specific provider like SendGrid, Mailgun, Postmark, or SES.