Delivery and signatures

Platica delivers webhooks through POST with Content-Type: application/json. If you configure a secret, it includes an HMAC-SHA256 signature to verify that the event comes from Platica.

Envelope

Events for conversations, messages, comments, contacts, ads, and WhatsApp Flows arrive with this envelope:

{
  "id": "9f8c...",
  "event": "conversation.created",
  "workspaceId": "ws_456",
  "timestamp": "2026-05-06T19:00:00.000Z",
  "source": "system.conversation.created",
  "resourceType": "conversation",
  "resourceId": "conv_123",
  "changes": null,
  "data": {}
}
FieldDescription
idUnique identifier of the event
eventName of the event received
workspaceIdWorkspace where it happened
timestampISO-8601 date of the event
sourceOrigin of the event, in the format <origin>.<resource>.<action> — see The source field
resourceTypeconversation, message, comment, client, or flow_response
resourceIdID of the affected resource
changesDiff of the change, when it applies
dataNormalized snapshot of the resource

See List events for the 29 available events and Payloads for the content of data and the possible values of source.

Headers

HeaderDescription
Content-Typeapplication/json
User-AgentPlatica's User-Agent
X-Webhook-EventSame as payload.event
X-Webhook-IdIdentifier of the configured webhook
X-Webhook-Event-IdSame as payload.id
X-Webhook-Resource-TypeType of the affected resource
X-Webhook-Resource-IdID of the affected resource
X-Webhook-TimestampSame as payload.timestamp
X-Webhook-Signaturesha256=<hex> if you configured secret

Validate the signature

The signature is computed with HMAC-SHA256 over the raw body (rawBody) that your endpoint received:

sha256=<hmac_sha256(secret, rawBody)>

Use the SDK helper parseWebhookEvent to validate the signature and get a typed event. A missing or mismatched signature throws WebhookVerificationError:

import { parseWebhookEvent, WebhookVerificationError } from 'platic-sdk';

async function receiveWebhook(request: Request): Promise<Response> {
  try {
    const event = await parseWebhookEvent({
      payload: await request.text(), // the raw body, not the already parsed JSON
      signature: request.headers.get('x-webhook-signature'),
      secret: process.env.PLATIC_WEBHOOK_SECRET!
    });
    console.log(event.event, event.id);
    return new Response(null, { status: 200 });
  } catch (error) {
    if (error instanceof WebhookVerificationError) return new Response(null, { status: 401 });
    throw error;
  }
}

Without the SDK, in Node.js:

const crypto = require('crypto');

function verifyWebhook(secret, rawBody, signatureHeader) {
  const expected = Buffer.from(
    'sha256=' + crypto.createHmac('sha256', secret).update(rawBody).digest('hex')
  );
  const received = Buffer.from(signatureHeader || '');

  // timingSafeEqual throws an error if the sizes are different.
  return received.length === expected.length && crypto.timingSafeEqual(expected, received);
}

The signature does not include a date and cannot prevent replay of a captured delivery. An event may also arrive more than once. Store its id and discard duplicates.

Responses and retries

Respond with 2xx after processing the event. For conversation, message, comment, contact, and ad events, Platica uses the status to confirm receipt and ignores the response body.

Platica makes one delivery attempt per event and does not retry a failed one. Each failure counts toward the automatic pause. If your server was down, use the API to fetch what changed in the meantime.

Automatic pause

A delivery fails if your server returns 5xx, takes more than 15 seconds, or cannot be reached. A 4xx response counts as delivered. If failures continue, Platica automatically pauses the webhook.

autoPause decides when. You send it when you create or update the webhook, and every read returns it.

autoPauseWhen it pauses
{ "mode": "failures", "failures": 5 }After failures consecutive failed deliveries, from 5 to 1000. It is the default: a webhook that chose nothing reads like this
{ "mode": "time", "hours": 24 }It keeps sending events and pauses when it has been failing for hours hours without a single successful delivery, from 1 to 168 (7 days). It also has to add up at least 5 consecutive failed deliveries
{
  "autoPause": { "mode": "time", "hours": 24 }
}

Use failures with mode "failures" and hours with "time". Automatic pause is required: it allows at most 7 days of failures.

How failures are counted:

  • consecutiveFailures adds one for every failed delivery and goes back to 0 with the first successful one.
  • failingSince is the date of the first failed delivery of the streak. It is null while deliveries go out fine.
  • Changing autoPause does not reset the count. If you choose a lower number of failures than the webhook already has, it pauses with the next failed delivery.
  • Responses to WhatsApp Flows requests do not count.

When it pauses:

  • It stops receiving events, with active: false and status: "paused".
  • The workspace owners and admins get a notice in Platica and by email, with the reason: after how many consecutive failed deliveries, or how many hours it had been failing.
  • To reactivate it, fix your server and use test a webhook or update the webhook with active: true. Platica verifies the destination and the count goes back to 0.
  • Editing other fields of a webhook that paused itself does not reactivate it.