Webhooks

Receive Platica events on your server through a JSON POST. Choose the conversation, message, comment, contact, case, WhatsApp template, AI provider, or WhatsApp Flows events you need. Set a secret to verify each delivery with HMAC-SHA256.

Example

// 1. Create the webhook (Platica verifies the URL with HEAD and activates it right away)
await platic.webhooks.create({
  name: 'CRM',
  url: 'https://example.com/webhooks/platica',
  events: ['message.created', 'case.created'],
  secret: process.env.PLATIC_WEBHOOK_SECRET
});

// 2. In your endpoint, validate the signature before processing
import { parseWebhookEvent } from 'platic-sdk';
const event = await parseWebhookEvent({
  payload: rawBody,
  signature: req.headers['x-webhook-signature'],
  secret: process.env.PLATIC_WEBHOOK_SECRET!
});

What you need to know

  • Automatic verification: when you create a webhook or change its URL, Platica sends a HEAD request (15 s timeout). Any status below 500 activates the webhook (enabled); if it fails, it is saved as draft and you can retry with test a webhook.
  • Credentials as secrets: the signing secret and the headers that carry credentials are stored as secrets (webhook.secret, header:<name>) and are never returned in plain text. If you change url to another domain, you must authorize the credentials again.
  • Statuses and automatic pause: enabled (active), draft (not activated), paused (paused manually or after consecutive failures; configurable with autoPause), and pending_verification.
  • WhatsApp Flows: WhatsApp Flows webhooks need your server's JSON response to continue the flow.

Endpoints

MethodEndpointWhat it does
GET/v1/webhooks/eventsList the available events
GET / POST/v1/webhooksList or create a webhook
GET / PATCH / DELETE/v1/webhooks/{webhookId}View, edit, or delete
POST/v1/webhooks/{webhookId}/secretsBind a secret to a slot
POST/v1/webhooks/{webhookId}/testVerify the destination and reactivate

See Delivery and signatures, Payloads, and the AI tools in Webhooks MCP.