Skip to content

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

Email events
EventSent when
email.sentThe email left isent for the recipient's mail server.
email.deliveredThe recipient's mail server accepted the email.
email.delivery_delayedDelivery is delayed for now (a soft bounce). isent keeps trying; the address is not suppressed.
email.bouncedThe recipient's server rejected the email for good (a hard bounce). The address is added to your suppression list.
email.complainedThe recipient marked the email as spam. The address is added to your suppression list.
email.openedThe recipient opened the email. Needs open tracking on the sending domain.
email.clickedThe recipient clicked a link. Needs click tracking on the sending domain.
email.suppressedThe email was not sent because every recipient is on your suppression list.
email.receivedA message arrived at one of your receiving domains or inboxes.
email.scheduledThe email is scheduled for later.
email.failedThe email could not be sent.
Domain events
EventSent when
domain.createdA domain was added.
domain.updatedA domain changed: its verification status or its settings.
domain.deletedA domain was deleted.
Contact events
EventSent when
contact.createdA contact was created.
contact.updatedA contact changed.
contact.deletedA 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.

JSON
{
  "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.

Webhook headers
HeaderValue
webhook-idThe event id. The same on every retry and replay: use it to skip events you already handled.
webhook-timestampUnix seconds of this attempt.
webhook-signaturev1, 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_at when it matters, and skip webhook-id values 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 same webhook-id.