API reference

Preview Content (V1)

API referencehttps://api.contit.cloud

Preview Content (V1)

Draft/preview content endpoints using the V1 typed-field model. Includes all search, get, and aggregate operations plus publish/unpublish actions.

POST /preview-contents/{contentTypeKey}/ids

Get preview content IDs only

Returns only the IDs of matching draft/preview content items.

Requires the ReadAccess policy

Path parameters

NameTypeRequiredDescription
contentTypeKeystringThe content type key

Request body application/json

PropertyTypeRequiredDescription
filter object — Filter tree
page integer — Page number
pageSize integer — Items per page

Responses

200Success
idsstring[]Array of content item IDs
totalintegerTotal matching items
401Unauthorized

Code examples

curl -X POST "https://api.contit.cloud/preview-contents/{contentTypeKey}/ids" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "filter": "filter_value",
  "page": 1,
  "pageSize": 1
}'
Example request
{
  "filter": null,
  "page": 1,
  "pageSize": 100
}
Example response 200
{
  "ids": [
    "d4e5f6a7-b8c9-0123-defg-456789012345"
  ],
  "total": 1
}
Try it Live
GET /preview-contents/{contentTypeKey}/{id}

Get single preview content

Retrieve a single draft/preview content item by its ID.

Requires the ReadAccess policy

Path parameters

NameTypeRequiredDescription
contentTypeKeystringThe content type key
idstringThe content item ID (GUID)

Responses

200Success
idstringContent item ID
contentTypestringContent type key
fieldsContentField[]Array of typed fields
401Unauthorized
404Not Found

Code examples

curl -X GET "https://api.contit.cloud/preview-contents/{contentTypeKey}/{id}" \
  -H "X-Api-Key: YOUR_API_KEY"
Example response 200
{
  "id": "d4e5f6a7-b8c9-0123-defg-456789012345",
  "contentType": "Article",
  "fields": [
    { "type": "Text", "key": "title", "value": "Draft Post" },
    { "type": "RichText", "key": "body", "value": "<p>Work in progress...</p>" }
  ],
  "createdAt": "2026-03-18T11:00:00Z",
  "updatedAt": "2026-03-18T15:30:00Z"
}
Try it Live
POST /preview-contents/{contentTypeKey}/{id}

Get preview content with relations

Retrieve a draft/preview content item with expanded relations and locale.

Requires the ReadAccess policy

Path parameters

NameTypeRequiredDescription
contentTypeKeystringThe content type key
idstringThe content item ID (GUID)

Request body application/json

PropertyTypeRequiredDescription
locale string — Locale code
includeRelations string[] — Relation field keys to expand

Responses

200Success
idstringContent item ID
contentTypestringContent type key
fieldsContentField[]Array of typed fields with relations expanded
401Unauthorized
404Not Found

Code examples

curl -X POST "https://api.contit.cloud/preview-contents/{contentTypeKey}/{id}" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "locale": "locale_value",
  "includeRelations": []
}'
Example request
{
  "locale": "en",
  "includeRelations": ["category"]
}
Example response 200
{
  "id": "d4e5f6a7-b8c9-0123-defg-456789012345",
  "contentType": "Article",
  "fields": [
    { "type": "Text", "key": "title", "value": "Draft Post" },
    { "type": "Relation", "key": "category", "value": { "id": "e5f6a7b8-c9d0-1234-efgh-567890123456", "contentType": "Category", "fields": [{ "type": "Text", "key": "name", "value": "Technology" }] } }
  ],
  "createdAt": "2026-03-18T11:00:00Z",
  "updatedAt": "2026-03-18T15:30:00Z"
}
Try it Live
POST /preview-contents/{contentTypeKey}/aggregate

Aggregate preview content field values

Compute an aggregate on a field across matching draft/preview content items.

Requires the ReadAccess policy

Path parameters

NameTypeRequiredDescription
contentTypeKeystringThe content type key

Request body application/json

PropertyTypeRequiredDescription
fieldKey string The field key to aggregate on
aggregateType string Sum, Avg, Min, Max, or Count
filter object — Optional filter

Responses

200Success
valuedecimalComputed aggregate value
401Unauthorized

Code examples

curl -X POST "https://api.contit.cloud/preview-contents/{contentTypeKey}/aggregate" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "fieldKey": "fieldKey_value",
  "aggregateType": "aggregateType_value",
  "filter": "filter_value"
}'
Example request
{
  "type": "condition",
            "fieldKey": "wordCount",
  "aggregateType": "Sum",
  "filter": null
}
Example response 200
{
  "value": 15420
}
Try it Live
POST /preview-contents/{contentTypeKey}/aggregategroup

Grouped aggregation on preview content

Compute an aggregate grouped by a field across matching draft/preview content items.

Requires the ReadAccess policy

