Create a Type
/content/management/api/v1.1/types
Request
- application/json
-
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
201 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
400 Response
403 Response
404 Response
409 Response
500 Response
Examples
The following example shows how to create a type by submitting a POST request on the REST resource using cURL.
curl -X POST -H 'Content-Type: application/json' -H 'X-Requested-With: XMLHttpRequest' 'https://host:port/content/management/api/v1.1/types'
Example 1:
This creates a simple type. Replace payload with your own data.
/content/management/api/v1.1/types
Request Payload
{ "name": "Book_1", "apiName": "book1", "displayName": "Book_1Display", "description": "Book_1 description." }
Example 2:
This creates a type with a single-valued optional text field. Replace payload with your own data.
Request Payload
{ "name": "Book_2", "displayName": "Book_2Display", "apiName": "book2", "typeCategory": "ContentType", "description": "Book_2 description.", "fields": [ { "name": "title", "apiName": "title", "description": "Text field", "datatype": "largetext", "required": false, "valuecount": "single" } ] }
Example 3
This creates a type with a multi-valued optional text field. Replace payload with your own data.
Request Payload
{ "name": "Book_3", "displayName": "Book_3Display", "apiName": "book3", "description": "Book_3 description.", "fields": [ { "name": "title", "apiName": "title", "description": "Text field", "datatype": "largetext", "required": false, "valuecount": "list" } ] }
Example 4
This creates a type with a single-valued required number field. Replace payload with your own data.
Request Payload
{ "name": "Book_4", "displayName": "Book_4", "apiName": "book4", "description": "Book_4 description.", "fields": [ { "name": "volume", "apiName": "volume", "description": "Number Field", "datatype": "number", "required": true, "valuecount": "single" } ] }
Example 5
This creates a type with a required reference field, which refers to other existing type(Book_4), Book_4 is an existing type in the system. Replace payload with your own data.
Request Payload
{ "name": "Author", "displayName": "AuthorDisplay", "apiName": "author", "description": "Author description.", "fields": [ { "name": "collection", "apiName": "collection", "description": "referenceField", "datatype": "reference", "required": true, "valuecount": "list", "properties": {}, "settings": {}, "referenceType": { "type": "Book_4", "typeCategory": "ContentType" } } ] }
Example 6
This creates a type with a required reference MyImage of typeCategory : DigitalAssetType. Replace payload with your own data.
Request Payload
{ "name": "referenceType", "displayName": "referenceTypeDisplay", "apiName": "referenceType", "description": "referenceType description", "fields": [ { "name": "media", "apiName": "media", "datatype": "reference", "referenceType": { "type": "MyImage" }, "valuecount": "single", "required": true } ] }
Example 7
This creates a type with an optional reference with publishingDependency to be required. Replace payload with your own data.
Request Payload
{ "name": "referenceType-pubDep-required", "displayName": "refType-pubDep-required_Display", "apiName": "referenceTypePubDepRequired", "description": "referenceType-pubDep-required description", "fields": [ { "name": "media", "apiName": "media", "datatype": "reference", "required": true, "valuecount": "single", "properties": { "publishingDependency": "required" }, "settings": {}, "referenceType": { "type": null, "types": [] } } ] }
Example 8
This creates a type with a required reference DigitalAsset with publishingDependency to be optional. Replace payload with your own data.
Request Payload
{ "name": "referenceType-pubDep-optional", "displayName": "refType-pubDep-optional_Display", "apiName": "referenceTypePubDepOptional", "description": "referenceType-pubDep-optional description", "fields": [ { "name": "media", "apiName": "media", "datatype": "reference", "required": true, "valuecount": "single", "properties": { "publishingDependency": "optional" }, "settings": {}, "referenceType": { "type": "DigitalAsset" } } ] }
Example 9
This creates a type with a single-valued required number field and one single-valued optional text field. Replace payload with your own data.
Request Payload
{ "name": "Book_5", "displayName": "Book_5_Display", "apiName": "book5", "description": "Book_5 description.", "fields": [ { "name": "title", "apiName": "title", "description": "Text field", "datatype": "largetext", "required": false, "valuecount": "single" }, { "name": "volume", "apiName": "volume", "description": "Number Field", "datatype": "number", "required": true, "valuecount": "single" } ] }
Example 10
This creates a type Author with a reference field, which refer to some other existing type(Book_4). Replace payload with your own data.
Request Payload
{ "name": "Author", "displayName": "Author_Display", "apiName": "author", "description": "Author description.", "fields": [ { "name": "subject", "apiName": "subject", "description": "Text field", "datatype": "largetext", "required": false, "valuecount": "single" }, { "name": "collection", "apiName": "collection", "description": "referenceField", "datatype": "reference", "required": true, "valuecount": "list", "properties": {}, "settings": {}, "referenceType": { "type": "Book_4" } } ] }
Example 11
This creates a type Author with one optional field, a reference field, which refer to some other existing type and a digital asset reference field. Replace payload with your own data.
Request Payload
{ "name": "Author", "apiName": "author", "displayName": "Author_Display", "description": "Author description.", "fields": [ { "name": "subject", "apiName": "subject", "description": "Text field", "datatype": "largetext", "required": false, "valuecount": "single" }, { "name": "collection", "apiName": "collection", "description": "referenceField", "datatype": "reference", "required": true, "valuecount": "list", "properties": {}, "settings": {}, "referenceType": { "type": "Book_4", "typeCategory": "ContentType" } }, { "name": "profilePic", "apiName": "profilePic", "datatype": "reference", "referenceType": { "type": "DigitalAsset", "typeCategory": "DigitalAssetType" }, "valuecount": "single", "required": false } ] }
Example 12
This creates a type Author with one optional field, a json field with no schema. Replace payload with your own data.
Request Payload
{ "name": "Author", "displayName": "Author_Display", "apiName": "author", "description": "Author description.", "fields": [ { "name": "otherDetails", "apiName": "otherDetails", "description": "json field", "datatype": "json", "required": false, "valuecount": "single" } ] }
Example 13
This creates a type Author with one required field, a json field with schema. Replace payload with your own data.
Request Payload
{ "name": "Author", "displayName": "Author_Display", "apiName": "author", "description": "Author description.", "fields": [ { "name": "otherDetails", "apiName": "otherDetails", "description": "json field", "datatype": "json", "required": true, "valuecount": "single", "jsonSchema": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "Sample Object schema", "type": "object", "properties": { "string_attr": { "type": "string" }, "number_attr": { "type": "number" }, "integer_attr": { "type": "integer" }, "boolean_attr": { "type": "boolean" }, "list_attr": { "type": "array", "items": { "type": "number" } }, "object_attr": { "type": "object" } } } } ] }
Example 14
This creates a simple digital type. Replace payload with your own data.
Request Payload
{ "name": "Invoices", "displayName": "InvoicesDisplay", "description": "Invoices description.", "typeCategory": "DigitalAssetType", "allowedFileTypes": [ "pdf" ] }
Example 15
This creates a digital type with multiple fields(digital type supports all fields supported by content type, here mentioning only few). Replace payload with your own data.
{ "name": "Invoices", "displayName": "MyInvoices", "description": "Invoices description.", "typeCategory": "DigitalAssetType", "allowedFileTypes": [ "pdf" ], "fields": [ { "name": "title", "description": "title field", "datatype": "text", "required": true, "valuecount": "single" }, { "name": "detail", "description": "detail field", "datatype": "largetext", "required": false, "valuecount": "multi" }, { "name": "invoice date", "description": "invoice date field", "datatype": "datetime", "required": false, "valuecount": "single" }, { "name": "count", "description": "count field", "datatype": "number", "required": false, "valuecount": "single" }, { "name": "percentage", "description": "percentage field", "datatype": "decimal", "required": false, "valuecount": "single" }, { "name": "verified", "description": "verified field", "datatype": "boolean", "required": false, "valuecount": "single" }, { "name": "address", "description": "address field", "datatype": "json", "required": false, "valuecount": "single" }, { "name": "media", "apiName": "media", "datatype": "reference", "referenceType": { "type": "MyImage" }, "valuecount": "single", "required": false }, { "name": "collection", "apiName": "collection", "description": "referenceField", "datatype": "reference", "required": true, "valuecount": "list", "properties": {}, "settings": {}, "referenceType": { "type": "Book_4" } } ] }
Example 16
This returns an error while trying to create simple digital type, as payload do not have allowedFileTypes node. Replace payload with your own data.
Request Payload
{ "name": "Invoices", "displayName": "MyInvoices", "description": "Invoices description.", "typeCategory": "DigitalAssetType" }
Example 17
This creates a simple digital type with friendly url enabled and file sharing enabled. Replace payload with your own data.
Request Payload
{ "name": "Invoices", "displayName": "InvoicesDisplay", "description": "Invoices description.", "typeCategory": "DigitalAssetType", "allowedFileTypes": [ "pdf" ], "properties": { "caas": { "slug": { "enabled": true, "allow-forward-slash": true, "pattern": "invoices-{name}" } }, "caas-translations": { "description": { "inheritFromMaster": false, "note": "", "translate": true }, "file": { "inheritFromMaster": true, "note": "", "translate": false }, "name": { "inheritFromMaster": false, "note": "", "translate": true }, "slug": { "inheritFromMaster": false, "note": "", "translate": true } } } }
Request Headers
{ "Content-Type": "application/json", "X-Requested-With": "XMLHttpRequest" }
Example 18
This creates a simple digital type with friendly url enabled and file sharing disabled. Replace payload with your own data.
Request Payload
{ "name": "Invoices", "displayName": "InvoicesDisplay", "description": "Invoices description.", "typeCategory": "DigitalAssetType", "allowedFileTypes": [ "pdf" ], "properties": { "caas": { "slug": { "enabled": true, "allow-forward-slash": true, "pattern": "invoices-{name}" } }, "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" }
Example 19
This creates a type with two required taxonomies and one taxonomy has a default category assigned to it. The taxonomies and categories must already exist in the system.
Request Payload
{ "name": "ContentTypeWithRequiredTaxonomy", "description": "Type with required taxonomy", "typeCategory": "ContentType", "requiredTaxonomies": { "data": [ { "id": "B3A601C4A45D418DA24F88E00CA238CE", "defaultCategories": [ { "id": "317AE47B62A54463AA8AAB7DA03AC40E" } ] }, { "id": "5C31CC8E13C941D58A7DD471496FF188" } ] } }