EN IT

Content Types

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

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

GET /content-types

List all content types

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

Requires ReadAccess policy

Responses

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

Code examples

curl -X GET "https://api.contit.cloud/content-types" \
  -H "X-Api-Key: YOUR_API_KEY"
var client = new ContitClient(
    new ClientContitConfiguration(clientId, clientSecret));

var types = await client.ContentType.GetAll();
const response = await fetch(
  "https://api.contit.cloud/content-types",
  {
    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/content-types",
    headers=headers
)

data = response.json()
Example Response 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
      }
    ]
  }
]
Try it Live
GET /content-types/{key}

Get single content type

Retrieve a single content type definition by its key.

Requires ReadAccess policy

Path Parameters

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

Responses

200 Success
id string Content type ID
name string Display name
key string Unique key
icon string Material icon name
groupName string Logical group name
fieldTitleKey string Field key used as display title
sortIndex integer Sort order
versioningDisabled boolean Whether versioning is disabled
fields FieldDefinition[] Array of field definitions
401 Unauthorized
404 Not Found

Code examples

curl -X GET "https://api.contit.cloud/content-types/{key}" \
  -H "X-Api-Key: YOUR_API_KEY"
var client = new ContitClient(
    new ClientContitConfiguration(clientId, clientSecret));

var types = await client.ContentType.GetAll();
const response = await fetch(
  "https://api.contit.cloud/content-types/{key}",
  {
    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/content-types/{key}",
    headers=headers
)

data = response.json()
Example Response 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
    }
  ]
}
Try it 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.

Requires WriteAccess policy

Request Body application/json

PropertyTypeRequiredDescription
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

Responses

200 Success — returns the saved content type
id string Content type ID
name string Display name
key string Unique key
fields FieldDefinition[] Field definitions
401 Unauthorized

Code examples

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

var content = new StringContent("{
  \"id\": \"id_value\",
  \"name\": \"name_value\",
  \"key\": \"key_value\",
  \"icon\": \"icon_value\",
  \"groupName\": \"groupName_value\",
  \"fieldTitleKey\": \"fieldTitleKey_value\",
  \"sortIndex\": 1,
  \"versioningDisabled\": true,
  \"fields\": []
}",
    Encoding.UTF8, "application/json");
var response = await http.PutAsync(
    "https://api.contit.cloud/content-types", content);

response.EnsureSuccessStatusCode();
var json = await response.Content.ReadAsStringAsync();
const response = await fetch(
  "https://api.contit.cloud/content-types",
  {
    method: "PUT",
    headers: {
      "X-Api-Key": "YOUR_API_KEY",
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
  "id": "id_value",
  "name": "name_value",
  "key": "key_value",
  "icon": "icon_value",
  "groupName": "groupName_value",
  "fieldTitleKey": "fieldTitleKey_value",
  "sortIndex": 1,
  "versioningDisabled": true,
  "fields": []
})
  }
);

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

headers = {"X-Api-Key": "YOUR_API_KEY"}
payload = {
  "id": "id_value",
  "name": "name_value",
  "key": "key_value",
  "icon": "icon_value",
  "groupName": "groupName_value",
  "fieldTitleKey": "fieldTitleKey_value",
  "sortIndex": 1,
  "versioningDisabled": true,
  "fields": []
}

response = requests.put(
    "https://api.contit.cloud/content-types",
    json=payload,
    headers=headers
)

data = response.json()
Example Request
{
  "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 }
  ]
}
Example Response 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 }
  ]
}
Try it 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).

Requires WriteAccess policy

Path Parameters

NameTypeRequiredDescription
key string The content type key to delete

Responses

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

Code examples

curl -X DELETE "https://api.contit.cloud/content-types/{key}" \
  -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/content-types/{key}", content);

response.EnsureSuccessStatusCode();
var json = await response.Content.ReadAsStringAsync();
const response = await fetch(
  "https://api.contit.cloud/content-types/{key}",
  {
    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/content-types/{key}",
    headers=headers
)

data = response.json()
Example Response 200
{
  "success": true
}
Try it Live