PUT/ng-cms/content-types/{projectId}/{key}

Update a content type

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

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

The unique identifier of the project

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

The ID or key of the content type to update

Тело запроса

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

ID of the content type to update

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

Human-readable display name for the content type

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

Unique machine-readable identifier for the content type (e.g. 'blog-post')

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

Optional description of the content type's purpose

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

Key of the schema field used as the display/title field for entries

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

Full replacement array of field definitions for 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

Ответы

200Content type updated successfully. Returns the content type ID.

тип: ApiResponse<string>

successbooleanIndicates whether the request was successful
resultstringThe ID of the updated content type
errorsErrorDetail[]List of errors (empty on success)
400Validation failed — required fields missing or schema is invalid.

тип: 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.
404Not Found. No content type exists with the given ID or key.
412Precondition Failed. The project's current plan does not allow access to this resource, or payment is required to proceed.
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