POST/ng-cms/content-types/{projectId}

Create a new content type

Параметры запроса

projectIdstring
Обязательный

The unique identifier of the project

Тело запроса

CreateContentTypeRequest
namestring
Обязательный

Human-readable display name for the content type

keystring
Обязательный

Unique machine-readable identifier (e.g. 'blog-post')

descriptionstring
Необязательный

Optional description of the content type's purpose

displayFieldstring
Необязательный

Key of the schema field used as the entry title

schemaCmsSchemaField[]
Необязательный

Array of field definitions that make up the content type's schema

CmsSchemaField
keystring
Обязательный

Unique field identifier within the schema

labelstring
Обязательный

Human-readable field label

typestring
Обязательный

Field data type: text, richtext, number, boolean, date, reference

requiredboolean
Необязательный

Whether the field is required when creating entries

minLengthnumber
Необязательный

Minimum character length for text fields

maxLengthnumber
Необязательный

Maximum character length for text fields

minnumber
Необязательный

Minimum value for numeric fields

maxnumber
Необязательный

Maximum value for numeric fields

regexstring
Необязательный

Regular expression pattern for value validation

uniqueboolean
Необязательный

Whether field values must be unique across entries

allowedValuesstring[]
Необязательный

Enumerated list of permitted values

referenceContentTypeIdstring
Необязательный

ID of another content type for reference/relation fields

Ответы

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

тип: ApiResponse<string>

successbooleanAlways true on success
resultstringThe ID of the newly created content type
errorsErrorDetail[]Empty on success
400Validation failed — required fields missing or key already in use.

тип: ApiResponse<T>

isValidbooleanAlways false for validation errors
validationErrorsValidationError[]List of validation failures
namestringField that failed validation
attemptedValueobjectThe value that was submitted
messagestringHuman-readable validation message
401Unauthorized. A valid API key is required.
412Precondition Failed. The project's current plan does not allow access to this resource, or payment is required.
500Unexpected server error.

тип: ApiResponse<T>

successbooleanAlways false
errorsErrorDetail[]List of server-side errors
correlationIdstringUnique ID for tracing the error
messagestringError message
stackstringStack trace (non-production only)

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