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.

Richiede la policy ReadAccess

Parametri del percorso

NomeTipoObbligatorioDescrizione
contentTypeKeystringThe content type key

Corpo della richiesta application/json

ProprietàTipoObbligatorioDescrizione
filter object — Filter tree
page integer — Page number
pageSize integer — Items per page

Risposte

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

Esempi di codice

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
}'
Esempio di richiesta
{
  "filter": null,
  "page": 1,
  "pageSize": 100
}
Esempio di risposta 200
{
  "ids": [
    "d4e5f6a7-b8c9-0123-defg-456789012345"
  ],
  "total": 1
}
Prova Live
GET /preview-contents/{contentTypeKey}/{id}

Get single preview content

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

Richiede la policy ReadAccess

Parametri del percorso

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

Risposte

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

Esempi di codice

curl -X GET "https://api.contit.cloud/preview-contents/{contentTypeKey}/{id}" \
  -H "X-Api-Key: YOUR_API_KEY"
Esempio di risposta 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"
}
Prova Live
POST /preview-contents/{contentTypeKey}/{id}

Get preview content with relations

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

Richiede la policy ReadAccess

Parametri del percorso

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

Corpo della richiesta application/json

ProprietàTipoObbligatorioDescrizione
locale string — Locale code
includeRelations string[] — Relation field keys to expand

Risposte

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

Esempi di codice

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": []
}'
Esempio di richiesta
{
  "locale": "en",
  "includeRelations": ["category"]
}
Esempio di risposta 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"
}
Prova Live
POST /preview-contents/{contentTypeKey}/aggregate

Aggregate preview content field values

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

Richiede la policy ReadAccess

Parametri del percorso

NomeTipoObbligatorioDescrizione
contentTypeKeystringThe content type key

Corpo della richiesta application/json

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

Risposte

200Success
valuedecimalComputed aggregate value
401Unauthorized

Esempi di codice

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"
}'
Esempio di richiesta
{
  "type": "condition",
            "fieldKey": "wordCount",
  "aggregateType": "Sum",
  "filter": null
}
Esempio di risposta 200
{
  "value": 15420
}
Prova Live
POST /preview-contents/{contentTypeKey}/aggregategroup

Grouped aggregation on preview content

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

Richiede la policy ReadAccess

Parametri del percorso

NomeTipoObbligatorioDescrizione
contentTypeKeystringThe content type key

Corpo della richiesta application/json

ProprietàTipoObbligatorioDescrizione
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

Risposte

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

Esempi di codice

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"
}'
Esempio di richiesta
{
  "type": "condition",
            "fieldKey": "wordCount",
  "aggregateType": "Avg",
  "groupByFieldKey": "author",
  "filter": null
}
Esempio di risposta 200
{
  "items": [
    { "groupValue": "Marco Rossi", "aggregateValue": 1250.5 },
    { "groupValue": "Anna Bianchi", "aggregateValue": 980.0 }
  ]
}
Prova Live
PUT /preview-contents/{contentTypeKey}

Create or update preview content

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

Richiede la policy WriteAccess

Parametri del percorso

NomeTipoObbligatorioDescrizione
contentTypeKeystringThe content type key

Corpo della richiesta application/json

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

Risposte

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

Esempi di codice

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"
}'
Esempio di richiesta
{
  "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"
}
Esempio di risposta 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"
}
Prova Live
DELETE /preview-contents/{contentTypeKey}/{id}

Delete preview content

Permanently delete a draft/preview content item.

Richiede la policy WriteAccess

Parametri del percorso

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

Risposte

200Success — content deleted
401Unauthorized
404Not Found

Esempi di codice

curl -X DELETE "https://api.contit.cloud/preview-contents/{contentTypeKey}/{id}" \
  -H "X-Api-Key: YOUR_API_KEY"
Esempio di risposta 200
{
  "success": true
}
Prova Live
PUT /preview-contents/{contentTypeKey}/{id}/publish

Publish draft content

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

Richiede la policy WriteAccess

Parametri del percorso

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

Corpo della richiesta application/json

ProprietàTipoObbligatorioDescrizione
clientInfo string — Optional client identifier for audit logging

Risposte

200Success — content published
401Unauthorized
404Not Found

Esempi di codice

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"
}'
Esempio di richiesta
{
  "clientInfo": "cms-editor"
}
Esempio di risposta 200
{
  "success": true
}
Prova 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.

Richiede la policy WriteAccess

Parametri del percorso

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

Corpo della richiesta application/json

ProprietàTipoObbligatorioDescrizione
clientInfo string — Optional client identifier for audit logging

Risposte

200Success — content unpublished
401Unauthorized
404Not Found

Esempi di codice

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"
}'
Esempio di richiesta
{
  "clientInfo": "cms-editor"
}
Esempio di risposta 200
{
  "success": true
}
Prova Live