Request

Creates a content type.

Security
Bearer
Query
environmentIdstring

The environment identifier. Defaults to "main". Currently only "main" is supported.

Example:environmentId=main
Bodyrequired

Input data with details of the content type to be created.

namestring, [ 0 .. 50 ] characters^(?![\s-])[a-zA-Z0-9_\s-]*(?<!\s)$required

Content type name. Letters, numbers, spaces, underscores, and hyphens only.

Example:"Promo"
descriptionstring or null, [ 0 .. 100 ] characters

Content type description.

Example:"Promo content type"
parentIdstring or null

The identifier of the parent for this content type.

Example:"497f6eca-6276-4993-bfeb-53cbbbba6f08"
baseContentTypesArray of strings or null

The base content types from which this content model inherits fields and properties.

Example:
[ "497f6eca-6276-4993-bfeb-53cbbbba6f08" ]
fieldGroupsArray of objects or null(CreateContentModelFieldGroupInput)

The list of field groups.

curl -i -X POST \
  'https://edge-platform.sitecorecloud.io/authoring/api/v1/content-types?environmentId=main' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "Promo",
    "description": "Promo content type",
    "parentId": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "baseContentTypes": [
      "497f6eca-6276-4993-bfeb-53cbbbba6f08"
    ],
    "fieldGroups": [
      {
        "name": "Data",
        "sortOrder": 100,
        "fields": [
          {
            "name": "PromoText",
            "attributes": {
              "property1": "string",
              "property2": "string"
            },
            "type": "Single-Line Text",
            "displayName": "Promo text",
            "helperText": "Enter helper text for display",
            "value": {
              "title": "sample title"
            },
            "source": "/sitecore/content/Tenant/Site/Home",
            "sortOrder": 100,
            "validationRules": [
              "59D4EE10-627C-4FD3-A964-61A88B092CBC",
              "A76C1092-EE2E-4021-B9EE-21E541CDA1D7"
            ]
          }
        ]
      }
    ]
  }'

Responses

Successful operation

Bodyapplication/json
descriptionstring or null

The content type description.

Example:"Promo content type"
baseContentTypesArray of objects or null(BaseContentModel)

The base content types this content type inherits from.

fieldGroupsArray of objects or null(FieldGroup)

The content type field groups.

idstring or null

The content type identifier.

Example:"d4e5f6a7-b8c9-0123-4567-89abcdef0123"
namestring or null

The content type name.

Example:"Promo"
systemobject(System)
Response
{ "description": "Promo content type", "baseContentTypes": [ { … } ], "fieldGroups": [ { … } ], "id": "d4e5f6a7-b8c9-0123-4567-89abcdef0123", "name": "Promo", "system": { "created": "2024-01-01T12:00:00Z", "createdBy": "sitecore\\admin", "updated": "2024-01-02T12:00:00Z", "updatedBy": "sitecore\\admin" } }