EN IT

Preview Content (V1)

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

Base URL: https://api.contit.cloud

POST /preview-contents/{contentTypeKey}/ids

Get preview content IDs only

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

Requires ReadAccess policy

Path Parameters

NameTypeRequiredDescription
contentTypeKey string ✓ The content type key

Request Body application/json

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

Responses

200 Success
ids string[] Array of content item IDs
total integer Total matching items
401 Unauthorized

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
}'
using var http = new HttpClient();
http.DefaultRequestHeaders.Add("X-Api-Key", "YOUR_API_KEY");

var content = new StringContent("{
  \"filter\": \"filter_value\",
  \"page\": 1,
  \"pageSize\": 1
}",
    Encoding.UTF8, "application/json");
var response = await http.PostAsync(
    "https://api.contit.cloud/preview-contents/{contentTypeKey}/ids", content);

response.EnsureSuccessStatusCode();
var json = await response.Content.ReadAsStringAsync();
const response = await fetch(
  "https://api.contit.cloud/preview-contents/{contentTypeKey}/ids",
  {
    method: "POST",
    headers: {
      "X-Api-Key": "YOUR_API_KEY",
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
  "filter": "filter_value",
  "page": 1,
  "pageSize": 1
})
  }
);

const data = await response.json();
import requests

headers = {"X-Api-Key": "YOUR_API_KEY"}
payload = {
  "filter": "filter_value",
  "page": 1,
  "pageSize": 1
}

response = requests.post(
    "https://api.contit.cloud/preview-contents/{contentTypeKey}/ids",
    json=payload,
    headers=headers
)

data = response.json()
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 ReadAccess policy

Path Parameters

NameTypeRequiredDescription
contentTypeKey string ✓ The content type key
id string ✓ The content item ID (GUID)

Responses

200 Success
id string Content item ID
contentType string Content type key
fields ContentField[] Array of typed fields
401 Unauthorized
404 Not Found

Code examples

curl -X GET "https://api.contit.cloud/preview-contents/{contentTypeKey}/{id}" \
  -H "X-Api-Key: YOUR_API_KEY"
using var http = new HttpClient();
http.DefaultRequestHeaders.Add("X-Api-Key", "YOUR_API_KEY");

var response = await http.GetAsync("https://api.contit.cloud/preview-contents/{contentTypeKey}/{id}");

response.EnsureSuccessStatusCode();
var json = await response.Content.ReadAsStringAsync();
const response = await fetch(
  "https://api.contit.cloud/preview-contents/{contentTypeKey}/{id}",
  {
    method: "GET",
    headers: {
      "X-Api-Key": "YOUR_API_KEY",
    }
  }
);

const data = await response.json();
import requests

headers = {"X-Api-Key": "YOUR_API_KEY"}

response = requests.get(
    "https://api.contit.cloud/preview-contents/{contentTypeKey}/{id}",
    headers=headers
)

data = response.json()
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 ReadAccess policy

Path Parameters

NameTypeRequiredDescription
contentTypeKey string ✓ The content type key
id string ✓ The content item ID (GUID)

Request Body application/json

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

Responses

200 Success
id string Content item ID
contentType string Content type key
fields ContentField[] Array of typed fields with relations expanded
401 Unauthorized
404 Not 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": []
}'
using var http = new HttpClient();
http.DefaultRequestHeaders.Add("X-Api-Key", "YOUR_API_KEY");

var content = new StringContent("{
  \"locale\": \"locale_value\",
  \"includeRelations\": []
}",
    Encoding.UTF8, "application/json");
var response = await http.PostAsync(
    "https://api.contit.cloud/preview-contents/{contentTypeKey}/{id}", content);

response.EnsureSuccessStatusCode();
var json = await response.Content.ReadAsStringAsync();
const response = await fetch(
  "https://api.contit.cloud/preview-contents/{contentTypeKey}/{id}",
  {
    method: "POST",
    headers: {
      "X-Api-Key": "YOUR_API_KEY",
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
  "locale": "locale_value",
  "includeRelations": []
})
  }
);

const data = await response.json();
import requests

headers = {"X-Api-Key": "YOUR_API_KEY"}
payload = {
  "locale": "locale_value",
  "includeRelations": []
}

response = requests.post(
    "https://api.contit.cloud/preview-contents/{contentTypeKey}/{id}",
    json=payload,
    headers=headers
)

data = response.json()
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 ReadAccess policy

Path Parameters

NameTypeRequiredDescription
contentTypeKey string ✓ The 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

