POST /api/v1/cms/webhook/
Receive a webhook notification when content is created or updated in the CMS.Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
sourceId | string | Yes | Content source ID (UUID format) |
Headers
| Header | Required | Description |
|---|---|---|
X-Webhook-Signature | Yes | HMAC-SHA256 signature of the raw body |
Request Body
The body format depends on the CMS provider. The platform extracts the external content ID from common fields:id(generic)sys.id(Contentful)_id(Sanity/MongoDB-style)
Behavior
- Verifies the webhook signature against the source’s stored secret
- Extracts the external content ID from the payload
- Fetches the full content item from the CMS via the configured adapter
- Upserts the content item into KaireonAI (creates or increments version)
- If
autoPublishis enabled on the source, the content is published immediately
Response
Error Responses
| Status | Description |
|---|---|
| 400 | Invalid source ID format |
| 401 | Invalid webhook signature |
| 403 | Webhook secret not configured for this source |
| 404 | Content source not found |
Setting Up CMS Webhooks
- Create a content source via
POST /api/v1/content-sourceswith awebhookSecret - Configure your CMS to send webhooks to:
https://your-domain.com/api/v1/cms/webhook/{sourceId} - Set the
X-Webhook-Signatureheader tosha256=<hmac-hex>using the webhook secret