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

Ответы

201 Content type created successfully. Returns the new content type ID.

тип: ApiResponse<string>

success boolean Always true on success
result string The ID of the newly created content type
errors ErrorDetail[] Empty on success
400 Validation failed — required fields missing or key already in use.

тип: 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
401 Unauthorized. A valid API key is required.
412 Precondition Failed. The project's current plan does not allow access to this resource, or payment is required.
500 Unexpected server error.

тип: 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)

Оставаясь на сайте, Вы даете свое согласие на использование файлов cookie