Build and deliverability
Webhooks
Signed event notifications for email, domains and contacts, with retries and replay.
Webhooks tell your app when something happens: an email is delivered or bounces, mail arrives, a domain verifies, a contact changes. isent POSTs a signed JSON event to each endpoint subscribed to it. Manage endpoints in Webhooks or with the Webhooks API.
Add an endpoint
curl -X POST https://isent.dev/api/v1/webhooks \
-H "Authorization: Bearer $ISENT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://api.acme.com/webhooks/isent",
"events": [
"email.delivered",
"email.bounced",
"email.complained"
],
"description": "Production"
}'- The response includes
signing_secret(whsec_…). It is shown here and when you rotate it, never again: store it with your other secrets. - The URL must be HTTPS and reach a public address. Put credentials in your own check, not in the URL.
- Endpoints per plan: Free 1, Pro 10, Scale 20, and as many as you need on Enterprise.
- Rotating the secret (
POST /webhooks/{id}/rotate-secret) replaces it at once: the old one stops working.
Events
| Event | Sent when |
|---|---|
email.sent | The email left isent for the recipient's mail server. |
email.delivered | The recipient's mail server accepted the email. |
email.delivery_delayed | Delivery is delayed for now (a soft bounce). isent keeps trying; the address is not suppressed. |
email.bounced | The recipient's server rejected the email for good (a hard bounce). The address is added to your suppression list. |
email.complained | The recipient marked the email as spam. The address is added to your suppression list. |
email.opened | The recipient opened the email. Needs open tracking on the sending domain. |
email.clicked | The recipient clicked a link. Needs click tracking on the sending domain. |
email.suppressed | The email was not sent because every recipient is on your suppression list. |
email.received | A message arrived at one of your receiving domains or inboxes. |
email.scheduled | The email is scheduled for later. |
email.failed | The email could not be sent. |
| Event | Sent when |
|---|---|
domain.created | A domain was added. |
domain.updated | A domain changed: its verification status or its settings. |
domain.deleted | A domain was deleted. |
| Event | Sent when |
|---|---|
contact.created | A contact was created. |
contact.updated | A contact changed. |
contact.deleted | A contact was deleted. |
Payload
Every event is a JSON object with its type, when it happened (created_at) and data: the email, domain or contact it is about, shaped as the API returns it.
{
"type": "email.delivered",
"created_at": "2026-11-27T14:02:14.000Z",
"data": {
"email_id": "em_7Hq2k9Wd",
"from": "Acme <hello@mail.acme.com>",
"to": [
"amira@acme.com"
],
"subject": "Your receipt",
"tags": [
{
"name": "category",
"value": "receipt"
}
],
"broadcast_id": null,
"created_at": "2026-11-27T14:02:11.000Z"
}
}Verify the signature
Each request carries three headers. Check the signature before you trust the payload.
| Header | Value |
|---|---|
webhook-id | The event id. The same on every retry and replay: use it to skip events you already handled. |
webhook-timestamp | Unix seconds of this attempt. |
webhook-signature | v1, and the base64 HMAC-SHA256 of {webhook-id}.{webhook-timestamp}.{body}. |
The HMAC key is the base64 part of your secret, after whsec_. Sign the raw body exactly as received, compare in constant time, and reject timestamps more than 5 minutes from your clock. The scheme follows the Standard Webhooks format, so its libraries also verify isent events.
import { createHmac, timingSafeEqual } from "node:crypto";
// body: the raw request body as a string, before any JSON parsing.
export function verifyWebhook(secret, headers, body) {
const id = headers.get("webhook-id") ?? "";
const timestamp = headers.get("webhook-timestamp") ?? "";
if (Math.abs(Date.now() / 1000 - Number(timestamp)) > 300) return false;
const key = Buffer.from(secret.replace(/^whsec_/, ""), "base64");
const mac = createHmac("sha256", key).update(`${id}.${timestamp}.${body}`).digest("base64");
const expected = Buffer.from(`v1,${mac}`);
return (headers.get("webhook-signature") ?? "").split(" ").some((candidate) => {
const got = Buffer.from(candidate);
return got.length === expected.length && timingSafeEqual(got, expected);
});
}Respond, retries and replay
- Answer with any 2xx status within 15 seconds. Do slow work after you answer, from a queue.
- Anything else, or no answer, is retried: retries with exponential backoff for up to about a day. After that the delivery is marked failed.
- Retries can arrive after newer events. Order by
created_atwhen it matters, and skipwebhook-idvalues you have seen. - Every delivery, with the status and the start of the response your endpoint gave, is listed in the dashboard and at
GET /webhooks/{id}/deliveries. - Replay any delivery with
POST /webhooks/{id}/deliveries/{deliveryId}/replay. It is sent again with the samewebhook-id.