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.

Richiede la policy ReadAccess

Parametri del percorso

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

Corpo della richiesta application/json

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

Risposte

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

Esempi di codice

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
}'
Esempio di richiesta
{
  "filter": {
    "type": "and",
    "conditions": [
      { "type": "condition", "fieldKey": "status", "operator": "e", "value": "published" }
    ]
  },
  "page": 1,
  "pageSize": 100
}
Esempio di risposta 200
{
  "ids": [
    "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "b2c3d4e5-f6a7-8901-bcde-f12345678901",
    "c3d4e5f6-a7b8-9012-cdef-123456789012"
  ],
  "total": 3
}
Prova Live
GET /contents/{contentTypeKey}/{id}

Get single content

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

Esempi di codice

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

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

Risposte

200Success — content item with expanded relations
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/contents/{contentTypeKey}/{id}" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "locale": "locale_value",
  "includeRelations": []
}'
Esempio di richiesta
{
  "locale": "it",
  "includeRelations": ["category", "author"]
}
Esempio di risposta 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"
}
Prova 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.

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 Aggregation function: Sum, Avg, Min, Max, or Count
filter object — Optional filter to restrict which items are aggregated

Risposte

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

Esempi di codice

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"
}'
Esempio di richiesta
{
  "type": "condition",
            "fieldKey": "price",
  "aggregateType": "Avg",
  "filter": {
    "type": "and",
    "conditions": [
      { "type": "condition", "fieldKey": "status", "operator": "e", "value": "published" }
    ]
  }
}
Esempio di risposta 200
{
  "value": 49.95
}
Prova Live
POST /contents/{contentTypeKey}/aggregategroup

Grouped aggregation

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

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 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

Risposte

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

Esempi di codice

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"
}'
Esempio di richiesta
{
  "type": "condition",
            "fieldKey": "price",
  "aggregateType": "Sum",
  "groupByFieldKey": "category",
  "filter": null
}
Esempio di risposta 200
{
  "items": [
    { "groupValue": "Electronics", "aggregateValue": 2499.90 },
    { "groupValue": "Books", "aggregateValue": 389.50 },
    { "groupValue": "Clothing", "aggregateValue": 1250.00 }
  ]
}
Prova 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.

Richiede la policy ReadAccess

Parametri del percorso

NomeTipoObbligatorioDescrizione
contentTypeKeystringThe content type key

Corpo della richiesta application/json

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

Risposte

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

Esempi di codice

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"
}'
Esempio di richiesta
{
  "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "encryptFields": {
    "ssn": "123-45-6789"
  }
}
Esempio di risposta 200
{
  "match": true
}
Prova 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.

Richiede la policy ReadAccess

Parametri del percorso

NomeTipoObbligatorioDescrizione
contentTypeKeystringThe content type key

Corpo della richiesta application/json

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

Risposte

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

Esempi di codice

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"
}'
Esempio di richiesta
{
  "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "encryptFieldKeys": ["ssn", "taxId"],
  "totpCode": "482916"
}
Esempio di risposta 200
{
  "fields": {
    "ssn": "123-45-6789",
    "taxId": "RSSMRC80A01H501Z"
  }
}
Prova Live
PUT /contents/{contentTypeKey}/encrypt

Set encrypted field values

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

Richiede la policy WriteAccess

Parametri del percorso

NomeTipoObbligatorioDescrizione
contentTypeKeystringThe content type key

Corpo della richiesta application/json

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

Risposte

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

Esempi di codice

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"
}'
Esempio di richiesta
{
  "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "encryptFields": {
    "ssn": "123-45-6789"
  },
  "clientInfo": "admin-panel-v3"
}
Esempio di risposta 200
{
  "success": true
}
Prova 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.

Richiede la policy WriteAccess

Parametri del percorso

NomeTipoObbligatorioDescrizione
contentTypeKeystringThe content type key

Corpo della richiesta application/json

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

Risposte

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

Esempi di codice

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

Delete content

Permanently delete a content item by its ID.

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/contents/{contentTypeKey}/{id}" \
  -H "X-Api-Key: YOUR_API_KEY"
Esempio di risposta 200
{
  "success": true
}
Prova Live
PUT /contents/{contentTypeKey}/publish Deprecato

Publish content (deprecated)

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

Richiede la policy WriteAccess
Questo endpoint è deprecato e sarà tolto in una versione futura.

Parametri del percorso

NomeTipoObbligatorioDescrizione
contentTypeKeystringThe content type key

Corpo della richiesta application/json

ProprietàTipoObbligatorioDescrizione
id string The content item ID to publish
clientInfo string — Optional client identifier

Risposte

200Success
401Unauthorized

Esempi di codice

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"
}'
Esempio di richiesta
{
  "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "clientInfo": "cms-editor"
}
Esempio di risposta 200
{
  "success": true
}