200 Success
value decimal Computed aggregate value
401 Unauthorized

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"
}'
using var http = new HttpClient();
http.DefaultRequestHeaders.Add("X-Api-Key", "YOUR_API_KEY");

var content = new StringContent("{
  \"fieldKey\": \"fieldKey_value\",
  \"aggregateType\": \"aggregateType_value\",
  \"filter\": \"filter_value\"
}",
    Encoding.UTF8, "application/json");
var response = await http.PostAsync(
    "https://api.contit.cloud/preview-contents/{contentTypeKey}/aggregate", content);

response.EnsureSuccessStatusCode();
var json = await response.Content.ReadAsStringAsync();
const response = await fetch(
  "https://api.contit.cloud/preview-contents/{contentTypeKey}/aggregate",
  {
    method: "POST",
    headers: {
      "X-Api-Key": "YOUR_API_KEY",
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
  "fieldKey": "fieldKey_value",
  "aggregateType": "aggregateType_value",
  "filter": "filter_value"
})
  }
);

const data = await response.json();
import requests

headers = {"X-Api-Key": "YOUR_API_KEY"}
payload = {
  "fieldKey": "fieldKey_value",
  "aggregateType": "aggregateType_value",
  "filter": "filter_value"
}

response = requests.post(
    "https://api.contit.cloud/preview-contents/{contentTypeKey}/aggregate",
    json=payload,
    headers=headers
)

data = response.json()
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 ReadAccess policy

Path Parameters

NameTypeRequiredDescription
contentTypeKey string ✓ The 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

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

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"
}'
using var http = new HttpClient();
http.DefaultRequestHeaders.Add("X-Api-Key", "YOUR_API_KEY");

var content = new StringContent("{
  \"fieldKey\": \"fieldKey_value\",
  \"aggregateType\": \"aggregateType_value\",
  \"groupByFieldKey\": \"groupByFieldKey_value\",
  \"filter\": \"filter_value\"
}",
    Encoding.UTF8, "application/json");
var response = await http.PostAsync(
    "https://api.contit.cloud/preview-contents/{contentTypeKey}/aggregategroup", content);

response.EnsureSuccessStatusCode();
var json = await response.Content.ReadAsStringAsync();
const response = await fetch(
  "https://api.contit.cloud/preview-contents/{contentTypeKey}/aggregategroup",
  {
    method: "POST",
    headers: {
      "X-Api-Key": "YOUR_API_KEY",
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
  "fieldKey": "fieldKey_value",
  "aggregateType": "aggregateType_value",
  "groupByFieldKey": "groupByFieldKey_value",
  "filter": "filter_value"
})
  }
);

const data = await response.json();
import requests

headers = {"X-Api-Key": "YOUR_API_KEY"}
payload = {
  "fieldKey": "fieldKey_value",
  "aggregateType": "aggregateType_value",
  "groupByFieldKey": "groupByFieldKey_value",
  "filter": "filter_value"
}

response = requests.post(
    "https://api.contit.cloud/preview-contents/{contentTypeKey}/aggregategroup",
    json=payload,
    headers=headers
)

data = response.json()
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 WriteAccess policy

Path Parameters

NameTypeRequiredDescription
contentTypeKey string ✓ The 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

200 Success
id string Content item ID
contentType string Content type key
fields ContentField[] Typed fields
401 Unauthorized

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"
}'
using var http = new HttpClient();
http.DefaultRequestHeaders.Add("X-Api-Key", "YOUR_API_KEY");

var content = new StringContent("{
  \"id\": \"id_value\",
  \"contentType\": \"contentType_value\",
  \"fields\": [],
  \"clientInfo\": \"clientInfo_value\"
}",
    Encoding.UTF8, "application/json");
var response = await http.PutAsync(
    "https://api.contit.cloud/preview-contents/{contentTypeKey}", content);

response.EnsureSuccessStatusCode();
var json = await response.Content.ReadAsStringAsync();
const response = await fetch(
  "https://api.contit.cloud/preview-contents/{contentTypeKey}",
  {
    method: "PUT",
    headers: {
      "X-Api-Key": "YOUR_API_KEY",
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
  "id": "id_value",
  "contentType": "contentType_value",
  "fields": [],
  "clientInfo": "clientInfo_value"
})
  }
);

const data = await response.json();
import requests

headers = {"X-Api-Key": "YOUR_API_KEY"}
payload = {
  "id": "id_value",
  "contentType": "contentType_value",
  "fields": [],
  "clientInfo": "clientInfo_value"
}

