/ng-cms/content-types/{projectId} https://apis-spb.konso.io/ng-cms/content-types/{projectId} Create a new content type
Параметры запроса
projectId string The unique identifier of the project
Тело запроса
CreateContentTypeRequest name string Human-readable display name for the content type
key string Unique machine-readable identifier (e.g. 'blog-post')
description string Optional description of the content type's purpose
displayField string Key of the schema field used as the entry title
schema CmsSchemaField[] Array of field definitions that make up the content type's schema
CmsSchemaField key string Unique field identifier within the schema
label string Human-readable field label
type string Field data type: text, richtext, number, boolean, date, reference
required boolean Whether the field is required when creating entries
minLength number Minimum character length for text fields
maxLength number Maximum character length for text fields
min number Minimum value for numeric fields
max number Maximum value for numeric fields
regex string Regular expression pattern for value validation
unique boolean Whether field values must be unique across entries
allowedValues string[] Enumerated list of permitted values
referenceContentTypeId string ID of another content type for reference/relation fields
Ответы
тип: ApiResponse<string>
success boolean Always true on success result string The ID of the newly created content type errors ErrorDetail[] Empty on success тип: ApiResponse<T>
isValid boolean Always false for validation errors validationErrors ValidationError[] List of validation failures name string Field that failed validation attemptedValue object The value that was submitted message string Human-readable validation message тип: ApiResponse<T>
success boolean Always false errors ErrorDetail[] List of server-side errors correlationId string Unique ID for tracing the error message string Error message stack string Stack trace (non-production only) curl --request POST \
--url https://apis-spb.konso.io/ng-cms/content-types/{projectId} \
--header 'x-api-key: <api-key>' \
--header 'Content-Type: application/json' \
--data '{
"name": "Blog Post",
"key": "blog-post",
"description": "Standard blog post content type",
"displayField": "title",
"schema": [
{
"key": "title",
"label": "Title",
"type": "text",
"required": true,
"maxLength": 200
},
{
"key": "body",
"label": "Body",
"type": "richtext",
"required": true
}
]
}' {
"success": true,
"result": "ct_a1b2c3d4e5f6",
"errors": []
}