Source: https://solidhooks.com/guides/resend-webhooks

# Resend webhooks: how to verify a Resend webhook signature

Checked against Resend's docs: 2 November 2026. Resend's event list and retry schedule change from time to time, so check [Resend's own docs](https://resend.com/docs/dashboard/webhooks/introduction) before you rely on a detail.

Resend webhooks are sent through Svix, so each POST carries three headers: `svix-id`, `svix-timestamp` and `svix-signature`. To verify a Resend webhook signature, check those headers against the raw request body with your endpoint's `whsec_` signing secret, using Resend's SDK, the Svix library or a few lines of your own code. Then return a 2xx quickly and dedupe on `svix-id`, because Resend's retries reuse it.

This page covers which events to handle, verification code for Next.js, Express and Python, a checklist for webhooks that don't arrive, and how to keep events you missed. We make SolidHooks, and we've tried to be fair about the alternatives, including Resend's own.

## How Resend webhooks work

A Resend webhook is an HTTPS POST to an endpoint you own, sent when something happens to an email, domain, contact or inbox. You can create and manage webhooks from the dashboard, the API, an SDK, the Resend CLI or Resend's MCP server ([Resend: webhooks introduction](https://resend.com/docs/dashboard/webhooks/introduction)).

Setting one up takes two steps:

1. 1
   <!-- -->
   . **Create an endpoint in your app** that accepts POST requests.
2. 2
   <!-- -->
   . **Add a webhook in Resend** with that URL and the event types you want.

Each webhook has its own **signing secret**, shown on the webhook's details page. The create, retrieve and list webhook API calls also return it in the response body ([Resend: verify webhook requests](https://resend.com/docs/webhooks/verify-webhooks-requests)). Keep it in an environment variable such as `RESEND_WEBHOOK_SECRET`, and never log it.

## Which Resend webhook events to handle

Most apps act on the email events. Meanings below are from [Resend's event types page](https://resend.com/docs/webhooks/event-types).

| Event                                                        | What Resend says it means                                                  | What to do                               |
| ------------------------------------------------------------ | -------------------------------------------------------------------------- | ---------------------------------------- |
| `email.delivered`                                            | Delivered to the recipient's mail server                                   | Mark the message delivered               |
| `email.delivery_delayed`                                     | Temporary issue, such as a full inbox                                      | Don't alert yet                          |
| `email.bounced`                                              | The recipient's mail server permanently rejected it                        | Suppress the address in your own app     |
| `email.complained`                                           | Delivered, then marked as spam                                             | Unsubscribe them                         |
| `email.failed`                                               | Failed to send, e.g. invalid recipients, API key, domain or quota problems | Fix your sending setup                   |
| `email.sent`, `opened`, `clicked`, `scheduled`, `suppressed` | Sending, engagement and suppression updates                                | Record as needed                         |
| `email.received`                                             | Resend received an inbound email                                           | Hand it to your inbound handler or agent |

Resend also sends domain, contact, suppression, topic and **inbox** events (such as `inbox.email.received`). Select only the events you handle.

## Verifying a Resend webhook signature

Resend signs each webhook with a key specific to the endpoint. Verifying it proves the request came from Resend and wasn't changed on the way. The timestamp also limits replay attacks, where someone resends a captured valid request ([Resend: verify webhook requests](https://resend.com/docs/webhooks/verify-webhooks-requests)).

The scheme is Svix's, and it's the same as [Standard Webhooks](https://www.standardwebhooks.com/). Only the header prefix differs: Svix uses `svix-`, Standard Webhooks uses `webhook-` ([Svix: manual verification](https://docs.svix.com/receiving/verifying-payloads/how-manual)). Here is the method:

1. 1
   <!-- -->
   . Take the part of the secret after `whsec_` and **base64-decode** it. The raw bytes are the key, not the string.
2. 2
   <!-- -->
   . Build the signed content: `{svix-id}.{svix-timestamp}.{raw body}`.
3. 3
   <!-- -->
   . Compute HMAC-SHA256 with that key and base64-encode the result.
4. 4
   <!-- -->
   . `svix-signature` is a **space-separated list** such as `v1,<sig> v1,<sig>`. Remove the `v1,` prefix and accept the request if **any** entry matches, using a constant-time comparison.
5. 5
   <!-- -->
   . Reject timestamps too far from now. Five minutes either way is the usual window.

The step that trips most people up is the **raw body**. Resend warns that the signature is "sensitive to even the slightest change". If a framework parses the JSON and you verify a re-stringified copy, verification will fail.

> **About these snippets.&#x20;**&#x54;hey're our own examples, written for this page. We ran each one on 2 November 2026 (Node 24, `resend` 6.37.0, `svix` 2.9.1, `standardwebhooks` 1.1.1, Python 3 with Flask) against requests signed with test secrets. We tried a valid request, a tampered body, the wrong secret, a 10-minute-old timestamp and a two-signature rotation list. Each snippet gave the expected result. They are not production code, so test them in your own stack.

### The Resend SDK (Next.js App Router)

Resend's SDK has `resend.webhooks.verify()`. In an App Router route handler, read the body with `req.text()` and the headers with `req.headers.get()`:

typescript

```
// app/api/webhooks/resend/route.ts
import { Resend } from 'resend';
 
const resend = new Resend(process.env.RESEND_API_KEY);
 
export async function POST(req: Request) {
  // 1. Read the raw body. Never req.json() before verifying.
  const payload = await req.text();
 
  let event;
  try {
    // 2. Throws if the signature or timestamp is invalid
    event = resend.webhooks.verify({
      payload,
      headers: {
        id: req.headers.get('svix-id') ?? '',
        timestamp: req.headers.get('svix-timestamp') ?? '',
        signature: req.headers.get('svix-signature') ?? '',
      },
      webhookSecret: process.env.RESEND_WEBHOOK_SECRET!,
    });
  } catch {
    return new Response('Invalid signature', { status: 400 });
  }
 
  // 3. Hand off and answer quickly; dedupe later on svix-id
  await enqueue(req.headers.get('svix-id')!, event);
  return new Response(null, { status: 204 });
}
 
```

`enqueue` stands for your own queue or database insert. Keep the slow work out of the request.

### The svix library (Express)

You can also use the `svix` package that Resend's docs point to. In Express, apply `express.raw()` to this route only, so the body stays as bytes:

typescript

```
import express from 'express';
import { Webhook } from 'svix';
 
const app = express();
const wh = new Webhook(process.env.RESEND_WEBHOOK_SECRET!);
 
app.post(
  '/webhooks/resend',
  express.raw({ type: 'application/json' }),
  (req, res) => {
    const raw = req.body.toString('utf8');
    try {
      // Throws if invalid. Recent svix versions return nothing,
      // so parse the JSON yourself afterwards.
      wh.verify(raw, {
        'svix-id': req.header('svix-id') ?? '',
        'svix-timestamp': req.header('svix-timestamp') ?? '',
        'svix-signature': req.header('svix-signature') ?? '',
      });
    } catch {
      return res.status(400).send('Invalid signature');
    }
    const event = JSON.parse(raw);
 
    switch (event.type) {
      case 'email.bounced':
      case 'email.complained':
        // add the recipient to your suppression list
        break;
    }
    res.sendStatus(204);
  },
);
 
```

One catch we found while testing: in `svix` 2.9.1, `verify()` is typed to return `undefined`. Code that does `const event = wh.verify(...)` and then reads `event.type` crashes. Parse the body yourself once it has verified.

### By hand (Node.js)

You don't need a library, and writing it once makes the method clear:

typescript

```
import { createHmac, timingSafeEqual } from 'node:crypto';
 
const TOLERANCE_SECONDS = 5 * 60;
 
export function verifyResendWebhook(
  rawBody: string,
  headers: { id: string; timestamp: string; signature: string },
  secret: string, // "whsec_..."
): boolean {
  const ts = Number(headers.timestamp);
  if (!Number.isInteger(ts)) return false;
  if (Math.abs(Date.now() / 1000 - ts) > TOLERANCE_SECONDS) return false;
 
  // The key is the base64 part after "whsec_", decoded to bytes
  const key = Buffer.from(secret.replace(/^whsec_/, ''), 'base64');
  const expected = createHmac('sha256', key)
    .update(`${headers.id}.${headers.timestamp}.${rawBody}`)
    .digest();
 
  // Space-separated list such as "v1,abc= v1,def="; any v1 may match
  return headers.signature.split(' ').some((entry) => {
    const [version, sig] = entry.split(',');
    if (version !== 'v1' || !sig) return false;
    const given = Buffer.from(sig, 'base64');
    return given.length === expected.length && timingSafeEqual(given, expected);
  });
}
 
```

### By hand (Python, Flask)

python

```
import base64, hashlib, hmac, os, time
from flask import Flask, request, abort
 
app = Flask(__name__)
SECRET = os.environ["RESEND_WEBHOOK_SECRET"]  # "whsec_..."
TOLERANCE_SECONDS = 300
 
def verify(raw_body: bytes, msg_id: str, timestamp: str, signature: str) -> bool:
    try:
        ts = int(timestamp)
    except ValueError:
        return False
    if abs(time.time() - ts) > TOLERANCE_SECONDS:
        return False
    key = base64.b64decode(SECRET.removeprefix("whsec_"))
    signed = f"{msg_id}.{timestamp}.".encode() + raw_body
    expected = base64.b64encode(hmac.new(key, signed, hashlib.sha256).digest()).decode()
    for entry in signature.split(" "):
        version, _, sig = entry.partition(",")
        if version == "v1" and hmac.compare_digest(sig, expected):
            return True
    return False
 
@app.post("/webhooks/resend")
def resend_webhook():
    raw = request.get_data()  # bytes, before any JSON parsing
    h = request.headers
    if not verify(raw, h.get("svix-id", ""), h.get("svix-timestamp", ""), h.get("svix-signature", "")):
        abort(400)
    event = request.get_json()
    # queue the event, keyed on h["svix-id"]
    return "", 204
 
```

**Things not to do:&#x20;**&#x75;se `express.json()` on this route; `JSON.stringify` a parsed body and verify that; compare signatures with `==`; check only the first signature in the list; use the `whsec_...` string itself as the HMAC key; or log the secret.

## Resend webhook not received or failing? A checklist

Work through these in order:

1. 1
   <!-- -->
   . **Is the endpoint public and HTTPS?&#x20;**&#x52;esend can't reach `localhost`. During development, use the Resend CLI's webhook listener instead ([Resend: introduction](https://resend.com/docs/dashboard/webhooks/introduction)).
2. 2
   <!-- -->
   . **Is the event type selected?&#x20;**&#x41; webhook only receives the events you chose when you created it.
3. 3
   <!-- -->
   . **Has Resend disabled the endpoint?&#x20;**&#x49;f an endpoint keeps failing, Resend disables it automatically and emails your team. Check the [Webhooks](https://resend.com/webhooks) page and re-enable it once the endpoint is fixed ([Resend: retries and replays](https://resend.com/docs/webhooks/retries-and-replays)).
4. 4
   <!-- -->
   . **Are you returning a 2xx, and fast?&#x20;**&#x44;o the slow work after you respond. Any non-2xx counts as a failure and starts the retry schedule.
5. 5
   <!-- -->
   . **Is something in front of the route rejecting it?&#x20;**&#x41;uth middleware, a firewall, a WAF or a bot-protection rule can block the POST before your code runs.
6. 6
   <!-- -->
   . **Was the body parsed before you verified it?&#x20;**&#x54;his is the most common cause of a failed signature check.
7. 7
   <!-- -->
   . **Are you using the right secret?&#x20;**&#x45;ach webhook has its own secret, so check it isn't from another endpoint or environment, and that it hasn't been rotated. ([Resend: Webhook Ingester](https://resend.com/docs/webhooks/ingester) troubleshooting).
8. 8
   <!-- -->
   . **Is the timestamp outside your tolerance?&#x20;**&#x43;heck your server clock for skew.
9. 9
   <!-- -->
   . **Then replay what you missed** from the dashboard (see below).

A useful debugging step: log the length of the raw body and compare it with `Content-Length`. If they differ, something changed the body before you hashed it.

## Never miss an event: retries, replay and storage

**Resend's retries.&#x20;**&#x41;ccording to [Resend's docs](https://resend.com/docs/webhooks/retries-and-replays) (checked 2 November 2026), Resend tries each message immediately, then after 5 seconds, 5 minutes, 30 minutes, 2 hours, 5 hours, 10 hours and a further 10 hours. Each gap starts after the previous attempt fails, so the gaps add up to about 27 and a half hours (27 h 35 min 5 s) between the first and last attempts, plus however long each failed attempt takes. That is your window to recover, provided Resend hasn't disabled the endpoint first.

**Replay.&#x20;**&#x46;rom the dashboard you can replay a failed **or** succeeded message. Open the webhook, find the message and click **Replay**.

**Idempotency.&#x20;**&#x52;etries keep the same `svix-id` ([Resend: event types](https://resend.com/docs/webhooks/event-types)), so the same event can reach you more than once. Store `svix-id` with a unique constraint and skip anything you've already processed.

**Store first, process second.&#x20;**&#x54;he safest pattern is to write the verified event to durable storage before you act on it, and then process it from there. Resend recommends this too.

## Doing this with SolidHooks

SolidHooks is a managed inbound webhook receiver. It has a built-in `resend` provider that uses its Standard Webhooks verifier ([SolidHooks: sources](https://solidhooks.com/docs/sources), [verification](https://solidhooks.com/docs/verification)). You name the provider and give your `whsec_` secret, and SolidHooks handles the rest of the scheme:

- **Svix header names accepted.&#x20;**&#x42;oth `svix-*` and `webhook-*` headers are accepted.
- **Safe during secret rotation.&#x20;**&#x41;ny `v1` entry in the list may match. `v1a` (ed25519) entries are skipped, not verified.
- **Timestamp tolerance.&#x20;**&#x54;he default is 300 seconds either way. You can set `toleranceSeconds` from 1 to 86,400.
- **Dedupe on by default.&#x20;**&#x54;he `resend` preset defaults `idempotencyKeys` to `["headers.svix-id"]`. If your Resend account white-labels its headers, set `["headers.webhook-id"]` instead ([SolidHooks: idempotency](https://solidhooks.com/docs/idempotency)).
- **Rejected requests are kept for diagnosis.&#x20;**&#x52;equests that fail verification get a 401 and are stored as rejected events with a reason (e.g. `signature_mismatch`), never delivered or billed. Recording is rate-limited per source, so during a flood of bad requests the rejected-event log is a representative sample, not a record of every 401. `POST /v1/sources/{id}/test-signature` explains a failure ([verification](https://solidhooks.com/docs/verification)).

SolidHooks doesn't create the webhook in Resend for you. You paste its ingest URL into Resend yourself.

### Steps

**1. Create a&#x20;**__`resend`__**&#x20;source with your signing secret** (request shape from [SolidHooks: verification](https://solidhooks.com/docs/verification)):

bash

```
curl -s "$API/v1/sources" \
  -H "authorization: Bearer $SDHK_KEY" \
  -H 'content-type: application/json' \
  -d '{
    "name": "Resend email events",
    "provider": "resend",
    "verifierConfig": { "secret": "<your-resend-whsec-secret>" }
  }'
 
```

The response includes the source's `ingestUrl`, which looks like `https://sdhk.events/<maskId>` ([SolidHooks: quickstart](https://solidhooks.com/docs/quickstart)).

**2. Paste the&#x20;**__`ingestUrl`__**&#x20;into Resend** as the webhook endpoint, and select your events.

**3. Create a destination and a connection** from the source to your app or agent endpoint, as in the [quickstart](https://solidhooks.com/docs/quickstart). Connections can filter by event type. With no filter, every event is forwarded.

**4. Verify SolidHooks' own signature at your endpoint.&#x20;**&#x4E;ew destinations sign deliveries with Standard Webhooks (`webhook-id`, `webhook-timestamp`, `webhook-signature`). The secret comes from `GET /v1/destinations/{id}/signing-secret` ([SolidHooks: verifying deliveries](https://solidhooks.com/docs/delivery-signatures)):

typescript

```
import express from 'express';
import { Webhook } from 'standardwebhooks';
 
const app = express();
// Secret from GET /v1/destinations/{id}/signing-secret
const wh = new Webhook(process.env.SOLIDHOOKS_SIGNING_SECRET!.replace(/^whsec_/, ''));
 
app.post('/hooks/email-events', express.raw({ type: '*/*' }), (req, res) => {
  try {
    wh.verify(req.body, {
      'webhook-id': req.header('webhook-id') ?? '',
      'webhook-timestamp': req.header('webhook-timestamp') ?? '',
      'webhook-signature': req.header('webhook-signature') ?? '',
    });
  } catch {
    return res.sendStatus(400); // SolidHooks will retry
  }
  const event = JSON.parse(req.body.toString('utf8'));
  // dedupe on webhook-id, then process the event
  res.sendStatus(204);
});
 
```

### What happens when your app is down

SolidHooks accepts and stores the event from Resend whether or not your app is up. Resend gets its 2xx and has no reason to disable your endpoint. SolidHooks then retries delivery to your app. The first retry comes after 5 seconds, and the gaps widen from there. Hobby gets 3 attempts within 1 hour; Launch, Scale and Enterprise get 8 attempts over 36 hours ([SolidHooks: retries](https://solidhooks.com/docs/retries)). Automatic retries, and a manual retry of a single delivery, are free and don't count against your quota.

If an event needs to go through again after that, for example to a connection you've just added, you can **replay** it from the stored event log. A replay creates new deliveries, and **each one is billed** ([SolidHooks: replay](https://solidhooks.com/docs/replay)). Replays arrive with a new `webhook-id`, so plan your dedupe key with that in mind.

## Triggering an email agent from Resend

If you're building an agent that reads and answers email, the Resend events to listen for are `email.received` and the inbox events, such as `inbox.email.received`. Resend's docs make two points that matter here ([Resend: event types](https://resend.com/docs/webhooks/event-types)):

- Inbox event objects are **loaded when the webhook is sent**, not when the change happened. Two quick changes can both show the second state.
- `email` and `draft` objects in inbox events **leave out&#x20;**__`html`__**&#x20;and&#x20;**__`text`__. Your agent has to fetch the body from Resend's API.

The flow is: Resend event → verified, stored, deduplicated event → your agent's endpoint, with retries if the agent is busy or down. SolidHooks is built to be set up by agents as well as people. It has a REST API, an [llms.txt](https://solidhooks.com/llms.txt) and a hosted [MCP server](https://solidhooks.com/docs/mcp), so an agent can create the source and connection itself.

One thing not to confuse: SolidHooks also has an `email` provider that gives a source its own address and turns each message it receives into an event ([SolidHooks: email ingestion](https://solidhooks.com/docs/email-ingestion)). That is SolidHooks receiving email directly. It is a different thing from receiving Resend's `email.received` webhook through the `resend` provider.

## Other ways to do it

- **Your own handler.&#x20;**&#x41; snippet above plus a table keyed on `svix-id`; you own storage, retries and monitoring.
- **Resend Webhook Ingester.&#x20;**&#x52;esend's open-source Next.js app that verifies and stores events in your own database, such as Postgres, MySQL or BigQuery ([Resend](https://resend.com/docs/webhooks/ingester), checked 2 November 2026). Good for a self-hosted archive.
- **Vercel Connect triggers.&#x20;**&#x41;ccording to [Vercel](https://vercel.com/changelog/vercel-connect-adds-webhook-triggers-for-more-providers) (29 October 2026), Connect registers the Resend webhook for you, verifies requests and forwards events to your Vercel project.
- **Trigger.dev webhooks (beta).&#x20;**&#x41;ccording to [Trigger.dev](https://trigger.dev/changelog/webhooks-beta), Resend works via `webhooks.svix()`, pitched for "email management agents that respond to Resend events".

## FAQ

### How do I verify a Resend webhook?

Read the raw request body and the `svix-id`, `svix-timestamp` and `svix-signature` headers. Then pass them, with your endpoint's `whsec_` signing secret, to `resend.webhooks.verify()` or the Svix library. Either one throws if the signature or timestamp is invalid. Never parse and re-stringify the JSON first, or verification will fail.

### Does Resend use Svix or Standard Webhooks?

Both, in effect. Resend delivers webhooks through Svix, so requests carry `svix-` prefixed headers. Svix's scheme is the same as Standard Webhooks, which uses a `webhook-` prefix instead. Libraries such as `svix` accept either spelling, so one verifier can cover Resend and other Standard Webhooks senders.

### Why is my Resend webhook signature verification failing?

Usually the body changed before hashing: a framework parsed the JSON and you verified a re-serialised string. Other causes are a wrong or rotated secret, a secret from another endpoint or environment, decoding the `whsec_` secret incorrectly, or a timestamp outside your tolerance window. Compare the raw body length with Content-Length.

### Why am I not receiving Resend webhooks?

Check that the endpoint is a public HTTPS URL, the event types are selected, and your server returns a 2xx quickly. Resend disables endpoints that keep failing and emails your team, so check the dashboard and re-enable the endpoint. Middleware, auth or a firewall blocking the POST is another common cause. Replay missed messages afterwards.

### How often does Resend retry failed webhooks?

According to Resend's docs (checked 2 November 2026), it tries immediately, then after 5 seconds, 5 minutes, 30 minutes, 2 hours, 5 hours, 10 hours and a further 10 hours. Retries keep the same `svix-id`, so dedupe on it. You can also replay failed or succeeded messages from the Resend dashboard.

### What's the difference between email.bounced and email.failed?

`email.bounced` means the recipient's mail server permanently rejected the email, so suppress that address. `email.failed` means Resend couldn't send it at all. Causes include invalid recipients, API key or domain verification problems, and quota limits. In that case, fix your sending setup rather than suppressing the recipient.

### Can SolidHooks receive Resend webhooks?

Yes. Create a source with the `resend` provider and your signing secret, then paste its ingest URL into Resend. SolidHooks verifies the Svix headers, rejects stale timestamps, dedupes on `svix-id`, stores each event and delivers it to your app or agent. Failed deliveries are retried automatically, and you can replay stored events (replays are billed).

## Receive, verify and keep every Resend event

The Hobby plan is free for 10,000 deliveries a month. Launch is $29 a month for 50,000, and Scale is $375 a month for 1,000,000 ([pricing](https://solidhooks.com/#pricing), [plans docs](https://solidhooks.com/docs/plans), checked 2 November 2026). [**Start free**](https://dash.solidhooks.com), or [let your agent set up the pipeline](https://solidhooks.com/use-cases/ai-agent-setup).