response = requests.put(
    "https://api.contit.cloud/preview-contents/{contentTypeKey}",
    json=payload,
    headers=headers
)

data = response.json()
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 WriteAccess policy

Path Parameters

NameTypeRequiredDescription
contentTypeKey string ✓ The content type key
id string ✓ The content item ID (GUID)

Responses

200 Success — content deleted
401 Unauthorized
404 Not Found

Code examples

curl -X DELETE "https://api.contit.cloud/preview-contents/{contentTypeKey}/{id}" \
  -H "X-Api-Key: YOUR_API_KEY"
using var http = new HttpClient();
http.DefaultRequestHeaders.Add("X-Api-Key", "YOUR_API_KEY");

var content = new StringContent("{}",
    Encoding.UTF8, "application/json");
var response = await http.DeleteAsync(
    "https://api.contit.cloud/preview-contents/{contentTypeKey}/{id}", content);

response.EnsureSuccessStatusCode();
var json = await response.Content.ReadAsStringAsync();
const response = await fetch(
  "https://api.contit.cloud/preview-contents/{contentTypeKey}/{id}",
  {
    method: "DELETE",
    headers: {
      "X-Api-Key": "YOUR_API_KEY",
    }
  }
);

const data = await response.json();
import requests

headers = {"X-Api-Key": "YOUR_API_KEY"}

response = requests.delete(
    "https://api.contit.cloud/preview-contents/{contentTypeKey}/{id}",
    headers=headers
)

data = response.json()
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 WriteAccess policy

Path Parameters

NameTypeRequiredDescription
contentTypeKey string ✓ The content type key
id string ✓ The content item ID (GUID)

Request Body application/json

PropertyTypeRequiredDescription
clientInfo string — Optional client identifier for audit logging

Responses

200 Success — content published
401 Unauthorized
404 Not 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"
}'
using var http = new HttpClient();
http.DefaultRequestHeaders.Add("X-Api-Key", "YOUR_API_KEY");

var content = new StringContent("{
  \"clientInfo\": \"clientInfo_value\"
}",
    Encoding.UTF8, "application/json");
var response = await http.PutAsync(
    "https://api.contit.cloud/preview-contents/{contentTypeKey}/{id}/publish", content);

response.EnsureSuccessStatusCode();
var json = await response.Content.ReadAsStringAsync();
const response = await fetch(
  "https://api.contit.cloud/preview-contents/{contentTypeKey}/{id}/publish",
  {
    method: "PUT",
    headers: {
      "X-Api-Key": "YOUR_API_KEY",
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
  "clientInfo": "clientInfo_value"
})
  }
);

const data = await response.json();
import requests

headers = {"X-Api-Key": "YOUR_API_KEY"}
payload = {
  "clientInfo": "clientInfo_value"
}

response = requests.put(
    "https://api.contit.cloud/preview-contents/{contentTypeKey}/{id}/publish",
    json=payload,
    headers=headers
)

data = response.json()
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 WriteAccess policy

Path Parameters

NameTypeRequiredDescription
contentTypeKey string ✓ The content type key
id string ✓ The content item ID (GUID)

Request Body application/json

PropertyTypeRequiredDescription
clientInfo string — Optional client identifier for audit logging

Responses

200 Success — content unpublished
401 Unauthorized
404 Not 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"
}'
using var http = new HttpClient();
http.DefaultRequestHeaders.Add("X-Api-Key", "YOUR_API_KEY");

var content = new StringContent("{
  \"clientInfo\": \"clientInfo_value\"
}",
    Encoding.UTF8, "application/json");
var response = await http.PutAsync(
    "https://api.contit.cloud/preview-contents/{contentTypeKey}/{id}/unpublish", content);

response.EnsureSuccessStatusCode();
var json = await response.Content.ReadAsStringAsync();
const response = await fetch(
  "https://api.contit.cloud/preview-contents/{contentTypeKey}/{id}/unpublish",
  {
    method: "PUT",
    headers: {
      "X-Api-Key": "YOUR_API_KEY",
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
  "clientInfo": "clientInfo_value"
})
  }
);

const data = await response.json();
import requests

headers = {"X-Api-Key": "YOUR_API_KEY"}
payload = {
  "clientInfo": "clientInfo_value"
}

response = requests.put(
    "https://api.contit.cloud/preview-contents/{contentTypeKey}/{id}/unpublish",
    json=payload,
    headers=headers
)

data = response.json()
Example Request
{
  "clientInfo": "cms-editor"
}
Example Response 200
{
  "success": true
}
Try it Live