Upsert a document variant of a custom component, keyed on document id.
Upsert a variant (a documents row) of a custom component, keyed on document id. Provide id to update an existing variant; omit it to insert a new one. Also available at /schemas/{schema_name}. The content is validated against the component's schema.
Auth: API key β always required, and the key must carry the content_write permission.
| Param | Type | Required | Notes |
|---|---|---|---|
schema_name | string | yes | The custom component name. |
| Param | Type | Required | Notes |
|---|---|---|---|
websiteId | uuid | no | Target website; falls back to Host header / config. |
api_key | string | no | Alternative to the x-api-key header. |
{
"id": "<uuid>",
"title": "My variant",
"content": { "title": "Hello", "body": "..." }
}
| Field | Type | Required | Notes |
|---|---|---|---|
id | uuid | no | Update the matching variant when present; insert when absent or not found. |
title | string | no | Display title. Defaults to "Untitled" on insert; left unchanged on update when omitted. |
content | object | yes | Field values, validated against the component's schema. Must be a JSON object. |
{
"id": "...",
"schema_name": "post",
"title": "My variant",
"status": "draft",
"version": 2,
"created": true
}
created is true on insert (HTTP 201) and false on update (HTTP 200).
curl -X PATCH '{CMS_API_URL}/dataset/post?websiteId=<uuid>' \
-H 'x-api-key: <key>' \
-H 'Content-Type: application/json' \
-d '{"content":{"title":"Hello"}}'
400 β invalid websiteId, non-object content, unknown or archived component, or validation failure401 β missing or invalid API key403 β key lacks the content_write permission404 β id supplied but no matching variant