# Receive webhook notifications

Get notified when mail arrives or a send is accepted, verify the delivery, then fetch the message through the API.

Source: https://cherami.to/docs/guides/webhooks



Add a webhook and we POST to your https URL when a message arrives in an inbox (`message.received`) or a send is accepted (`message.sent`). Each notification carries the inbox and message IDs; fetch the message through the API. Set webhooks up in [Account → Webhooks](https://cherami.to/account/webhooks) or with the API below.

A webhook needs something of yours listening at the URL, such as a server, a serverless function or a queue. An agent without one can [poll](https://cherami.to/docs/guides/receiving) instead.

## Add a webhook [#add-a-webhook]

Choose the events and the inboxes. `message.received` fires when a received message is ready to read. `message.sent` fires when we accept a send for delivery; accepted is not delivered.

Leave out `inbox_ids` to cover every inbox in your account, including ones you create later, or list up to 10 inbox IDs:

```sh
curl --fail-with-body --silent --show-error \
  https://cherami.to/v1/webhooks \
  -H "Authorization: Bearer $CHERAMI_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-binary @- <<'EOF'
{
  "url": "https://example.com/hooks/cherami",
  "event_types": ["message.received"],
  "inbox_ids": ["INBOX_ID"]
}
EOF
```

The `201` response includes `secret`, the webhook's signing secret; you can [retrieve it again](https://cherami.to/docs/api/webhooks/get-webhook-secret) later. Adding the same URL again creates a second webhook that receives the same events.

Use the final public https address: we refuse private addresses and don't follow redirects.

## What a delivery contains [#what-a-delivery-contains]

Every delivery is a POST with a JSON body like this:

```json
{
  "id": "66666666-6666-4666-8666-666666666666",
  "type": "message.received",
  "timestamp": "2026-10-01T14:30:00.123Z",
  "data": {
    "inbox_id": "11111111-1111-4111-8111-111111111111",
    "message_id": "22222222-2222-4222-8222-222222222222"
  }
}
```

`id` is the event ID. `timestamp` is when the message became ready or the send was accepted. For `message.received`, `data.message_id` is a received message: read it with [`GET /v1/messages/{message_id}`](https://cherami.to/docs/api/messages/get-message). For `message.sent`, it's a sent message: read it with [`GET /v1/sent/{message_id}`](https://cherami.to/docs/api/sending/get-sent-message).

## Verify and acknowledge [#verify-and-acknowledge]

Verify each delivery with a [Standard Webhooks](https://www.standardwebhooks.com/) or Svix library and the webhook's secret; either works with these headers unmodified. Each delivery carries `webhook-id`, `webhook-timestamp` and `webhook-signature`, also sent as `svix-id`, `svix-timestamp` and `svix-signature`. To verify by hand:

1. Build the signed string `webhook-id.webhook-timestamp.body` from the raw request body, exactly as received. Re-serializing parsed JSON changes whitespace and breaks the signature.
2. Compute HMAC-SHA256 over that string with the secret, base64-decoded after removing its `whsec_` prefix, and base64-encode the result.
3. Accept if any space-separated `v1,<signature>` entry in `webhook-signature` matches, using a constant-time comparison. Several entries appear while a rotated secret is still signing.
4. Reject a `webhook-timestamp` more than five minutes from your clock, to limit replays.

Respond with a 2xx within 15 seconds, once you've stored the event (in your queue or database), not after acting on it. A receiver that does the work first times out and gets the delivery again.

Delivery is at-least-once and unordered: deduplicate on the body's `id`, not the `webhook-id` header, and use `timestamp` for order.

## Handle failures [#handle-failures]

While your receiver is down, mail is stored and readable through the API as usual. We retry each failed delivery for about a day, and disable a webhook whose deliveries keep failing; it then reads `status: "disabled"`. Fix the receiver, [set `enabled: true`](https://cherami.to/docs/api/webhooks/update-webhook), then [poll](https://cherami.to/docs/guides/receiving) for messages after the last event you handled. There is no resend.

## See what was delivered [#see-what-was-delivered]

Delivery history shows what we sent and how your receiver answered, in [Account → Webhooks](https://cherami.to/account/webhooks) and through the API. Use it to confirm an integration or find a missing notification:

* [Attempts for a webhook](https://cherami.to/docs/api/webhooks/list-webhook-attempts): each attempt to that URL, newest first, with its status, response code, duration, the event it carried and the start of your receiver's response.
* [Recent events](https://cherami.to/docs/api/webhooks/list-webhook-events): the events your account's mail produced, whichever webhooks they reached. Check here that an event exists before you debug the receiver.
* [One event by ID](https://cherami.to/docs/api/webhooks/get-webhook-event): the event and every attempt made for it across your webhooks. Start here when a receiver reports a duplicate or a gap.

## Edit, rotate, delete [#edit-rotate-delete]

Change event types, inbox scoping or the enabled flag in [Account → Webhooks](https://cherami.to/account/webhooks) or by [updating the webhook](https://cherami.to/docs/api/webhooks/update-webhook). An `event_types` or `inbox_ids` array you send replaces the old one whole, and an empty `inbox_ids` returns the webhook to every inbox. The URL can't be edited: add a webhook for the new URL, confirm it receives, then delete the old one.

[Custom headers](https://cherami.to/docs/api/webhooks/update-webhook-headers) are sent with every delivery, for a shared token your receiver checks alongside the signature, or for routing metadata. You can list header names later; values are never shown again.

[Rotating the secret](https://cherami.to/docs/api/webhooks/rotate-webhook-secret) returns a new one. By default the old secret keeps signing for 24 hours alongside it, so you can update the receiver at your own pace; `immediate: true` retires the old secret at once.

Deleting a webhook stops its deliveries.

## Agents and MCP hosts [#agents-and-mcp-hosts]

MCP tools don't manage webhooks; use Account or the API. A webhook calls your URL, not the agent's conversation, so pair it with something that queues or starts the agent's work, or have the agent poll as the [cookbooks](https://cherami.to/docs/cookbooks/project-update-intake) do.

[Webhook operations reference](https://cherami.to/docs/api/webhooks) · [Errors, limits and pagination](https://cherami.to/docs/api/errors)
