Skip to main content
Content sources connect external CMS platforms (Contentful, Strapi, Sanity, etc.) to KaireonAI. Content is synced via webhooks or manual sync triggers and imported as content items.

GET /api/v1/content-sources

List all content sources for the tenant.

Response

[
  {
    "id": "clx...",
    "name": "Marketing Contentful",
    "provider": "contentful",
    "config": { "spaceId": "abc123", "environment": "master" },
    "syncMode": "webhook",
    "syncIntervalMinutes": null,
    "autoPublish": true,
    "mappings": { "title": "fields.title", "body": "fields.body" },
    "status": "active",
    "lastSyncAt": "2026-03-18T10:00:00.000Z",
    "createdAt": "2026-03-01T00:00:00.000Z"
  }
]

POST /api/v1/content-sources

Create a new content source. Admin only.

Request Body

FieldTypeRequiredDescription
namestringYesSource name
providerstringYesCMS provider (e.g., contentful, strapi, sanity, wordpress)
configobjectNoProvider-specific configuration
syncModestringNoSync mode: webhook or poll (default: webhook)
syncIntervalMinutesnumberNoPoll interval in minutes (for poll mode)
autoPublishbooleanNoAuto-publish synced content (default: false)
mappingsobjectNoField mappings from CMS schema to content item fields

Example

curl -X POST https://playground.kaireonai.com/api/v1/content-sources \
  -H "Content-Type: application/json" \
  -H "X-Tenant-Id: my-tenant" \
  -d '{
    "name": "Blog CMS",
    "provider": "contentful",
    "config": { "spaceId": "abc123", "accessToken": "..." },
    "syncMode": "webhook",
    "autoPublish": false,
    "mappings": { "title": "fields.title", "body": "fields.body" }
  }'

Response (201)

Returns the created content source object.

GET /api/v1/content-sources/

Get a single content source by ID.

PUT /api/v1/content-sources/

Update a content source. Admin only.

Request Body

Same fields as POST, all optional.

DELETE /api/v1/content-sources/

Delete a content source. Admin only.

Response

204 No Content on success.

POST /api/v1/content-sources//sync

Trigger a manual sync from the content source. Fetches all content items from the CMS and upserts them as content items. Editor or Admin. Sync operations have a 120-second timeout and are capped at 5,000 items per sync.

Response

{
  "synced": 47,
  "source": "clx..."
}
If the sync exceeds the timeout:
{
  "error": {
    "code": "TIMEOUT",
    "message": "Content source sync timed out",
    "status": 504
  }
}