API reference

Content (V1)

API referencehttps://api.contit.cloud

Content (V1)

Endpoints for searching, reading, creating, updating, and deleting content items using the V1 field model (fields as typed array).

POST /contents/{contentTypeKey}/ids

Get content IDs only

Returns only the IDs of matching content items, useful for bulk operations or cross-referencing without loading full content.

Requires the ReadAccess policy

Path parameters

NameTypeRequiredDescription
contentTypeKeystringThe content type key (e.g. 'Product', 'Article')

Request body application/json

PropertyTypeRequiredDescription
filter object — Filter tree to restrict results
page integer — Page number (1-based)
pageSize integer — Number of items per page

Responses

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

Code examples

curl -X POST "https://api.contit.cloud/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": {
    "type": "and",
    "conditions": [
      { "type": "condition", "fieldKey": "status", "operator": "e", "value": "published" }
    ]
  },
  "page": 1,
  "pageSize": 100
}
Example response 200
{
  "ids": [
    "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "b2c3d4e5-f6a7-8901-bcde-f12345678901",
    "c3d4e5f6-a7b8-9012-cdef-123456789012"
  ],
  "total": 3
}
Try it Live
GET /contents/{contentTypeKey}/{id}

Get single content

Retrieve a single 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
createdAtdatetimeCreation timestamp
updatedAtdatetimeLast update timestamp
401Unauthorized
404Not Found — content item does not exist

Code examples

curl -X GET "https://api.contit.cloud/contents/{contentTypeKey}/{id}" \
  -H "X-Api-Key: YOUR_API_KEY"
Example response 200
{
  "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "contentType": "Article",
  "fields": [
    { "type": "Text", "key": "title", "value": "Hello World" },
    { "type": "RichText", "key": "body", "value": "<p>Welcome to Contit.</p>" },
    { "type": "DateTime", "key": "publishDate", "value": "2026-03-15T10:30:00Z" }
  ],
  "createdAt": "2026-03-10T08:00:00Z",
  "updatedAt": "2026-03-15T10:30:00Z"
}
Try it Live
POST /contents/{contentTypeKey}/{id}

Get content with relations

Retrieve a single content item by ID, optionally expanding related content and specifying a locale for translated fields.

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 for translated fields (e.g. 'en', 'it')
includeRelations string[] — Relation field keys to expand inline

Responses

200Success — content item with expanded relations
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/contents/{contentTypeKey}/{id}" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "locale": "locale_value",
  "includeRelations": []
}'
Example request
{
  "locale": "it",
  "includeRelations": ["category", "author"]
}
Example response 200
{
  "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "contentType": "Article",
  "fields": [
    { "type": "Text", "key": "title", "value": "Ciao Mondo" },
    { "type": "Relation", "key": "category", "value": { "id": "d4e5f6a7-b8c9-0123-defg-456789012345", "contentType": "Category", "fields": [{ "type": "Text", "key": "name", "value": "Tecnologia" }] } },
    { "type": "Relation", "key": "author", "value": { "id": "e5f6a7b8-c9d0-1234-efgh-567890123456", "contentType": "Author", "fields": [{ "type": "Text", "key": "name", "value": "Marco Rossi" }] } }
  ],
  "createdAt": "2026-03-10T08:00:00Z",
  "updatedAt": "2026-03-15T10:30:00Z"
}
Try it Live
POST /contents/{contentTypeKey}/aggregate

Aggregate field values

Compute an aggregate (Sum, Avg, Min, Max, or Count) on a numeric field across matching 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 Aggregation function: Sum, Avg, Min, Max, or Count
filter object — Optional filter to restrict which items are aggregated

Responses

200Success — returns a single decimal value
valuedecimalThe computed aggregate value
401Unauthorized

Code examples

curl -X POST "https://api.contit.cloud/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": "price",
  "aggregateType": "Avg",
  "filter": {
    "type": "and",
    "conditions": [
      { "type": "condition", "fieldKey": "status", "operator": "e", "value": "published" }
    ]
  }
}
Example response 200
{
  "value": 49.95
}
Try it Live
POST /contents/{contentTypeKey}/aggregategroup

Grouped aggregation

Compute an aggregate grouped by a specific field, returning one result per distinct group value.

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 Aggregation function: Sum, Avg, Min, Max, or Count
groupByFieldKey string The field key to group results by
filter object — Optional filter to restrict which items are aggregated

Responses

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

Code examples

curl -X POST "https://api.contit.cloud/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": "price",
  "aggregateType": "Sum",
  "groupByFieldKey": "category",
  "filter": null
}
Example response 200
{
  "items": [
    { "groupValue": "Electronics", "aggregateValue": 2499.90 },
    { "groupValue": "Books", "aggregateValue": 389.50 },
    { "groupValue": "Clothing", "aggregateValue": 1250.00 }
  ]
}
Try it Live
POST /contents/{contentTypeKey}/encrypt/check

Check encrypted field value

Verify that an encrypted field matches a given plaintext value without revealing the stored data.

Requires the ReadAccess policy

Path parameters

NameTypeRequiredDescription
contentTypeKeystringThe content type key

Request body application/json

PropertyTypeRequiredDescription
id string The content item ID
encryptFields object Dictionary of field key to plaintext value to check against

Responses

200Success — returns true if values match
matchbooleanWhether the provided value matches the stored encrypted value
401Unauthorized
404Not Found

Code examples

