Webhooks for Cloudflare Email Sending
Cloudflare Email Sending records what happens to each email in your Cloudflare account. Sepiasend posts each event to your server as a signed webhook, in the same format Resend uses, so resend.webhooks.verify() works as it is. Delivered, bounced and suppressed are read from the sending log. A spam complaint is pushed by Cloudflare when the recipient marks the email as spam. How the six events arrive.
- Events
- email.sent, email.delivered, email.bounced, email.complained, email.suppressed, email.failed
- Sent and failed
- at once
- Spam complaint
- when Cloudflare reports it
- Delivered, bounced, suppressed
- 5 to 10 minutes, each once
- Signature
- svix headers, as Resend
- Plans
- every plan, Free included
Checked against Sepiasend's code on 26 November 2026. Sepiasend is not part of Resend or Cloudflare.
What each event means
| event | when | where it comes from |
|---|---|---|
email.sent | Cloudflare accepted the email | the send call |
email.failed | Cloudflare refused the email | the send call |
email.delivered | the recipient's server took it | Cloudflare's sending log |
email.bounced | the recipient's server rejected it; data.bounce.message says why | Cloudflare's sending log |
email.complained | the recipient marked it as spam. subject may be empty, because Cloudflare's complaint event does not include one | a queue Cloudflare pushes into your account |
email.suppressed | Cloudflare did not send it (its log says rejected), for example because the address is on the account's suppression list | Cloudflare's sending log |
For sent, delivered, bounced, suppressed and failed, data.email_id is the id the send call returned. A complaint uses that same id when Sepiasend sent the email; if Cloudflare's event does not name it, the complaint still arrives. Events from the log start from the moment you add the webhook; older history is not replayed.
Add a webhook
In the dashboard under webhooks, through the API, or by asking your agent through the MCP server. The endpoint must use https. You get the signing secret once, when you add it.
# any Sepiasend key with full access curl -X POST https://api.sepiasend.com/webhooks \ -H "Authorization: Bearer $SEPIASEND_KEY" \ -H "Content-Type: application/json" \ -d '{"endpoint": "https://app.example.com/webhooks/email", "events": ["email.delivered", "email.bounced"]}' # 201 { "object": "webhook", "id": "...", "signing_secret": "whsec_..." }
Leave out events to get all six. The first time the list includes email.complained, sign in to Cloudflare again and approve Queues and Workers Scripts. Until then the webhook is saved and the other events still arrive.
Verify it with Resend's SDK
The body is Resend's: type, created_at and data with email_id, from, to and subject. The headers are svix-id, svix-timestamp and svix-signature, an HMAC-SHA256 over the id, the timestamp and the raw body.
import { Resend } from 'resend';
const resend = new Resend(process.env.RESEND_API_KEY);
// rawBody: the request body as a string, before JSON parsing
const event = resend.webhooks.verify({
payload: rawBody,
headers: {
id: req.headers['svix-id'],
timestamp: req.headers['svix-timestamp'],
signature: req.headers['svix-signature'],
},
webhookSecret: process.env.SEPIASEND_WEBHOOK_SECRET,
});
if (event.type === 'email.bounced') console.log(event.data.email_id, event.data.bounce.message);
If your server does not answer with a 2xx, the event is tried again 8 times, waiting from one minute up to an hour between tries. The svix-id stays the same on every try, so you can drop repeats.
What Sepiasend keeps
No copy of your emails. Sepiasend hands each email to Cloudflare and reads the log back from your own Cloudflare account. An event waits in a queue only until your server accepts it. For a spam complaint it also keeps Cloudflare's event id, so the same complaint is not posted twice, and a queue and Worker named sepiasend-complaints exist in your account only while a webhook includes that event. See the privacy policy.
- Already on Resend? Your webhook handler stays as it is: point the SDK at api.sepiasend.com and add the webhook again. See how to switch.
- You need a Cloudflare account with the domain's DNS on Cloudflare and the Workers Paid plan. See what you need.
- Not tracked: opens and clicks.
Questions
Does Cloudflare Email Sending have webhooks?
Cloudflare records what happens to each email in the sending log of your Cloudflare account, which you can read in its dashboard or through its GraphQL analytics API for 31 days. Sepiasend reads that log every five minutes and posts each delivered, bounced and suppressed event to your HTTPS endpoint. A spam complaint is not in that log. Cloudflare pushes it, and Sepiasend posts email.complained when it arrives. Every event is signed in Resend's format.
How quickly do delivery and bounce webhooks arrive?
email.sent and email.failed arrive as soon as Cloudflare answers the send call. email.complained arrives when Cloudflare reports that the recipient marked the email as spam. email.delivered, email.bounced and email.suppressed are read from Cloudflare's log and arrive 5 to 10 minutes after the event, each once. The first time you include email.complained, sign in to Cloudflare again and approve Queues and Workers Scripts.
Can I verify Sepiasend webhooks with the Resend SDK?
Yes. Each request carries the svix-id, svix-timestamp and svix-signature headers that Resend sends, signed with the whsec_ secret you get when you add the webhook, so resend.webhooks.verify() accepts it unchanged.
Do webhooks cost extra?
No. Webhooks work on every Sepiasend plan, the free plan included, and plans differ only by how many emails you send a month.