---
docId: doc_b198bfafd8b14310bf3347ad57060bbc
title: Webhooks
description: "Receive Platica events on your server through webhooks."
---

<script>
  import { Ways } from '$lib/components';
</script>

# 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

<Ways tabs="api,sdk">
<Ways.Way name="api">

```bash
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"
  }'
```

</Ways.Way>
<Ways.Way name="sdk">

```ts
// 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!
});
```

</Ways.Way>
</Ways>

## 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](/api-reference/webhooks/test).
- **Credentials as secrets:** the signing `secret` and the headers that carry credentials are stored as [secrets](/api-reference/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](/api-reference/webhooks/whatsapp-flows) webhooks need your server's JSON response to continue the flow.

## Endpoints

| Method | Endpoint | What it does |
|--------|----------|--------------|
| `GET` | [`/v1/webhooks/events`](/api-reference/webhooks/events) | List the available events |
| `GET` / `POST` | [`/v1/webhooks`](/api-reference/webhooks/list) | List or [create](/api-reference/webhooks/create) a webhook |
| `GET` / `PATCH` / `DELETE` | [`/v1/webhooks/{webhookId}`](/api-reference/webhooks/get) | View, [edit](/api-reference/webhooks/update), or [delete](/api-reference/webhooks/delete) |
| `POST` | [`/v1/webhooks/{webhookId}/secrets`](/api-reference/webhooks/bind-secrets) | Bind a secret to a slot |
| `POST` | [`/v1/webhooks/{webhookId}/test`](/api-reference/webhooks/test) | Verify the destination and reactivate |

See [Delivery and signatures](/api-reference/webhooks/signatures), [Payloads](/api-reference/webhooks/payloads), and the AI tools in [Webhooks MCP](/mcp/tools#webhooks).
