Update a Type
/content/management/api/v1.1/types/{name}
If any fields of type are deleted or flagged as inherit from master in type update, all the items of the type will be updated and the deleted field and items data for the deleted fields will be archived.
Also, publish, copy, import of items of the type will not be allowed during type update while deleting fields or flagging the inherit from master field. If publish or import or copy of items of the type is underway then type update with fields delete or flagging the inherit from master will be blocked.
The property: 'caas-translations.file.inheritFromMaster' of DigitalAsset type cannot be changed if the type has assets.
Request
- application/json
-
name: string
Type name identifier is case-sensitive and any special characters must be encoded
-
links(optional): string
This parameter accepts a comma-separated list of link names. By default, this parameter gives all the links applicable. Possible values are: self, canonical, describedby
-
X-Requested-With: string
A custom header to mitigate CSRF attacks.Allowed Values:
[ "XMLHttpRequest" ]
object
-
allowedActions(optional):
array allowedActions
allowedActions on Type.
-
allowedFileTypes(optional):
array allowedFileTypes
Allowed list of file extensions supported by the type. It is a required property in the get response. It is optional in post/put request and defaults to [ContentItem] if the typeCategory is ContentType and defaults to empty if the typeCategory is DigitalAssetType .
-
apiName(optional):
string
API Name of the type.
-
archivedFields(optional):
object ItemSubResourceListTypeField
Item SubResource.
-
connectorInfos(optional):
array connectorInfos
connectorInfos on Type.
-
createdBy(optional):
string
Created by
-
createdDate(optional):
object date
date
-
description(optional):
string
Description of the type.
-
displayName(optional):
string
display name of the type. It is a required property in the get response whereas it is not required in the post/put request.
-
fields(optional):
array fields
Fields used in the type.
-
id(optional):
string
id of the type. It is a required property in the get response and put request whereas it is not required in the post request.
-
inplacePreview(optional):
object ItemSubResourceListInplacePreview
Item SubResource.
-
jobToken(optional):
string
job token of the background job updating the Type.
-
layoutMapping(optional):
object ItemSubResourceListLayoutMapping
Item SubResource.
-
links(optional):
array links
-
name(optional):
string
Name of the type. It is a required property in the get response and post/put request.
-
properties(optional):
object properties
Additional Properties Allowed: additionalPropertiesType specific properties.
-
relationships(optional):
object ItemSubResourceTypeRelationships
Item SubResource.
-
requiredTaxonomies(optional):
object ItemSubResourceListRequiredTaxonomy
Item SubResource.
-
roleName(optional):
string
Name of the user's role on the content type.
-
typeCategory(optional):
string
Category of the type. The allowed values are [ContentType, DigitalAssetType]. It is a required property in the get response. It is optional in post request and defaults to ContentType. It is also optional in put request and is identified based on the typeName path param in URL.
-
updatedBy(optional):
string
Updated by
-
updatedDate(optional):
object date
date
array
-
Array of:
string
Allowed Values:
[ "preview", "read", "write", "update", "delete" ]
array
array
-
Array of:
object ConnectorInfo
ConnectorInfo
array
-
Array of:
object TypeField
FieldInAggrType.
object
object
-
apiName(optional):
string
API Name of the field.
-
archivedBy(optional):
string
Archived by.
-
archivedDate(optional):
object date
date
-
datatype(optional):
string
Allowed Values:
[ "number", "long", "decimal", "text", "largetext", "reference", "datetime", "boolean" ]
Data Type Enum. It is a required property in the get response and post/put request. -
defaultValue(optional):
object defaultValue
defaultValue for field.
-
description(optional):
string
Description of the field.
-
id(optional):
string
id of the field. It is a required property in the get response and put request whereas it is not required in the post request.
-
isSystemField(optional):
boolean
Is the field provided by the system.
-
name(optional):
string
name of the field. It is a required property in the get response and post/put request.
-
properties(optional):
object properties
Additional Properties Allowed: additionalPropertiesField specific properties. The field publishingDependency is specific for media and reference.
-
required(optional):
boolean
Required or optional value for the Field. It is a required property in the get response and post/put request.
-
settings(optional):
object settings
Additional Properties Allowed: additionalPropertiesField specific settings.
-
valuecount(optional):
string
Allowed Values:
[ "single", "list" ]
Value count as a single or list. It is a required property in the get response and post/put request.
object
object
{caas-translation: {inheritFromMaster: false}, publishingDependency: optional}
object
object
object
object
-
href(optional):
string
The target resource's URI. It could be template URI. It is a required property in the get response.
-
mediaType(optional):
string
Media type.
-
method(optional):
string
What HTTP method can be used to access the target resource.
-
profile(optional):
string
Link to the metadata that describes the target resource.
-
rel(optional):
string
Relation type. It is a required property in the get response.
-
templated(optional):
boolean
Whether the URI is a template.
object
-
connectorId(optional):
string
id of the connector.
-
connectorSyncEnabled(optional):
boolean
Sync status of connector.
object
-
apiName(optional):
string
Name of the layout.
-
formats(optional):
object formats
Additional Properties Allowed: additionalPropertieslayout formats.
-
generateRendition(optional):
boolean
generateRendition.
-
id(optional):
integer(int64)
Id of the layout mapping.
-
label(optional):
string
Name of the category for layout mapping.
object
object
-
references(optional):
array references
Unique Items Required:
true
Reference type names/ids
array
true
-
Array of:
object TypeReferences
Type References bean
object
-
id(optional):
string
id of the type
-
links(optional):
array links
-
name(optional):
string
name of the type
object
-
defaultCategories(optional):
array defaultCategories
-
description(optional):
string
Read Only:
true
-
id(optional):
string
-
name(optional):
string
Read Only:
true
object
-
apiName(optional):
string
Read Only:
true
-
id(optional):
string
-
name(optional):
string
Read Only:
true
Response
- application/json
200 Response
object
-
allowedActions(optional):
array allowedActions
allowedActions on Type.
-
allowedFileTypes(optional):
array allowedFileTypes
Allowed list of file extensions supported by the type. It is a required property in the get response. It is optional in post/put request and defaults to [ContentItem] if the typeCategory is ContentType and defaults to empty if the typeCategory is DigitalAssetType .
-
apiName(optional):
string
API Name of the type.
-
archivedFields(optional):
object ItemSubResourceListTypeField
Item SubResource.
-
connectorInfos(optional):
array connectorInfos
connectorInfos on Type.
-
createdBy(optional):
string
Created by
-
createdDate(optional):
object date
date
-
description(optional):
string
Description of the type.
-
displayName(optional):
string
display name of the type. It is a required property in the get response whereas it is not required in the post/put request.
-
fields(optional):
array fields
Fields used in the type.
-
id(optional):
string
id of the type. It is a required property in the get response and put request whereas it is not required in the post request.
-
inplacePreview(optional):
object ItemSubResourceListInplacePreview
Item SubResource.
-
jobToken(optional):
string
job token of the background job updating the Type.
-
layoutMapping(optional):
object ItemSubResourceListLayoutMapping
Item SubResource.
-
links(optional):
array links
-
name(optional):
string
Name of the type. It is a required property in the get response and post/put request.
-
properties(optional):
object properties
Additional Properties Allowed: additionalPropertiesType specific properties.
-
relationships(optional):
object ItemSubResourceTypeRelationships
Item SubResource.
-
requiredTaxonomies(optional):
object ItemSubResourceListRequiredTaxonomy
Item SubResource.
-
roleName(optional):
string
Name of the user's role on the content type.
-
typeCategory(optional):
string
Category of the type. The allowed values are [ContentType, DigitalAssetType]. It is a required property in the get response. It is optional in post request and defaults to ContentType. It is also optional in put request and is identified based on the typeName path param in URL.
-
updatedBy(optional):
string
Updated by
-
updatedDate(optional):
object date
date
array
-
Array of:
string
Allowed Values:
[ "preview", "read", "write", "update", "delete" ]
array
array
-
Array of:
object ConnectorInfo
ConnectorInfo
array
-
Array of:
object TypeField
FieldInAggrType.
object
object
-
apiName(optional):
string
API Name of the field.
-
archivedBy(optional):
string
Archived by.
-
archivedDate(optional):
object date
date
-
datatype(optional):
string
Allowed Values:
[ "number", "long", "decimal", "text", "largetext", "reference", "datetime", "boolean" ]
Data Type Enum. It is a required property in the get response and post/put request. -
defaultValue(optional):
object defaultValue
defaultValue for field.
-
description(optional):
string
Description of the field.
-
id(optional):
string
id of the field. It is a required property in the get response and put request whereas it is not required in the post request.
-
isSystemField(optional):
boolean
Is the field provided by the system.
-
name(optional):
string
name of the field. It is a required property in the get response and post/put request.
-
properties(optional):
object properties
Additional Properties Allowed: additionalPropertiesField specific properties. The field publishingDependency is specific for media and reference.
-
required(optional):
boolean
Required or optional value for the Field. It is a required property in the get response and post/put request.
-
settings(optional):
object settings
Additional Properties Allowed: additionalPropertiesField specific settings.
-
valuecount(optional):
string
Allowed Values:
[ "single", "list" ]
Value count as a single or list. It is a required property in the get response and post/put request.
object
object
{caas-translation: {inheritFromMaster: false}, publishingDependency: optional}
object
object
object
object
-
href(optional):
string
The target resource's URI. It could be template URI. It is a required property in the get response.
-
mediaType(optional):
string
Media type.
-
method(optional):
string
What HTTP method can be used to access the target resource.
-
profile(optional):
string
Link to the metadata that describes the target resource.
-
rel(optional):
string
Relation type. It is a required property in the get response.
-
templated(optional):
boolean
Whether the URI is a template.
object
-
connectorId(optional):
string
id of the connector.
-
connectorSyncEnabled(optional):
boolean
Sync status of connector.
object
-
apiName(optional):
string
Name of the layout.
-
formats(optional):
object formats
Additional Properties Allowed: additionalPropertieslayout formats.
-
generateRendition(optional):
boolean
generateRendition.
-
id(optional):
integer(int64)
Id of the layout mapping.
-
label(optional):
string
Name of the category for layout mapping.
object
object
-
references(optional):
array references
Unique Items Required:
true
Reference type names/ids
array
true
-
Array of:
object TypeReferences
Type References bean
object
-
id(optional):
string
id of the type
-
links(optional):
array links
-
name(optional):
string
name of the type
object
-
defaultCategories(optional):
array defaultCategories
-
description(optional):
string
Read Only:
true
-
id(optional):
string
-
name(optional):
string
Read Only:
true
object
-
apiName(optional):
string
Read Only:
true
-
id(optional):
string
-
name(optional):
string
Read Only:
true
202 Response
400 Response
403 Response
404 Response
409 Response
500 Response
Examples
The following example shows how to update a field by submitting a PUT request on a REST resource using cURL.
curl -X PUT -H 'Content-Type: application/json' -H 'X-Requested-With: XMLHttpRequest' 'https://host:port/content/management/api/v1.1/types/{name}'
Example 1:
This updates existing type Book with a required field to an optional field. Replace payload with your own data.
/content/management/api/v1.1/types/Book
Request Body
{ "name": "Book", "description": "Description of the book", "fields": [ { "name": "volume", "description": "Number Field", "datatype": "number", "required": false, "valuecount": "single" } ] }
Example 2:
This updates an existing type typeName by adding a new optional field. Replace payload with your own data.
/content/management/api/v1.1/types/typeName
Request Body
{ "name": "Book", "description": "some decription for Book", "typeCategory": "ContentType", "fields": [ { "name": "volume", "description": "Text field", "datatype": "largetext", "required": false, "valuecount": "single" }, { "name": "abstract", "description": "Text field", "datatype": "largetext", "required": false, "valuecount": "single" } ] }
Example 3:
This updates the publishingDependency from optional to required for an existing type with a reference. Replace payload with your own data.
/content/management/api/v1.1/types/referenceType-pubDep-required
Request Body
{ "name": "referenceType-pubDep-required", "description": "referenceType-pubDep-required description", "fields": [ { "name": "media", "apiName": "media", "datatype": "reference", "required": true, "valuecount": "single", "properties": { "publishingDependency": "optional" } } ] }
Example 4:
This updates an existing type typeName having content items by deleting fields. Replace payload with your own data. There will be no response body and response headers will contain status link of the async type update job.
/content/management/api/v1.1/types/typeName
Request Body
{ "name": "typeName", "description": "some decription for typeName", "fields": [ { "name": "volume", "description": "Text field", "datatype": "largetext", "required": false, "valuecount": "single" } ] }
Example 5:
This updates an existing Digital Asset type Book which doesn't have any assets by flipping the property 'properties.caas-translations.file.inheritFromMaster' from true to false thus converting type file shared to non-file shared type. Replace payload with your own data.
/content/management/api/v1.1/types/typeName
Request Payload
{ "name": "Book", "description": "some decription for Book", "displayName": "BookDisplayName", "typeCategory": "DigitalAssetType", "fields": [ { "name": "volume", "description": "Text field", "datatype": "largetext", "required": false, "valuecount": "single" } ], "caas-translations": { "description": { "inheritFromMaster": false, "note": "", "translate": true }, "file": { "inheritFromMaster": false, "note": "", "translate": true }, "name": { "inheritFromMaster": false, "note": "", "translate": true }, "slug": { "inheritFromMaster": false, "note": "", "translate": true } } }
Request Headers
{ "Content-Type": "application/json", "X-Requested-With": "XMLHttpRequest" }