Path parameters

NameTypeRequiredDescription
contentTypeKeystringThe content type key

Request body application/json

PropertyTypeRequiredDescription
fieldKey string The field key to aggregate on
aggregateType string Sum, Avg, Min, Max, or Count
groupByFieldKey string The field key to group by
filter object — Optional filter

Responses

200Success
itemsAggregateGroupItem[]Array of group-value / aggregate-value pairs
401Unauthorized

Code examples

curl -X POST "https://api.contit.cloud/preview-contents/{contentTypeKey}/aggregategroup" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "fieldKey": "fieldKey_value",
  "aggregateType": "aggregateType_value",
  "groupByFieldKey": "groupByFieldKey_value",
  "filter": "filter_value"
}'
Example request
{
  "type": "condition",
            "fieldKey": "wordCount",
  "aggregateType": "Avg",
  "groupByFieldKey": "author",
  "filter": null
}
Example response 200
{
  "items": [
    { "groupValue": "Marco Rossi", "aggregateValue": 1250.5 },
    { "groupValue": "Anna Bianchi", "aggregateValue": 980.0 }
  ]
}
Try it Live
PUT /preview-contents/{contentTypeKey}

Create or update preview content

Create a new draft content item or update an existing one.

Requires the WriteAccess policy

Path parameters

NameTypeRequiredDescription
contentTypeKeystringThe content type key

Request body application/json

PropertyTypeRequiredDescription
id string — Content item ID. Null to create.
contentType string Content type key
fields ContentField[] Array of typed fields
clientInfo string — Optional client identifier

Responses

200Success
idstringContent item ID
contentTypestringContent type key
fieldsContentField[]Typed fields
401Unauthorized

Code examples

curl -X PUT "https://api.contit.cloud/preview-contents/{contentTypeKey}" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "id": "id_value",
  "contentType": "contentType_value",
  "fields": [],
  "clientInfo": "clientInfo_value"
}'
Example request
{
  "id": null,
  "contentType": "Article",
  "fields": [
    { "type": "Text", "key": "title", "value": "My Draft" },
    { "type": "RichText", "key": "body", "value": "<p>Work in progress</p>" }
  ],
  "clientInfo": "cms-editor"
}
Example response 200
{
  "id": "f1a2b3c4-d5e6-7890-abcd-ef1234567890",
  "contentType": "Article",
  "fields": [
    { "type": "Text", "key": "title", "value": "My Draft" },
    { "type": "RichText", "key": "body", "value": "<p>Work in progress</p>" }
  ],
  "createdAt": "2026-03-20T14:00:00Z",
  "updatedAt": "2026-03-20T14:00:00Z"
}
Try it Live
DELETE /preview-contents/{contentTypeKey}/{id}

Delete preview content

Permanently delete a draft/preview content item.

Requires the WriteAccess policy

Path parameters

NameTypeRequiredDescription
contentTypeKeystringThe content type key
idstringThe content item ID (GUID)

Responses

200Success — content deleted
401Unauthorized
404Not Found

Code examples

curl -X DELETE "https://api.contit.cloud/preview-contents/{contentTypeKey}/{id}" \
  -H "X-Api-Key: YOUR_API_KEY"
Example response 200
{
  "success": true
}
Try it Live
PUT /preview-contents/{contentTypeKey}/{id}/publish

Publish draft content

Publish a draft/preview content item, making it available via the published content endpoints.

Requires the WriteAccess policy

Path parameters

NameTypeRequiredDescription
contentTypeKeystringThe content type key
idstringThe content item ID (GUID)

Request body application/json

PropertyTypeRequiredDescription
clientInfo string — Optional client identifier for audit logging

Responses

200Success — content published
401Unauthorized
404Not Found

Code examples

curl -X PUT "https://api.contit.cloud/preview-contents/{contentTypeKey}/{id}/publish" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "clientInfo": "clientInfo_value"
}'
Example request
{
  "clientInfo": "cms-editor"
}
Example response 200
{
  "success": true
}
Try it Live
PUT /preview-contents/{contentTypeKey}/{id}/unpublish

Unpublish content

Unpublish a content item, reverting it to draft-only status and removing it from published content endpoints.

Requires the WriteAccess policy

Path parameters

NameTypeRequiredDescription
contentTypeKeystringThe content type key
idstringThe content item ID (GUID)

Request body application/json

PropertyTypeRequiredDescription
clientInfo string — Optional client identifier for audit logging

Responses

200Success — content unpublished
401Unauthorized
404Not Found

Code examples

curl -X PUT "https://api.contit.cloud/preview-contents/{contentTypeKey}/{id}/unpublish" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "clientInfo": "clientInfo_value"
}'
Example request
{
  "clientInfo": "cms-editor"
}
Example response 200
{
  "success": true
}
Try it Live