API reference

Content Types

API referencehttps://api.contit.cloud

Content Types

Endpoints for managing content type definitions (schemas), including their fields, validation rules, and display settings.

GET /content-types

List all content types

Retrieve all content type definitions in the workspace, including their field schemas.

Richiede la policy ReadAccess

Risposte

200Success
(array)ContentTypeModel[]Array of content type definitions
401Unauthorized

Esempi di codice

curl -X GET "https://api.contit.cloud/content-types" \
  -H "X-Api-Key: YOUR_API_KEY"
Esempio di risposta 200
[
  {
    "id": "a1b2c3d4-0000-0000-0000-000000000001",
    "name": "Article",
    "key": "Article",
    "icon": "newspaper",
    "groupName": "Content",
    "fieldTitleKey": "title",
    "sortIndex": 0,
    "versioningDisabled": false,
    "fields": [
      {
        "key": "title",
        "type": "Text",
        "name": "Title",
        "required": true,
        "translatable": true,
        "sortIndex": 0
      },
      {
        "key": "body",
        "type": "RichText",
        "name": "Body",
        "required": false,
        "translatable": true,
        "sortIndex": 1
      },
      {
        "key": "publishDate",
        "type": "DateTime",
        "name": "Publish Date",
        "required": false,
        "translatable": false,
        "sortIndex": 2
      }
    ]
  },
  {
    "id": "a1b2c3d4-0000-0000-0000-000000000002",
    "name": "Product",
    "key": "Product",
    "icon": "shopping_cart",
    "groupName": "Commerce",
    "fieldTitleKey": "name",
    "sortIndex": 1,
    "versioningDisabled": false,
    "fields": [
      {
        "key": "name",
        "type": "Text",
        "name": "Product Name",
        "required": true,
        "translatable": true,
        "sortIndex": 0
      },
      {
        "key": "price",
        "type": "Number",
        "name": "Price",
        "required": true,
        "translatable": false,
        "sortIndex": 1
      }
    ]
  }
]
Prova Live
GET /content-types/{key}

Get single content type

Retrieve a single content type definition by its key.

Richiede la policy ReadAccess

Parametri del percorso

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

Risposte

200Success
idstringContent type ID
namestringDisplay name
keystringUnique key
iconstringMaterial icon name
groupNamestringLogical group name
fieldTitleKeystringField key used as display title
sortIndexintegerSort order
versioningDisabledbooleanWhether versioning is disabled
fieldsFieldDefinition[]Array of field definitions
401Unauthorized
404Not Found

Esempi di codice

curl -X GET "https://api.contit.cloud/content-types/{key}" \
  -H "X-Api-Key: YOUR_API_KEY"
Esempio di risposta 200
{
  "id": "a1b2c3d4-0000-0000-0000-000000000001",
  "name": "Article",
  "key": "Article",
  "icon": "newspaper",
  "groupName": "Content",
  "fieldTitleKey": "title",
  "sortIndex": 0,
  "versioningDisabled": false,
  "fields": [
    {
      "key": "title",
      "type": "Text",
      "name": "Title",
      "required": true,
      "translatable": true,
      "sortIndex": 0
    },
    {
      "key": "body",
      "type": "RichText",
      "name": "Body",
      "required": false,
      "translatable": true,
      "sortIndex": 1
    }
  ]
}
Prova Live
PUT /content-types

Create or update content type

Create a new content type definition or update an existing one. Include the full field schema in the request.

Richiede la policy WriteAccess

Corpo della richiesta application/json

ProprietàTipoObbligatorioDescrizione
id string — Content type ID. Null or omit to create.
name string Display name
key string Unique key (alphanumeric, PascalCase recommended)
icon string — Material icon name
groupName string — Logical group name for organization
fieldTitleKey string — Field key to use as display title in lists
sortIndex integer — Sort order among content types
versioningDisabled boolean — Whether to disable versioning for this type
fields FieldDefinition[] Array of field definitions

Risposte

200Success — returns the saved content type
idstringContent type ID
namestringDisplay name
keystringUnique key
fieldsFieldDefinition[]Field definitions
401Unauthorized

Esempi di codice

curl -X PUT "https://api.contit.cloud/content-types" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "id": "id_value",
  "name": "name_value",
  "key": "key_value",
  "icon": "icon_value",
  "groupName": "groupName_value",
  "fieldTitleKey": "fieldTitleKey_value",
  "sortIndex": 1,
  "versioningDisabled": true,
  "fields": []
}'
Esempio di richiesta
{
  "name": "FAQ",
  "key": "FAQ",
  "icon": "help",
  "groupName": "Support",
  "fieldTitleKey": "question",
  "sortIndex": 5,
  "versioningDisabled": false,
  "fields": [
    { "key": "question", "type": "Text", "name": "Question", "required": true, "translatable": true, "sortIndex": 0 },
    { "key": "answer", "type": "RichText", "name": "Answer", "required": true, "translatable": true, "sortIndex": 1 }
  ]
}
Esempio di risposta 200
{
  "id": "b2c3d4e5-0000-0000-0000-000000000003",
  "name": "FAQ",
  "key": "FAQ",
  "icon": "help",
  "groupName": "Support",
  "fieldTitleKey": "question",
  "sortIndex": 5,
  "versioningDisabled": false,
  "fields": [
    { "key": "question", "type": "Text", "name": "Question", "required": true, "translatable": true, "sortIndex": 0 },
    { "key": "answer", "type": "RichText", "name": "Answer", "required": true, "translatable": true, "sortIndex": 1 }
  ]
}
Prova Live
DELETE /content-types/{key}

Delete content type

Delete a content type definition. The content type must have no existing content items (must be empty).

Richiede la policy WriteAccess

Parametri del percorso

NomeTipoObbligatorioDescrizione
keystringThe content type key to delete

Risposte

200Success — content type deleted
401Unauthorized
404Not Found
409Conflict — content type has existing content items

Esempi di codice

curl -X DELETE "https://api.contit.cloud/content-types/{key}" \
  -H "X-Api-Key: YOUR_API_KEY"
Esempio di risposta 200
{
  "success": true
}
Prova Live