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
curl -X POST https://api.platic.ai/v1/webhooks \
-H "Authorization: Bearer $PLATIC_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "CRM",
"url": "https://example.com/webhooks/platica",
"events": ["message.created", "case.created"],
"secret": "my-signing-secret"
}' // 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
HEADrequest (15 s timeout). Any status below500activates the webhook (enabled); if it fails, it is saved asdraftand you can retry with test a webhook. - Credentials as secrets: the signing
secretand the headers that carry credentials are stored as secrets (webhook.secret,header:<name>) and are never returned in plain text. If you changeurlto 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 withautoPause), andpending_verification. - WhatsApp Flows: WhatsApp Flows webhooks need your server's JSON response to continue the flow.
Endpoints
| Method | Endpoint | What it does |
|---|---|---|
GET | /v1/webhooks/events | List the available events |
GET / POST | /v1/webhooks | List or create a webhook |
GET / PATCH / DELETE | /v1/webhooks/{webhookId} | View, edit, or delete |
POST | /v1/webhooks/{webhookId}/secrets | Bind a secret to a slot |
POST | /v1/webhooks/{webhookId}/test | Verify the destination and reactivate |
See Delivery and signatures, Payloads, and the AI tools in Webhooks MCP.