Create a Type

post

/content/management/api/v1.1/types

Creates a type with the given payload.

Request

Supported Media Types
Query Parameters
Header Parameters
Body ()
Creates a type with the given information in the payload. Type name is case-insensitive i.e., cannot create a type with existing type name even in a different case. The fields id, createdBy, createdDate, updatedBy, updatedDate and links will be ignored even if given in the payload.
Root Schema : Type
Type: object
AggregatedType
Show Source
Nested Schema : allowedActions
Type: array
allowedActions on Type.
Show Source
  • Allowed Values: [ "preview", "read", "write", "update", "delete" ]
Nested Schema : allowedFileTypes
Type: array
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 .
Show Source
Nested Schema : ItemSubResourceListTypeField
Type: object
Item SubResource.
Show Source
Nested Schema : connectorInfos
Type: array
connectorInfos on Type.
Show Source
Nested Schema : date
Type: object
date
Show Source
Nested Schema : fields
Type: array
Fields used in the type.
Show Source
Nested Schema : ItemSubResourceListInplacePreview
Type: object
Item SubResource.
Show Source
Nested Schema : ItemSubResourceListLayoutMapping
Type: object
Item SubResource.
Show Source
Nested Schema : properties
Type: object
Additional Properties Allowed
Show Source
Type specific properties.
Nested Schema : ItemSubResourceTypeRelationships
Type: object
Item SubResource.
Show Source
Nested Schema : ItemSubResourceListRequiredTaxonomy
Type: object
Item SubResource.
Show Source
Nested Schema : data
Type: array
Show Source
Nested Schema : TypeField
Type: object
FieldInAggrType.
Show Source
Nested Schema : defaultValue
Type: object
defaultValue for field.
Nested Schema : properties
Type: object
Additional Properties Allowed
Show Source
Field specific properties. The field publishingDependency is specific for media and reference.
Example:
{caas-translation: {inheritFromMaster: false}, publishingDependency: optional}
Nested Schema : settings
Type: object
Additional Properties Allowed
Show Source
Field specific settings.
Nested Schema : additionalProperties
Type: object
Nested Schema : additionalProperties
Type: object
Nested Schema : ConnectorInfo
Type: object
ConnectorInfo
Show Source
Nested Schema : data
Type: array
Show Source
Nested Schema : InplacePreview
Type: object
InplacePreview
Show Source
Nested Schema : data
Type: array
Show Source
Nested Schema : LayoutMapping
Type: object
LayoutMapping
Show Source
Nested Schema : formats
Type: object
Additional Properties Allowed
Show Source
layout formats.
Nested Schema : additionalProperties
Type: object
Nested Schema : TypeRelationships
Type: object
Type Relationships
Show Source
Nested Schema : references
Type: array
Unique Items Required: true
Reference type names/ids
Show Source
Nested Schema : TypeReferences
Type: object
Type References bean
Show Source
Nested Schema : data
Type: array
Show Source
Nested Schema : RequiredTaxonomy
Type: object
Show Source
Nested Schema : defaultCategories
Type: array
Show Source
Nested Schema : Category
Type: object
Show Source
Back to Top

Response

Supported Media Types

201 Response

Created.
Body ()
Root Schema : Type
Type: object
AggregatedType
Show Source
Nested Schema : allowedActions
Type: array
allowedActions on Type.
Show Source
  • Allowed Values: [ "preview", "read", "write", "update", "delete" ]
Nested Schema : allowedFileTypes
Type: array
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 .
Show Source
Nested Schema : ItemSubResourceListTypeField
Type: object
Item SubResource.
Show Source
Nested Schema : connectorInfos
Type: array
connectorInfos on Type.
Show Source
Nested Schema : date
Type: object
date
Show Source
Nested Schema : fields
Type: array
Fields used in the type.
Show Source
Nested Schema : ItemSubResourceListInplacePreview
Type: object
Item SubResource.
Show Source
Nested Schema : ItemSubResourceListLayoutMapping
Type: object
Item SubResource.
Show Source
Nested Schema : properties
Type: object
Additional Properties Allowed
Show Source
Type specific properties.
Nested Schema : ItemSubResourceTypeRelationships
Type: object
Item SubResource.
Show Source
Nested Schema : ItemSubResourceListRequiredTaxonomy
Type: object
Item SubResource.
Show Source
Nested Schema : data
Type: array
Show Source
Nested Schema : TypeField
Type: object
FieldInAggrType.
Show Source
Nested Schema : defaultValue
Type: object
defaultValue for field.
Nested Schema : properties
Type: object
Additional Properties Allowed
Show Source
Field specific properties. The field publishingDependency is specific for media and reference.
Example:
{caas-translation: {inheritFromMaster: false}, publishingDependency: optional}
Nested Schema : settings
Type: object
Additional Properties Allowed
Show Source
Field specific settings.
Nested Schema : additionalProperties
Type: object
Nested Schema : additionalProperties
Type: object
Nested Schema : ConnectorInfo
Type: object
ConnectorInfo
Show Source
Nested Schema : data
Type: array
Show Source
Nested Schema : InplacePreview
Type: object
InplacePreview
Show Source
Nested Schema : data
Type: array
Show Source
Nested Schema : LayoutMapping
Type: object
LayoutMapping
Show Source
Nested Schema : formats
Type: object
Additional Properties Allowed
Show Source
layout formats.
Nested Schema : additionalProperties
Type: object
Nested Schema : TypeRelationships
Type: object
Type Relationships
Show Source
Nested Schema : references
Type: array
Unique Items Required: true
Reference type names/ids
Show Source
Nested Schema : TypeReferences
Type: object
Type References bean
Show Source
Nested Schema : data
Type: array
Show Source
Nested Schema : RequiredTaxonomy
Type: object
Show Source
Nested Schema : defaultCategories
Type: array
Show Source
Nested Schema : Category
Type: object
Show Source

400 Response

Bad request.

403 Response

Forbidden.

404 Response

Not found.

409 Response

Conflict.

500 Response

Internal server error.
Back to Top

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.

Request Payload
{
  "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"
      }
    ]
  }
}
Back to Top