PlatformXeDocs
Get API Key

Webhook Delivery

How PlatformXe delivers event webhooks with signatures and retries.

When an event matches a subscription, PlatformXe delivers a POST request to your webhook URL with a signed payload.

Delivery headers

Every webhook delivery includes these headers:

HeaderDescription
X-Caldera-Signaturesha256= followed by the hex HMAC-SHA256, keyed with the subscription's secret, of {timestamp}.{raw body}
X-Caldera-TimestampThe time of this send, in unix seconds (the {timestamp} in the signed string)
X-Caldera-Delivery-IdThe delivery's id: the same on every retry of one delivery, new for a replay
X-Event-Signature, X-Event-TimestampThe same signature and timestamp under the older names
X-Event-TypeThe event type (e.g., messaging.email.sent)
X-Event-IdThe event's id: the same on every attempt and every replay of the event, and for every subscription it is sent to. Deduplicate on it
Content-Typeapplication/json

The X-Event-Signature / X-Event-Timestamp names are sent until 2027-04-30; after that date only the X-Caldera-* names carry the signature. Read X-Caldera-Signature and X-Caldera-Timestamp now.

Verifying signatures

Compute the HMAC over the timestamp, a dot and the raw request body (the bytes as received, before any JSON parsing), and compare it with X-Caldera-Signature in constant time. Refuse a timestamp more than 5 minutes from your clock, so a captured request cannot be replayed later.

import crypto from 'crypto';

function verifyWebhook(rawBody: string, signature: string, timestamp: string, secret: string): boolean {
  const ts = Number(timestamp);
  if (!Number.isInteger(ts) || Math.abs(Date.now() / 1000 - ts) > 300) return false;
  const expected = 'sha256=' + crypto.createHmac('sha256', secret).update(`${ts}.${rawBody}`).digest('hex');
  const a = Buffer.from(signature);
  const b = Buffer.from(expected);
  return a.length === b.length && crypto.timingSafeEqual(a, b);
}

// In your webhook handler (express.raw keeps the body as received)
app.post('/webhooks/platformxe', express.raw({ type: 'application/json' }), (req, res) => {
  const isValid = verifyWebhook(
    req.body.toString('utf8'),
    req.headers['x-caldera-signature'] as string,
    req.headers['x-caldera-timestamp'] as string,
    'whsec_your_signing_secret',
  );

  if (!isValid) {
    return res.status(401).send('Invalid signature');
  }

  // Process the event
  res.status(200).send('OK');
});

Retry policy

Failed deliveries are retried with exponential backoff: the first attempt plus up to 5 retries, 6 attempts over about an hour.

AttemptDelay after the previous attempt
1Immediate
22 minutes
34 minutes
48 minutes
516 minutes
632 minutes

Each delay varies randomly by up to 20% either way (so retries to one endpoint do not arrive in lockstep), and retries are picked up by a once-a-minute sweep, so a retry can also run up to about a minute later (a little more when a large backlog is waiting). Every attempt of one delivery carries the same X-Caldera-Delivery-Id. While a subscription is paused its pending retries wait, and they resume when it is reactivated (within 24 hours). Fraud and compliance events that are not deliverable are never retried (see Fraud and compliance events).

A delivery is considered failed if your endpoint returns a non-2xx status code (a redirect included: redirects are never followed), cannot be reached, or does not answer within 10 seconds.

The retry sweep serves every organisation in turn: at most 20 of one organisation's deliveries are retried in one run (and at most 20 of one subscription's), so one backlog cannot hold up the others; the rest are retried in the next runs. When your endpoint cannot be reached or times out, that subscription's other retries wait for the next run. Deliveries waiting more than 24 hours (for example while a subscription is paused) are marked failed and are never sent.

After the 6th failed attempt the delivery is marked failed and is not retried again. There is no dead-letter queue to replay from the portal: recover the events you missed with replay (POST /api/v1/event-subscriptions/{id}/replay, SDK events.replay) for the time window, and deduplicate on X-Event-Id.

After 4 failed attempts in a row (retries included) the subscription is marked FAILING. A FAILING subscription is still sent new events: they are queued for the once-a-minute retry sweep (sent within about a minute, not at once) and retried as usual; its next successful delivery makes it ACTIVE again. You can also reactivate it yourself, which starts the failure count again: Reactivate on the portal's Event Subscriptions page, or PATCH /api/v1/event-subscriptions/{id} with {"status": "ACTIVE"}. A paused subscription ({"status": "PAUSED"}, or Pause in the portal) is sent nothing; its queued retries wait and go out when it is reactivated, within the 24-hour limit.

Answer within 10 seconds: a slower answer counts as a failed delivery and is retried. If processing takes longer, accept the webhook (2xx) at once and process it asynchronously.

Payload format

{
  "eventId": "evt_abc123",
  "eventType": "messaging.email.sent",
  "timestamp": 1775399400,
  "data": {
    "messageId": "msg_xyz789",
    "to": "user@example.com",
    "subject": "Order Confirmation",
    "status": "delivered"
  }
}

eventId is the event's id (the same as X-Event-Id) and timestamp is the send time in unix seconds (the same as X-Caldera-Timestamp).

Idempotency

Use X-Event-Id to deduplicate events. The same event may reach you more than once: a retry after your endpoint took the request but did not answer 2xx in time, a send cut off before it was recorded, or a replay. X-Event-Id is the same every time; X-Caldera-Delivery-Id is the same on every attempt of one delivery and new for a replay. Store processed event ids and skip duplicates.