/ng-cms/content-types/{projectId}https://apis-spb.konso.io/ng-cms/content-types/{projectId}Create a new content type
Параметры запроса
projectIdstringThe unique identifier of the project
Тело запроса
CreateContentTypeRequestnamestringHuman-readable display name for the content type
keystringUnique machine-readable identifier (e.g. 'blog-post')
descriptionstringOptional description of the content type's purpose
displayFieldstringKey of the schema field used as the entry title
schemaCmsSchemaField[]Array of field definitions that make up the content type's schema
CmsSchemaFieldkeystringUnique field identifier within the schema
labelstringHuman-readable field label
typestringField data type: text, richtext, number, boolean, date, reference
requiredbooleanWhether the field is required when creating entries
minLengthnumberMinimum character length for text fields
maxLengthnumberMaximum character length for text fields
minnumberMinimum value for numeric fields
maxnumberMaximum value for numeric fields
regexstringRegular expression pattern for value validation
uniquebooleanWhether field values must be unique across entries
allowedValuesstring[]Enumerated list of permitted values
referenceContentTypeIdstringID of another content type for reference/relation fields
Ответы
тип: ApiResponse<string>
successbooleanAlways true on successresultstringThe ID of the newly created content typeerrorsErrorDetail[]Empty on successтип: ApiResponse<T>
isValidbooleanAlways false for validation errorsvalidationErrorsValidationError[]List of validation failuresnamestringField that failed validationattemptedValueobjectThe value that was submittedmessagestringHuman-readable validation messageтип: ApiResponse<T>
successbooleanAlways falseerrorsErrorDetail[]List of server-side errorscorrelationIdstringUnique ID for tracing the errormessagestringError messagestackstringStack 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": []
}