Sending email

Webhooks

Get delivery, open, click, bounce and complaint events as they happen.

Under Transactional → Webhooks, add an HTTPS endpoint and choose email.* or single topics: email.sent, email.delivered, email.delivery_delayed, email.bounced, email.complained, email.opened, email.clicked, email.failed, email.suppressed. Each delivery is a POST of JSON:

Webhook payload
{
  "id": "email.delivered:6f1c0f3e-…",
  "topic": "email.delivered",
  "created_at": "2026-11-28T10:04:09.000Z",
  "data": {
    "source": "transactional",
    "email_id": "6f1c0f3e-…",
    "from": "\"Acme\" <hello@acme.com>",
    "to": ["sam@example.com"],
    "subject": "Your receipt",
    "tags": [{ "name": "category", "value": "receipt" }],
    "email_created_at": "2026-11-28T10:04:02.000Z"
  }
}

Bounces add bounce_type (hard or soft) and recipients; clicks add link; opens and clicks add likely_automatic. Deliveries are at least once (de-duplicate on id), a failed one is retried with growing waits, and they arrive in no guaranteed order. An endpoint that keeps failing for 3 days is turned off.

Campaigns and flows

Tick Campaigns or Flows on the webhook to get the same topics for them (it starts with transactional emails only). Those payloads carry source (campaign or flow), send_id, campaign_id or flow_id and flow_step_id, contact_id, email and subject. A large campaign sends one event per recipient per event type.

Verifying signatures

Every delivery is signed: X-YouSendIt-Signature: t=<unix seconds>,v1=<hex>, where v1 is HMAC-SHA256 of <t>.<raw body> with your endpoint's signing secret. Check it before trusting the payload:

Verify a signature in Node.js
import { createHmac, timingSafeEqual } from "node:crypto";

// rawBody: the exact bytes of the request (read before parsing JSON).
export function verify(rawBody, header, secret) {
  const parts = header.split(",");
  const t = parts.find((p) => p.startsWith("t="))?.slice(2);
  const sigs = parts.filter((p) => p.startsWith("v1=")).map((p) => p.slice(3));
  if (!t || Math.abs(Date.now() / 1000 - Number(t)) > 300) return false;
  const expected = createHmac("sha256", secret).update(`${t}.${rawBody}`).digest("hex");
  return sigs.some((s) => s.length === expected.length && timingSafeEqual(Buffer.from(s), Buffer.from(expected)));
}