An email webhook is an HTTP request that your email provider sends to your application when something happens to a message. Instead of your code asking “was it delivered yet?”, the provider calls a URL you choose with a JSON payload saying a message was delivered, bounced, marked as spam, opened, clicked, or that a new email was received.
How email webhooks work
- You register an endpoint, such as
https://app.acme.com/hooks/email, and choose which events to receive. - You send email through an email API or SMTP relay and store the returned message id.
- Something happens. The receiving server accepts the message, or bounces it, or the user complains.
- The provider POSTs an event to your endpoint, signed with a shared secret.
- Your app verifies and responds with a 2xx status, then updates its own records.
If your endpoint fails, the provider retries later.
Example payload and headers
An illustrative bounce event. Field names vary by provider, but the shape is similar:
POST /hooks/email HTTP/1.1
Content-Type: application/json
webhook-id: msg_2KWPBgLlAfxdpx2AI54pPJ85f4W
webhook-timestamp: 1763284364
webhook-signature: v1,K5oZfzN95Z9UVu1EsfQmfVNQhnkZ2pj9o9NDN/H/pI4=
{
"type": "email.bounced",
"created_at": "2026-11-16T09:12:44Z",
"data": {
"email_id": "9f2c1e7a-...",
"to": ["sam@exmaple.com"],
"bounce": { "type": "hard", "code": "5.1.1" }
}
}
The headers follow the Standard Webhooks specification: the signature is an HMAC-SHA256 over webhook-id.webhook-timestamp.body, and webhook-id stays the same across retries, so you can use it to ignore duplicates.
Common events
| Event | What it tells you |
|---|---|
| delivered | The receiving server accepted the message |
| delivery_delayed | Temporary failure, still retrying |
| bounced | Permanent failure, stop mailing the address |
| complained | The recipient marked it as spam (feedback loop) |
| opened, clicked | Engagement, approximate |
| suppressed | Not sent, address on the suppression list |
| received | A new inbound email arrived |
Why it matters for app email
A 202 from the API only means “queued”. Webhooks tell you what actually happened, so you can show a delivery status in your support tools, prompt a user to fix a mistyped address after a bounce, stop emailing someone who complained, or turn an inbound reply into a ticket comment.
Common mistakes
- Not verifying signatures. Anyone who finds the URL can post fake events.
- Parsing the body before verifying, or re-serializing it, which changes the bytes and breaks the HMAC.
- Doing slow work in the handler, so the provider times out and retries.
- Not deduplicating. Retries mean you can see the same event twice.
- Assuming order. A
deliveredcan arrive after anopened.
How Mailcandor handles it
Mailcandor webhooks are signed with Standard Webhooks (also svix-* headers), retried up to 8 times over about 28 hours, and replayable.