Update a content type
const url = 'https://example.com/api/content/management/types/example';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"Article","displayName":"News Article","apiName":"article","description":"example","settings":{"isSitePage":true,"requiresNativeFile":true},"isLocked":true,"fields":[{"name":"title","description":"Title","datatype":"text","required":true,"isSearchable":true,"hidden":true,"readOnly":true,"defaultValue":"example","valuecount":"single","settings":{"caas":{"customValidators":["example"],"description":"example","editor":{"additionalProperty":"example"},"valueCountRange":"example"},"customEditor":{"enabled":true,"url":"example"},"referenceType":"example","allowMultiple":true,"maxLength":1,"minValue":1,"maxValue":1},"referenceType":{"type":"example","types":["example"]},"config":{"height":300,"plugins":["example"],"toolbar":"example","promotion":true,"relative_urls":true,"convert_urls":true},"linkRefTypes":["example"],"imgRefTypes":["example"],"options":[{"name":"example","value":"example"}],"detailPagesOnly":true,"showTime":true,"isCustomJSONForm":true,"customJSONFormDef":"example"}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://example.com/api/content/management/types/example \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "Article", "displayName": "News Article", "apiName": "article", "description": "example", "settings": { "isSitePage": true, "requiresNativeFile": true }, "isLocked": true, "fields": [ { "name": "title", "description": "Title", "datatype": "text", "required": true, "isSearchable": true, "hidden": true, "readOnly": true, "defaultValue": "example", "valuecount": "single", "settings": { "caas": { "customValidators": [ "example" ], "description": "example", "editor": { "additionalProperty": "example" }, "valueCountRange": "example" }, "customEditor": { "enabled": true, "url": "example" }, "referenceType": "example", "allowMultiple": true, "maxLength": 1, "minValue": 1, "maxValue": 1 }, "referenceType": { "type": "example", "types": [ "example" ] }, "config": { "height": 300, "plugins": [ "example" ], "toolbar": "example", "promotion": true, "relative_urls": true, "convert_urls": true }, "linkRefTypes": [ "example" ], "imgRefTypes": [ "example" ], "options": [ { "name": "example", "value": "example" } ], "detailPagesOnly": true, "showTime": true, "isCustomJSONForm": true, "customJSONFormDef": "example" } ] }'Updates an existing content type definition. Type must not be locked.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Type ID
Request Body
Section titled “Request Body”object
Type name
Example
ArticleHuman-readable type name
Example
News ArticleAPI-friendly name (camelCase)
Example
articleType description
Type-level settings
object
Whether this type represents a site page
Whether an item of this type must have a native file attached to save
Whether type is locked for editing
Field definitions
object
Field name (used as key)
Example
titleHuman-readable field label
Example
TitleField data type
Whether field is required
Whether field is indexed for search
Whether field is hidden in the UI
Whether field is read-only
Default field value
Whether field accepts single or multiple values
Field-specific settings
object
CAAS-specific settings
object
Custom validation rules
CAAS field description
Editor configuration
object
Value count range constraint
Custom editor settings
object
Whether custom editor is enabled
Custom editor URL
For reference fields: the target content type
Whether multiple values are allowed
Maximum character length
Minimum numeric value
Maximum numeric value
For reference fields: the target content type(s)
object
Referenced single asset type
Referenced multiple asset types
Rich text editor configuration (TinyMCE)
object
Editor height in pixels
Example
300TinyMCE plugins to enable
Toolbar configuration string
Show TinyMCE promotion
Use relative URLs
Convert URLs
Allowed link reference types for rich text
Allowed image reference types for rich text
Available options for select fields
object
Option display name
Option value
Only show detail pages in site page picker
For datetime fields: capture hour and minute along with the date
Whether to use custom JSON form editor
Custom JSON form definition (svelte-formly format)
Responses
Section titled “Responses”Type updated successfully
object
Examplegenerated
{ "id": "example"}Invalid request or type is locked