Skip to main content
The CMS Webhook endpoint receives real-time content update notifications from external CMS providers (Contentful, Strapi, Sanity, etc.). Each content source has a unique webhook URL.

POST /api/v1/cms/webhook/

Receive a webhook notification when content is created or updated in the CMS.

Path Parameters

ParameterTypeRequiredDescription
sourceIdstringYesContent source ID (UUID format)

Headers

HeaderRequiredDescription
X-Webhook-SignatureYesHMAC-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

  1. Verifies the webhook signature against the source’s stored secret
  2. Extracts the external content ID from the payload
  3. Fetches the full content item from the CMS via the configured adapter
  4. Upserts the content item into KaireonAI (creates or increments version)
  5. If autoPublish is enabled on the source, the content is published immediately

Response

{ "received": true }

Error Responses

StatusDescription
400Invalid source ID format
401Invalid webhook signature
403Webhook secret not configured for this source
404Content source not found

Setting Up CMS Webhooks

  1. Create a content source via POST /api/v1/content-sources with a webhookSecret
  2. Configure your CMS to send webhooks to: https://your-domain.com/api/v1/cms/webhook/{sourceId}
  3. Set the X-Webhook-Signature header to sha256=<hmac-hex> using the webhook secret