curl -X POST "https://api.contit.cloud/contents/{contentTypeKey}/encrypt/check" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "id": "id_value",
  "encryptFields": "encryptFields_value"
}'
Example request
{
  "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "encryptFields": {
    "ssn": "123-45-6789"
  }
}
Example response 200
{
  "match": true
}
Try it Live
POST /contents/{contentTypeKey}/encrypt/decrypt

Decrypt encrypted fields

Decrypt one or more encrypted fields on a content item. Requires a valid TOTP code for additional security. The TOTP code is not required when every requested field is flagged as a service secret (machineReadable) and the caller is an application identity granted the 'secrets.read' permission on a content type of its own app: unattended reads are audited instead.

Requires the ReadAccess policy

Path parameters

NameTypeRequiredDescription
contentTypeKeystringThe content type key

Request body application/json

PropertyTypeRequiredDescription
id string The content item ID
encryptFieldKeys string[] Array of field keys to decrypt
totpCode string Time-based one-time password for authorization. Not required for service secrets read by an authorized application identity

Responses

200Success — returns decrypted field values
fieldsobjectDictionary of field key to decrypted plaintext value
401Unauthorized
403Forbidden — invalid TOTP code

Code examples

curl -X POST "https://api.contit.cloud/contents/{contentTypeKey}/encrypt/decrypt" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "id": "id_value",
  "encryptFieldKeys": [],
  "totpCode": "totpCode_value"
}'
Example request
{
  "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "encryptFieldKeys": ["ssn", "taxId"],
  "totpCode": "482916"
}
Example response 200
{
  "fields": {
    "ssn": "123-45-6789",
    "taxId": "RSSMRC80A01H501Z"
  }
}
Try it Live
PUT /contents/{contentTypeKey}/encrypt

Set encrypted field values

Store one or more field values in encrypted form on a content item.

Requires the WriteAccess policy

Path parameters

NameTypeRequiredDescription
contentTypeKeystringThe content type key

Request body application/json

PropertyTypeRequiredDescription
id string The content item ID
encryptFields object Dictionary of field key to plaintext value to encrypt and store
clientInfo string — Optional client identifier for audit logging

Responses

200Success — fields encrypted and stored
401Unauthorized
404Not Found

Code examples

curl -X PUT "https://api.contit.cloud/contents/{contentTypeKey}/encrypt" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "id": "id_value",
  "encryptFields": "encryptFields_value",
  "clientInfo": "clientInfo_value"
}'
Example request
{
  "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "encryptFields": {
    "ssn": "123-45-6789"
  },
  "clientInfo": "admin-panel-v3"
}
Example response 200
{
  "success": true
}
Try it Live
PUT /contents/{contentTypeKey}

Create or update content

Create a new content item (id = null) or update an existing one. Returns the full content model including system-generated fields.

Requires the WriteAccess policy

Path parameters

NameTypeRequiredDescription
contentTypeKeystringThe content type key

Request body application/json

PropertyTypeRequiredDescription
id string — Content item ID. Pass null or omit to create a new item.
contentType string The content type key (must match path parameter)
fields ContentField[] Array of typed fields with type, key, and value
clientInfo string — Optional client identifier for audit logging

Responses

200Success — returns the saved content item with system fields populated
idstringContent item ID (generated if new)
contentTypestringContent type key
fieldsContentField[]Array of typed fields
createdAtdatetimeCreation timestamp
updatedAtdatetimeLast update timestamp
401Unauthorized

Code examples

curl -X PUT "https://api.contit.cloud/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": "New Article" },
    { "type": "RichText", "key": "body", "value": "<p>Article body here.</p>" },
    { "type": "DateTime", "key": "publishDate", "value": "2026-03-20T09:00:00Z" }
  ],
  "clientInfo": "cms-editor"
}
Example response 200
{
  "id": "f6a7b8c9-d0e1-2345-fghi-678901234567",
  "contentType": "Article",
  "fields": [
    { "type": "Text", "key": "title", "value": "New Article" },
    { "type": "RichText", "key": "body", "value": "<p>Article body here.</p>" },
    { "type": "DateTime", "key": "publishDate", "value": "2026-03-20T09:00:00Z" },
    { "type": "Text", "key": "_createdBy", "value": "api-client" }
  ],
  "createdAt": "2026-03-20T09:00:00Z",
  "updatedAt": "2026-03-20T09:00:00Z"
}
Try it Live
DELETE /contents/{contentTypeKey}/{id}

Delete content

Permanently delete a content item by its ID.

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/contents/{contentTypeKey}/{id}" \
  -H "X-Api-Key: YOUR_API_KEY"
Example response 200
{
  "success": true
}
Try it Live
PUT /contents/{contentTypeKey}/publish Deprecated

Publish content (deprecated)

Deprecated. Use PUT /contents/{contentTypeKey} with the appropriate status field instead.

Requires the WriteAccess policy
This endpoint is deprecated and will be removed in a future version.

Path parameters

NameTypeRequiredDescription
contentTypeKeystringThe content type key

Request body application/json

PropertyTypeRequiredDescription
id string The content item ID to publish
clientInfo string — Optional client identifier

Responses

200Success
401Unauthorized

Code examples

curl -X PUT "https://api.contit.cloud/contents/{contentTypeKey}/publish" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "id": "id_value",
  "clientInfo": "clientInfo_value"
}'
Example request
{
  "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "clientInfo": "cms-editor"
}
Example response 200
{
  "success": true
}