Delivery, engagement and lifecycle events are pushed to an HTTPS endpoint you control. This is how you learn that a campaign was sent or a message bounced — do not poll for it.
Manage subscriptions from the dashboard or over /v1/webhooks. webhooks:read lists
subscriptions and deliveries; webhooks:write also subscribes a URL (one subscription
per URL), pauses or edits one, sends it a test event (webhook.test), rotates its
secret and resends deliveries.
The signing secret is returned only by createWebhook and rotateWebhookSecret, and by
a retry of either with the same Idempotency-Key within 24 hours, which replays the
answer. Reads never return it, so store it when you receive it.
A test (POST /v1/webhooks/{id}/test) goes only to an active webhook. A paused or
disabled one is refused with 409 CONFLICT: set its status to active first.
Retries
A delivery that does not get a 2xx is retried after 1 minute, 5 minutes, 30 minutes, 2 hours, 6 hours, 12 hours and 24 hours, about 45 hours in all. If the last retry fails and the endpoint accepted nothing else in that time, the webhook is disabled and the workspace’s admins are notified. For a workspace a partner manages, the partner’s admins are told instead. A 410 Gone is not retried: it says the endpoint was removed, so the webhook is disabled at once, the same way.
A paused or disabled webhook receives no new events. Events that happen meanwhile are
not queued and are not sent later. Deliveries that were already pending wait, and are
sent once the webhook is active again. To catch up on the gap, read the resources
for it, such as GET /v1/messages and GET /v1/contacts.
An endpoint that fails five requests in a row is held: nothing is sent to it for
5 minutes, doubling with each further failure up to an hour, and the next request after
that is a probe. One success releases it. While held, deliveries wait without using up
their retries, and each pending delivery’s nextAttemptAt says when it is tried next.
Changing the URL or turning the webhook back on releases it at once.
The delivery log
GET /v1/webhooks/deliveries lists every delivery, newest first, with its last attempt:
status (pending, delivered or failed), attempt, responseStatus,
failureReason, the start of your endpoint’s reply and, while pending, nextAttemptAt.
Narrow it with webhookId, status, eventType and eventId. A pending or failed
delivery carries the exact body sent, as requestBody; a delivered one has dropped it.
GET /v1/webhooks/deliveries/{id} reads one, such as the delivery a test or a
redelivery returned, to watch it settle.
After an outage, list what failed and resend it:
GET /v1/webhooks/deliveries?status=failed&eventType=message.bounced
POST /v1/webhooks/deliveries/{deliveryId}/redeliverA redelivery sends the same event again, with the same eventId, so a receiver that
deduplicates sees a retry, not a new event. Only a failed delivery whose body is still
kept can be resent (409 CONFLICT otherwise; 404 for an id the workspace does not have).
A delivered event cannot be resent. A redelivery to a paused or disabled webhook waits
until it is active.
Events
| Event | Fires when | data |
|---|---|---|
contact.created |
A contact is created, by any route | contact |
contact.unsubscribed |
A recipient opted out through an email’s link | contact, channel, messageId and campaignId when the link names them, topicId when they left only that topic (their email consent is then unchanged) |
contact.consent_changed |
Consent on a channel or a topic was granted or withdrawn | contact, channel, topicId, granted, source |
form.submitted |
A hosted form is submitted | form (id, name), contact, eventId, outcome, location, utm, referrerHost, trafficSource, placement |
campaign.sent |
A campaign has queued all its messages. Each message’s outcome follows as its own message.* event |
campaign |
journey.enrolled |
A contact enters a journey | journey (id, name), contact, journeyEnrollmentId, triggerEventId |
message.sent |
The message was handed to the email provider or push service, for every kind of message (message.messageType says which). For push, the push service (APNs or FCM) accepted it; that does not show the device displayed it |
message, providerMessageId (the email provider’s id, null for push) |
message.delivered |
Email only. The recipient’s mail server accepted the message. It does not show whether it reached the inbox or the spam folder | message, providerMessageId |
message.bounced |
Delivery failed permanently (a hard bounce). A soft bounce is message.failed with message.failure.reason transient_bounce |
message (its bounce holds occurredAt, type: mailbox_not_found, mailbox_full, suppressed or general, and the server’s detail), providerMessageId |
message.complained |
The recipient marked it as spam | message, providerMessageId |
message.opened |
The first open, which may be a machine’s: Apple Mail Privacy Protection fetches every message’s images, Gmail fetches them on delivery while its app is open, and mail security scanners check messages. Check message.openedByMachine. No event follows when a person opens it later |
message |
message.clicked |
The first click or push tap by a person. A machine’s click (a mail security scanner checking links on delivery, a link preview) sends no event and only sets message.clickedByMachine |
message, url: the email link followed, null for a push tap |
message.failed |
Sending broke and will not be retried: the provider refused it, or a problem on Kirora’s side stopped it (not_sent, never caused by your side); why is in message.failure.reason |
message |
message.skipped |
A guard stopped it before sending (no consent, a suppressed address, no device, a test address, a message limit, a suspended workspace) or it was cancelled; why is in message.skip.reason (every reason) |
message |
journey.action_reached |
A journey reached a webhook action that names this endpoint; sent only there | journeyId, journeyEnrollmentId, journeyStepId, contactId, data |
webhook.test |
You sent a test with POST /v1/webhooks/{id}/test or from the dashboard; sent only to that endpoint |
webhookId |
journey.action_reached and webhook.test cannot be subscribed to. They are sent only
in the cases described, whatever events the endpoint subscribes to.
Messages sent to a reserved test address (example.com and the like) fire real events
for the outcome the address simulates, such as [email protected]. They carry
message.simulated: true. Nothing was handed to a provider, and a simulated bounce or
complaint suppresses nothing.
message is the message exactly as GET /v1/messages/{id} returns it (OutboundMessage):
its status and timestamps, its outcome as one object (bounce, failure or skip,
each with occurredAt and why, null unless status is that outcome), contact
(id, externalId, email, firstName, lastName), channel, messageType, where it came from
(campaign or journey, each with its id and current name), and correlationId —
the reference you sent with a transactional message, null when there is none — so you
can match an outcome to
your own record without reading the message back. It never carries the message body.
contact is the API’s Contact (the contact read adds only emailSuppression), and
campaign a Campaign: one type for the API and its webhooks.
Every event’s payload is in the API reference (the webhooks section), and GET /v1/webhooks/events (any valid key) lists each event you can subscribe to,
with what fires it and an example delivery body. Subscribe and unsubscribe with
POST /v1/webhooks and DELETE /v1/webhooks/{id} (scope webhooks:write).
A subscription may name specific events or subscribe to *, which includes events
added later. That is deliberate and safe in a way a wildcard API-key scope is not: a new
event type means more traffic, never more authority.
The envelope
Every delivery body has the same four fields:
// The request body of a webhook delivery, with data.message shortened
{
"eventId": "01a0f2cf-4444-7555-8666-777788889999",
"eventType": "message.delivered",
"occurredAt": "2026-10-01T09:31:04.000Z",
"data": {
"message": {
"id": "0192f3b0-1a2b-7c3d-8e4f-5a6b7c8d9e0f",
"status": "delivered",
"deliveredAt": "2026-10-01T09:31:04.000Z"
// …and the rest of the OutboundMessage
},
"providerMessageId": "0100019290c1a2b3-example-000000"
}
}Objects and rules has the full body.
occurredAt is when Kirora queued the event, not when the provider reported it. The
resource inside data carries its own timestamps, such as deliveredAt.
Payloads are snapshots
Each event carries the resource as it was when the event happened — message.delivered
shows the message delivered, contact.consent_changed the contact after the change. By
the time you process it the resource may have moved on, so read it again before acting on
its current state.
Delivery is at-least-once and unordered: deduplicate on eventId (also sent as
X-Webhook-Event-Id), and order events by the resource’s own timestamps
(deliveredAt, openedAt) or by occurredAt, not by when they arrive. A contact or
campaign also carries updatedAt, so keep the copy with the later one; a message has
none, so order its events by those timestamps.
The request
POST /your-endpoint
Content-Type: application/json
X-Webhook-Event: message.bounced
X-Webhook-Event-Id: 018f3a…
X-Webhook-Attempt: 1
X-Webhook-Timestamp: 1790418662
X-Webhook-Signature: sha256=9f86d081884c7d659a2feaa0c55ad015a3bf4f1b…| Header | Value |
|---|---|
X-Webhook-Event |
The event type, as eventType in the body |
X-Webhook-Event-Id |
The eventId. Stable across retries of the same event: use it to deduplicate |
X-Webhook-Attempt |
1 for the first try, up to 8 |
X-Webhook-Timestamp |
Unix seconds when this attempt was signed |
X-Webhook-Signature |
One sha256= signature for each active secret, comma-separated |
Verifying the signature
An unverified webhook endpoint accepts anything anyone posts to it. Verify every request.
The signature is sha256= followed by the hex HMAC-SHA256 of
${X-Webhook-Timestamp}.${raw request body}, keyed with the subscription’s signing
secret. The timestamp is Unix seconds. Signing it with the body is what stops replays:
a captured request cannot be re-sent later with a fresh timestamp. Refuse any timestamp
more than five minutes from your clock.
After POST /v1/webhooks/{id}/rotate-secret, the old secret keeps signing for 24 hours
(until the webhook’s previousSecretExpiresAt), so the header carries both signatures,
comma-separated. Accept the request if any of them verifies, and deploy the new secret
before that time. If a rotation’s response is lost, retry it with the same
Idempotency-Key: the retry returns the same new secret instead of rotating again.
Rotating again during the overlap ends the first rotation’s secret at once, keeps the
original signing, and does not extend the 24 hours: deploy the secret from the last
response.
import { createHmac, timingSafeEqual } from 'node:crypto';
export function verifyWebhookSignature(
secret: string,
rawBody: string,
signatureHeader: string,
timestamp: string,
toleranceSeconds = 300,
): boolean {
if (!/^\d+$/.test(timestamp)) return false;
if (Math.abs(Date.now() / 1000 - Number(timestamp)) > toleranceSeconds) return false;
const expected = Buffer.from(
`sha256=${createHmac('sha256', secret).update(`${timestamp}.${rawBody}`).digest('hex')}`,
);
return signatureHeader.split(',').some((signature) => {
const received = Buffer.from(signature.trim());
return received.length === expected.length && timingSafeEqual(expected, received);
});
}Three details decide whether verification protects you:
- Sign the raw body, exactly as received. Parsing to JSON and re-serialising changes key order and whitespace and the HMAC will not match. Most frameworks parse the body before your handler sees it; configure a raw-body capture on the webhook route.
- Compare in constant time.
===leaks how much of the signature matched, one byte at a time. UsetimingSafeEqualor the equivalent, and compare lengths first — it throws on mismatched lengths. - Check the timestamp. The signature proves who sent the request; the tolerance window proves it was sent just now. Skip it and a leaked request replays forever.
Reject anything that fails verification with 401 and do not process it.
Delivery and retries
- Respond 2xx to acknowledge. Any other status, or a timeout, counts as a failure.
Return 2xx for event types you do not handle too: new types are added over time, and
a
*subscription receives them. - The request times out after 5 seconds. Acknowledge first, process afterwards — doing real work inside the handler is the usual cause of retry storms.
- Failed deliveries are retried on the schedule under Retries — eight
attempts in all.
X-Webhook-Attempttells you which attempt you are seeing. - Redirects are not followed. Give the exact final URL.
- Delivery history is kept for 30 days for a delivered event, and 90 days for a failed one, whose body stays so you can read it and resend it. Deleting a contact deletes its pending and failed deliveries, which are then never sent or resent.
Writing a handler
Delivery is at-least-once, so your handler must be idempotent. Deduplicate on
X-Webhook-Event-Id, and do not assume ordering — message.delivered and
message.opened for the same message can arrive out of order.
The shape of a correct handler:
- Capture the raw body.
- Verify the signature. Reject with 401 if it fails.
- Check whether you have already processed this
X-Webhook-Event-Id. If so, return 200. - Enqueue the work.
- Return 200.
A complete receiver in Node.js
This receiver uses only Node.js’s own node:http and node:crypto, so it needs no
packages. It reads the raw body, verifies the signature as described above, saves each
event once by its eventId, and returns 200. saveEventOnce is a placeholder: connect
it to your own database or queue. Saving and deduplicating in one durable write means an
event is never lost between the check and the save, and a repeat delivery saves nothing.
If the save fails, the receiver returns 500 so the delivery is retried.
import { createHmac, timingSafeEqual } from 'node:crypto';
import { createServer } from 'node:http';
// The `secret` that createWebhook (or rotate-secret) returned. Never commit it.
const WEBHOOK_SECRET = process.env.KIRORA_WEBHOOK_SECRET;
const TOLERANCE_SECONDS = 300;
// Your own cap on the body size, so a stranger cannot make you buffer without limit.
const MAX_BODY_BYTES = 1024 * 1024;
/** `sha256=` + hex HMAC-SHA256 of `${timestamp}.${raw body}`, as Kirora signs it. */
function isSignatureValid(rawBody, timestamp, signatureHeader) {
if (!/^\d+$/.test(timestamp)) return false;
if (Math.abs(Date.now() / 1000 - Number(timestamp)) > TOLERANCE_SECONDS) return false;
const expected = Buffer.from(
'sha256=' +
createHmac('sha256', WEBHOOK_SECRET)
.update(`${timestamp}.`)
.update(rawBody)
.digest('hex'),
);
// During a secret rotation the header carries one signature per secret.
return signatureHeader.split(',').some((signature) => {
const received = Buffer.from(signature.trim());
return received.length === expected.length && timingSafeEqual(expected, received);
});
}
/**
* Placeholder: replace with your own durable store. Save the event once, keyed by its
* id, and queue it for a worker, in one transaction: for example, insert it into a table
* with a unique constraint on `event_id`. Return false when the id was already saved.
*/
async function saveEventOnce(eventId, event) {
throw new Error('saveEventOnce is a placeholder: connect it to your database or queue');
}
async function readRawBody(request) {
const chunks = [];
let size = 0;
for await (const chunk of request) {
size += chunk.length;
if (size > MAX_BODY_BYTES) return undefined;
chunks.push(chunk);
}
return Buffer.concat(chunks);
}
const server = createServer(async (request, response) => {
if (request.method !== 'POST' || request.url !== '/webhooks/kirora') {
response.writeHead(404).end();
return;
}
// 1. The raw bytes, before anything parses them.
const rawBody = await readRawBody(request);
if (rawBody === undefined) {
response.writeHead(413).end();
return;
}
// 2. Verify. Node.js gives header names in lower case.
const timestamp = request.headers['x-webhook-timestamp'] ?? '';
const signatureHeader = request.headers['x-webhook-signature'] ?? '';
if (!isSignatureValid(rawBody, timestamp, signatureHeader)) {
response.writeHead(401).end();
return;
}
const event = JSON.parse(rawBody.toString('utf8'));
try {
// 3 and 4. Save it once, by its id; a repeat delivery saves nothing.
await saveEventOnce(event.eventId, event);
} catch (error) {
// Not saved: return 500 so the delivery is retried.
console.error('could not save webhook event', event.eventId, error);
response.writeHead(500).end();
return;
}
// 5. Acknowledge, for every event type, handled or not. A worker does the real work.
response.writeHead(200).end();
});
server.listen(Number(process.env.PORT ?? 3000));Run it with KIRORA_WEBHOOK_SECRET set to the subscription’s secret, behind HTTPS at a
public address, and subscribe that URL with createWebhook. A worker then reads the
saved events and does the real work, ordering a message’s events by the timestamps in
data.message, not by when they arrived.