• Cheat sheets
  • Documentation
  • API reference
  • Product updates
  • Sign in
Kontent.ai Learn
  • Try Kontent.ai
  • Plan
  • Set up
  • Model
  • Develop
  • Create
Management API v2
API Reference
    • About Management API
    • Postman collection
    • SDKs
    • Authentication
    • API keys
    • API limitations
    • Guidelines on handling changes
      • Introduction
      • Content type snippet object
        Schema
      • Add a content type snippet
        POST
      • Retrieve a content type snippet
        GET
      • List content type snippets
        GET
      • Modify a content type snippet
        PATCH
      • Delete a content type snippet
        DELETE

Content type snippets

The content type snippet model is structurally identical to the content type model with these exceptions:
  1. Snippets cannot contain the URL slug, subpage, and content type snippet elements.
  2. Snippets cannot specify their own content groups.
You can reference snippets in your content types by using the content type snippets element. The snippet element can also be assigned to a content group for a better authoring experience.

Content type snippet object

id
string · read-only · uuid
Unique internal identifier of the content type snippet.
codename
string · 1-50 chars
The content type snippet's codename. Unless set while creating the content type snippet, it is initially generated from the snippet's name and can later be modified.
last_modified
string · read-only · date-time
ISO-8601 formatted date and time of the last content type snippet change.
name
required · string · 1-50 chars
Display name of the content type snippet.
elements[]
required · array · unique items
Elements within the snippet.

Any of:
Asset element in snippet
Custom element in snippet
Date & time element in snippet
Guidelines element in snippet
Linked items element in snippet
Multiple choice element in snippet
Number element in snippet
Taxonomy element in snippet
Text element in snippet
Rich text element in snippet
Asset element in snippet
name
required · string · 1-50 chars
The element's display name.
type
required · string
The element's type.
id
string · read-only
The element's internal ID.
codename
string · 1-60 chars
The element's codename. Unless specified, initially generated from the element's name.
external_id
string
The element's external ID.
guidelines
string · nullable
The element's guidelines, providing instructions on what to fill in.
asset_count_limit
nestedSchema
Specifies the limitation for the number of assets allowed within the element.
value
required · number · int32
Specifies the image size, or how many objects can be used within the element.
condition
required · string
Specifies how to apply the value.
maximum_file_size
number · nullable · int32
Specifies the maximum file size in bytes.
allowed_file_types
string
Specifies the allowed file types.
image_width_limit
nestedSchema · nullable
Specifies the width limitation for the asset.
value
required · number · int32
Specifies the image size, or how many objects can be used within the element.
condition
required · string
Specifies how to apply the value.
image_height_limit
nestedSchema · nullable
Specifies the height limitation for the asset.
value
required · number · int32
Specifies the image size, or how many objects can be used within the element.
condition
required · string
Specifies how to apply the value.
is_required
boolean
Determines whether the element must be filled in.
is_non_localizable
boolean
Determines whether the element uses the same value in all languages.
default
object · nullable
Specifies the element's initial value.
Renditions are currently not supported in the default value.
Show child attributes
external_id
string
The content type snippet's external ID. Only present if defined when adding the snippet.
JSON
{
  "id": "baf884be-531f-441f-ae88-64205efdd0f6",
  "codename": "my_metadata",
  "last_modified": "2019-10-20T12:03:17.4685693Z",
  "name": "My metadata",
  "elements": [
    {
      "name": "Meta title",
      "guidelines": "Length: 30–60 characters",
      "is_non_localizable": false,
      "type": "text",
      "id": "09398b24-61ed-512e-5b5c-affd54a098e5",
      "codename": "my_metadata__meta_title"
    },
    {
      "name": "Meta description",
      "guidelines": "Length: 70–150 characters",
      "is_non_localizable": false,
      "type": "text",
      "id": "2e555cc1-1eae-520c-189e-28548904f529",
      "codename": "my_metadata__meta_description"
    }
  ],
  "external_id": "my-valuable-metadata"
}

Add a content type snippet

Create a new snippet.
POST
https://manage.kontent.ai/v2/projects/{environment_id}/snippets

Request

Path parameters

environment_id
required · string
Identifies your environment.

Body schema

Application/json

The content type snippet to be added.

codename
string · 1-50 chars
The content type snippet's codename. Unless set while creating the content type snippet, it is initially generated from the snippet's name and can later be modified.
name
required · string · 1-50 chars
Display name of the content type snippet.
elements[]
required · array · unique items
Elements within the snippet.

Any of:
Asset element in snippet
Custom element in snippet
Date & time element in snippet
Guidelines element in snippet
Linked items element in snippet
Multiple choice element in snippet
Number element in snippet
Taxonomy element in snippet
Text element in snippet
Rich text element in snippet
Asset element in snippet
name
required · string · 1-50 chars
The element's display name.
type
required · string
The element's type.
codename
string · 1-60 chars
The element's codename. Unless specified, initially generated from the element's name.
external_id
string
The element's external ID.
guidelines
string · nullable
The element's guidelines, providing instructions on what to fill in.
asset_count_limit
nestedSchema
Specifies the limitation for the number of assets allowed within the element.
value
required · number · int32
Specifies the image size, or how many objects can be used within the element.
condition
required · string
Specifies how to apply the value.
maximum_file_size
number · nullable · int32
Specifies the maximum file size in bytes.
allowed_file_types
string
Specifies the allowed file types.
image_width_limit
nestedSchema · nullable
Specifies the width limitation for the asset.
value
required · number · int32
Specifies the image size, or how many objects can be used within the element.
condition
required · string
Specifies how to apply the value.
image_height_limit
nestedSchema · nullable
Specifies the height limitation for the asset.
value
required · number · int32
Specifies the image size, or how many objects can be used within the element.
condition
required · string
Specifies how to apply the value.
is_required
boolean
Determines whether the element must be filled in.
is_non_localizable
boolean
Determines whether the element uses the same value in all languages.
default
object · nullable
Specifies the element's initial value.
Renditions are currently not supported in the default value.
Show child attributes
external_id
string
The content type snippet's external ID. Only present if defined when adding the snippet.

Request samples

Payload
TypeScript
C#
cURL
// Tip: Find more about JS/TS SDKs at https://kontent.ai/learn/javascript
import { ManagementClient } from '@kontent-ai/management-sdk';

const client = new ManagementClient({
  environmentId: 'KONTENT_AI_ENVIRONMENT_ID',
  apiKey: 'KONTENT_AI_MANAGEMENT_API_KEY',
});

const response = await client
  .addContentTypeSnippet()
  .withData((builder) => {
    return {
      name: 'metadata',
      codename: 'my_metadata',
      external_id: 'snippet-item-123',
      elements: [
        builder.textElement({
          name: 'Meta title',
          codename: 'my_metadata__meta_title',
          guidelines: 'Length: 30–60 characters',
          type: 'text',
          external_id: 'meta_title',
        }),
        builder.textElement({
          name: 'Meta description',
          codename: 'my_metadata__meta_description',
          guidelines: 'Length: 70-150 characters',
          external_id: 'meta_title',
        }),
      ],
    };
  })
  .toPromise();

Response

Status (201)
The created content type snippet.
id
string · read-only · uuid
Unique internal identifier of the content type snippet.
codename
string · 1-50 chars
The content type snippet's codename. Unless set while creating the content type snippet, it is initially generated from the snippet's name and can later be modified.
last_modified
string · read-only · date-time
ISO-8601 formatted date and time of the last content type snippet change.
name
required · string · 1-50 chars
Display name of the content type snippet.
elements[]
required · array · unique items
Elements within the snippet.

Any of:
Asset element in snippet
Custom element in snippet
Date & time element in snippet
Guidelines element in snippet
Linked items element in snippet
Multiple choice element in snippet
Number element in snippet
Taxonomy element in snippet
Text element in snippet
Rich text element in snippet
Asset element in snippet
name
required · string · 1-50 chars
The element's display name.
type
required · string
The element's type.
id
string · read-only
The element's internal ID.
codename
string · 1-60 chars
The element's codename. Unless specified, initially generated from the element's name.
external_id
string
The element's external ID.
guidelines
string · nullable
The element's guidelines, providing instructions on what to fill in.
asset_count_limit
nestedSchema
Specifies the limitation for the number of assets allowed within the element.
value
required · number · int32
Specifies the image size, or how many objects can be used within the element.
condition
required · string
Specifies how to apply the value.
maximum_file_size
number · nullable · int32
Specifies the maximum file size in bytes.
allowed_file_types
string
Specifies the allowed file types.
image_width_limit
nestedSchema · nullable
Specifies the width limitation for the asset.
value
required · number · int32
Specifies the image size, or how many objects can be used within the element.
condition
required · string
Specifies how to apply the value.
image_height_limit
nestedSchema · nullable
Specifies the height limitation for the asset.
value
required · number · int32
Specifies the image size, or how many objects can be used within the element.
condition
required · string
Specifies how to apply the value.
is_required
boolean
Determines whether the element must be filled in.
is_non_localizable
boolean
Determines whether the element uses the same value in all languages.
default
object · nullable
Specifies the element's initial value.
Renditions are currently not supported in the default value.
Show child attributes
external_id
string
The content type snippet's external ID. Only present if defined when adding the snippet.

Example responses

201
400
{
  "id": "c295baa0-f910-499f-9ca2-523be657019d",
  "codename": "my_metadata",
  "name": "Metadata",
  "external_id": "my_metadata_elements",
  "elements": [
    {
      "name": "Meta title",
      "guidelines": "Length: 30–60 characters",
      "is_non_localizable": false,
      "type": "text",
      "id": "c44bf9dd-aa3f-41c7-b4d9-a09390e41e16",
      "codename": "my_metadata__meta_title",
      "external_id": "my-meta-title"
    },
    {
      "name": "Meta description",
      "guidelines": "Length: 70-150 characters",
      "is_non_localizable": false,
      "type": "text",
      "id": "59b9800b-81a9-4720-bef0-d4cecbaa646c",
      "codename": "my_metadata__meta_description",
      "external_id": "my-meta-description"
    }
  ]
}

Retrieve a content type snippet

Retrieve information about a single content type snippet.
GET
https://manage.kontent.ai/v2/projects/{environment_id}/snippets/{snippet_identifier}

Request

Path parameters

environment_id
required · string
Identifies your environment.
snippet_identifier
required · string
Identifies a specific content type snippet by its internal ID (e.g., baf884be-531f-441f-ae88-64205efdd0f6), external ID (e.g., external-id/snippet-type-123), or codename (e.g., codename/metadata).

Request samples

TypeScript
C#
cURL
// Tip: Find more about JS/TS SDKs at https://kontent.ai/learn/javascript
import { ManagementClient } from '@kontent-ai/management-sdk';

const client = new ManagementClient({
  environmentId: 'KONTENT_AI_ENVIRONMENT_ID',
  apiKey: 'KONTENT_AI_MANAGEMENT_API_KEY',
});

const response = await client
  .viewContentTypeSnippet()
  .byTypeId('269202ad-1d9d-47fd-b3e8-bdb05b3e3cf0')
  // .byTypeCodename('hosted_video')
  // .byTypeExternalId('snippet-type-123')
  .toPromise();

Response

Status (200)
A content type snippet with metadata.
id
string · read-only · uuid
Unique internal identifier of the content type snippet.
codename
string · 1-50 chars
The content type snippet's codename. Unless set while creating the content type snippet, it is initially generated from the snippet's name and can later be modified.
last_modified
string · read-only · date-time
ISO-8601 formatted date and time of the last content type snippet change.
name
required · string · 1-50 chars
Display name of the content type snippet.
elements[]
required · array · unique items
Elements within the snippet.

Any of:
Asset element in snippet
Custom element in snippet
Date & time element in snippet
Guidelines element in snippet
Linked items element in snippet
Multiple choice element in snippet
Number element in snippet
Taxonomy element in snippet
Text element in snippet
Rich text element in snippet
Asset element in snippet
name
required · string · 1-50 chars
The element's display name.
type
required · string
The element's type.
id
string · read-only
The element's internal ID.
codename
string · 1-60 chars
The element's codename. Unless specified, initially generated from the element's name.
external_id
string
The element's external ID.
guidelines
string · nullable
The element's guidelines, providing instructions on what to fill in.
asset_count_limit
nestedSchema
Specifies the limitation for the number of assets allowed within the element.
value
required · number · int32
Specifies the image size, or how many objects can be used within the element.
condition
required · string
Specifies how to apply the value.
maximum_file_size
number · nullable · int32
Specifies the maximum file size in bytes.
allowed_file_types
string
Specifies the allowed file types.
image_width_limit
nestedSchema · nullable
Specifies the width limitation for the asset.
value
required · number · int32
Specifies the image size, or how many objects can be used within the element.
condition
required · string
Specifies how to apply the value.
image_height_limit
nestedSchema · nullable
Specifies the height limitation for the asset.
value
required · number · int32
Specifies the image size, or how many objects can be used within the element.
condition
required · string
Specifies how to apply the value.
is_required
boolean
Determines whether the element must be filled in.
is_non_localizable
boolean
Determines whether the element uses the same value in all languages.
default
object · nullable
Specifies the element's initial value.
Renditions are currently not supported in the default value.
Show child attributes
external_id
string
The content type snippet's external ID. Only present if defined when adding the snippet.

Example responses

200
404
{
  "id": "baf884be-531f-441f-ae88-64205efdd0f6",
  "codename": "my_metadata",
  "last_modified": "2018-06-20T10:25:49.133Z",
  "name": "My metadata",
  "external_id": "snippet-type-123",
  "elements": [
    {
      "name": "Meta title",
      "guidelines": "Length: 30–60 characters",
      "is_non_localizable": false,
      "type": "text",
      "id": "09398b24-61ed-512e-5b5c-affd54a098e5",
      "codename": "my_metadata__meta_title"
    },
    {
      "name": "Meta description",
      "guidelines": "Length: 70–150 characters",
      "is_non_localizable": false,
      "type": "text",
      "id": "2e555cc1-1eae-520c-189e-28548904f529",
      "codename": "my_metadata__meta_description"
    }
  ]
}

List content type snippets

Retrieve a dynamically paginated list of content type snippets.
GET
https://manage.kontent.ai/v2/projects/{environment_id}/snippets

Request

Path parameters

environment_id
required · string
Identifies your environment.

Header parameters

x-continuation
string
Determines the page of results to retrieve.To get the next page of results, check the pagination object in the API response and set the x-continuation header parameter to the value of the continuation_token property.

Request samples

TypeScript
C#
cURL
// Tip: Find more about JS/TS SDKs at https://kontent.ai/learn/javascript
import { ManagementClient } from '@kontent-ai/management-sdk';

const client = new ManagementClient({
  environmentId: 'KONTENT_AI_ENVIRONMENT_ID',
  apiKey: 'KONTENT_AI_MANAGEMENT_API_KEY',
});

// Gets the first page of results
const response = await client.listContentTypeSnippets().toPromise();

// Gets all pages of results
// const response = await client.listContentTypeSnippets()
//   .toAllPromise();

Response

Status (200)
A dynamically paginated list of content type snippets.
snippets[]
required · array

Show child attributes
pagination
required · object
Information about the next page of results.
Show child attributes

Example responses

200
400
{
  "snippets": {
    "id": "baf884be-531f-441f-ae88-64205efdd0f6",
    "codename": "my_metadata",
    "last_modified": "2019-10-20T12:03:17.4685693Z",
    "name": "My metadata",
    "elements": [
      {
        "name": "Meta title",
        "guidelines": "Length: 30–60 characters",
        "is_non_localizable": false,
        "type": "text",
        "id": "09398b24-61ed-512e-5b5c-affd54a098e5",
        "codename": "my_metadata__meta_title"
      },
      {
        "name": "Meta description",
        "guidelines": "Length: 70–150 characters",
        "is_non_localizable": false,
        "type": "text",
        "id": "2e555cc1-1eae-520c-189e-28548904f529",
        "codename": "my_metadata__meta_description"
      }
    ],
    "external_id": "my-valuable-metadata"
  },
  "pagination": {
    "continuation_token": "W3sidG9rZW4iOiIrUklEOn...",
    "next_page": "https://manage.kontent.ai/v2/your/chosen/list/endpoint"
  }
}

Modify a content type snippet

Modify how existing content type snippets and their elements are set up.You can modify the content type snippets and their element configuration using the following operations:
  • addInto operation to add new objects. For example, add an element to the content type snippet, or add a multiple choice element option.
  • move operation to reorder objects. For example, change the position of an element within the content type snippet or the position of a multiple choice element option.
  • remove operation to delete objects. For example, delete an element from the content type snippet, or delete a specific multiple choice element option.
  • replace operation to update values. For example, replace the value of a specific object property such as a codename.
To apply the operations on the snippet's elements, you need to specify a path to the element or its property using a {path_reference}. Path references can use internal IDs, codenames, or external IDs.
  • id:5eb3d03e-c69d-4e93-b4cc-76f453271386
  • codename:snippet_codename__my_text_element
  • external_id:id_from_external_source – Special characters such as slashes (/) need to be escaped. For example, to reference an object using its external ID of my/value, you use a path reference of external_id:my\\/value.
PATCH
https://manage.kontent.ai/v2/projects/{environment_id}/snippets/{snippet_identifier}

Request

Path parameters

environment_id
required · string
Identifies your environment.
snippet_identifier
required · string
Identifies a specific content type snippet by its internal ID (e.g., baf884be-531f-441f-ae88-64205efdd0f6), external ID (e.g., external-id/snippet-type-123), or codename (e.g., codename/metadata).

Body schema

Application/json

The operations to perform on the specified content type snippet and its elements.

array


Any of:
SnippetOperationAddInto
SnippetOperationMove
SnippetOperationRemove
SnippetOperationReplace
SnippetOperationAddInto
op
required · string
Specifies the operation to perform.
  • addInto to add new objects
  • move to reorder objects
  • remove to delete objects
  • replace to modify object properties
path
string · write-only
Specifies where to add the new object or property. The exact path depends on what you are trying to add and where. For example, if you want to add a property to an element, you need to provide a {path_reference} for the element.
  • To add a new element, set path to /elements.
  • To add an allowed content type to a rich text or linked items element, set path to /elements/{path_reference}/allowed_content_types.
  • To add an allowed element to a custom element, set path to /elements/{path_reference}/allowed_elements.
  • To add a new multiple choice option, set path to /elements/{path_reference}/options.
value
required · nestedSchema
The object to add. The value depends on the selected path:
  • To add a new element, use a content element object.
  • To add an allowed content type to a rich text or linked items element, use a reference object that points to a specific content type.
  • To add an allowed element to a custom element, use a reference object that points to the specific element with this content type snippet.
  • To add an option to a multiple choice element, use an option object.
  • To add an allowed block, text block, or text formatting to a rich text element, use an array of strings to specify its value.
You cannot add a URL slug element, subpages element, or another content type snippet element as new objects into content type snippets.
Any of:
Asset element
Custom element
Date & time element
Guidelines element
Linked items element
Multiple choice element
MultipleChoiceOption
Number element
Rich text element
Taxonomy element
Text element
Asset element
name
required · string · 1-50 chars
The element's display name.
type
required · string
The element's type.
codename
string · 1-60 chars
The element's codename. Unless specified, initially generated from the element's name.
external_id
string
The element's external ID.
guidelines
string · nullable
The element's guidelines, providing instructions on what to fill in.
asset_count_limit
nestedSchema
Specifies the limitation for the number of assets allowed within the element.
value
required · number · int32
Specifies the image size, or how many objects can be used within the element.
condition
required · string
Specifies how to apply the value.
maximum_file_size
number · nullable · int32
Specifies the maximum file size in bytes.
allowed_file_types
string
Specifies the allowed file types.
image_width_limit
nestedSchema · nullable
Specifies the width limitation for the asset.
value
required · number · int32
Specifies the image size, or how many objects can be used within the element.
condition
required · string
Specifies how to apply the value.
image_height_limit
nestedSchema · nullable
Specifies the height limitation for the asset.
value
required · number · int32
Specifies the image size, or how many objects can be used within the element.
condition
required · string
Specifies how to apply the value.
is_required
boolean
Determines whether the element must be filled in.
is_non_localizable
boolean
Determines whether the element uses the same value in all languages.
default
object · nullable
Specifies the element's initial value.
Renditions are currently not supported in the default value.
Show child attributes
content_group
nestedSchema
Reference to the content group the element is used in.The content_group property is present only if one or more content groups are defined in the content type.
id
string · uuid
The referenced object's internal ID.
codename
string · write-only
The referenced object's codename. The value of the codename property must meet the conditions defined in rules for codenames.
external_id
string · write-only
The referenced object’s external ID. The value of the external_id property must not contain the following characters: /, ., ;.
before
object
Reference to a specific object in the environment.
The API uses internal IDs for referencing objects. This means that the reference objects in the API responses will always use internal IDs.
Show child attributes
after
object
Reference to a specific object in the environment.
The API uses internal IDs for referencing objects. This means that the reference objects in the API responses will always use internal IDs.
Show child attributes

Request samples

Payload
TypeScript
C#
cURL
// Tip: Find more about JS/TS SDKs at https://kontent.ai/learn/javascript
import { ManagementClient } from '@kontent-ai/management-sdk';

const client = new ManagementClient({
  environmentId: 'KONTENT_AI_ENVIRONMENT_ID',
  apiKey: 'KONTENT_AI_MANAGEMENT_API_KEY',
});

const response = await client
  .modifyContentTypeSnippet()
  .byTypeId('269202ad-1d9d-47fd-b3e8-bdb05b3e3cf0')
  // .byTypeCodename('hosted_video')
  // .byTypeExternalId('snippet-type-123')
  .withData([
    {
      op: 'replace',
      path: '/name',
      value: 'A new snippet name',
    },
    {
      op: 'replace',
      path: '/elements/codename:my_metadata__my_meta_description/guidelines',
      value: 'Length: 70-150 characters.',
    },
    {
      op: 'addInto',
      path: '/elements',
      value: {
        name: 'My meta title',
        type: 'text',
        guidelines: 'Length: 30–60 characters.',
        external_id: 'my-meta-title-id',
      },
    },
    {
      op: 'remove',
      path: '/elements/id:0b2015d0-16ae-414a-85f9-7e1a4b3a3eae',
    },
    {
      op: 'remove',
      path: '/elements/external_id:my_multiple_choice/options/codename:my_option',
    },
  ])
  .toPromise();

Response

Status (200)
The modified content type snippet and its metadata.
id
string · read-only · uuid
Unique internal identifier of the content type snippet.
codename
string · 1-50 chars
The content type snippet's codename. Unless set while creating the content type snippet, it is initially generated from the snippet's name and can later be modified.
last_modified
string · read-only · date-time
ISO-8601 formatted date and time of the last content type snippet change.
name
required · string · 1-50 chars
Display name of the content type snippet.
elements[]
required · array · unique items
Elements within the snippet.

Any of:
Asset element in snippet
Custom element in snippet
Date & time element in snippet
Guidelines element in snippet
Linked items element in snippet
Multiple choice element in snippet
Number element in snippet
Taxonomy element in snippet
Text element in snippet
Rich text element in snippet
Asset element in snippet
name
required · string · 1-50 chars
The element's display name.
type
required · string
The element's type.
id
string · read-only
The element's internal ID.
codename
string · 1-60 chars
The element's codename. Unless specified, initially generated from the element's name.
external_id
string
The element's external ID.
guidelines
string · nullable
The element's guidelines, providing instructions on what to fill in.
asset_count_limit
nestedSchema
Specifies the limitation for the number of assets allowed within the element.
value
required · number · int32
Specifies the image size, or how many objects can be used within the element.
condition
required · string
Specifies how to apply the value.
maximum_file_size
number · nullable · int32
Specifies the maximum file size in bytes.
allowed_file_types
string
Specifies the allowed file types.
image_width_limit
nestedSchema · nullable
Specifies the width limitation for the asset.
value
required · number · int32
Specifies the image size, or how many objects can be used within the element.
condition
required · string
Specifies how to apply the value.
image_height_limit
nestedSchema · nullable
Specifies the height limitation for the asset.
value
required · number · int32
Specifies the image size, or how many objects can be used within the element.
condition
required · string
Specifies how to apply the value.
is_required
boolean
Determines whether the element must be filled in.
is_non_localizable
boolean
Determines whether the element uses the same value in all languages.
default
object · nullable
Specifies the element's initial value.
Renditions are currently not supported in the default value.
Show child attributes
external_id
string
The content type snippet's external ID. Only present if defined when adding the snippet.

Example responses

200
400
404
{
  "id": "c8fcc464-b937-4558-a386-c1e25aa93813",
  "codename": "my_metadata_snippet",
  "last_modified": "2019-08-06T09:19:12.241774Z",
  "external_id": "my-metadata-snippet-id",
  "name": "A new snippet name",
  "elements": [
    {
      "maximum_text_length": {
        "value": 150,
        "applies_to": "characters"
      },
      "name": "My meta description",
      "guidelines": "Length: 70-150 characters.",
      "is_required": false,
      "is_non_localizable": false,
      "type": "text",
      "id": "f79ad793-b01d-42b0-b06c-7043cd9b6f31",
      "codename": "my_metadata_snippet__my_meta_description"
    },
    {
      "maximum_text_length": null,
      "name": "My meta title",
      "guidelines": "Length: 30–60 characters.",
      "is_required": false,
      "is_non_localizable": false,
      "type": "text",
      "external_id": "my-meta-title-id",
      "id": "0eb2bcda-5b9f-4425-b9e1-c7679356e456",
      "codename": "my_metadata_snippet__my_meta_title"
    },
    {
      "mode": "single",
      "options": [
        {
          "id": "8e6ec8b1-6510-4b9b-b4be-6c977f4bdfbc",
          "codename": "another_multiple_choice_option",
          "name": "Another multiple choice option"
        },
        {
          "id": "6bfe5a60-5cc2-4303-8f72-9cc53431046b",
          "codename": "my_other_multiple_choice_option",
          "name": "My other multiple choice option"
        }
      ],
      "name": "My multiple choice",
      "guidelines": null,
      "is_required": false,
      "is_non_localizable": false,
      "id": "fcc30f1e-9abf-41da-8693-ed89f3be438d",
      "codename": "my_metadata_snippet__my_multiple_choice",
      "type": "multiple_choice",
      "external_id": "my-multiple-choice-id"
    }
  ]
}

Delete a content type snippet

Delete an unused content type snippet.
DELETE
https://manage.kontent.ai/v2/projects/{environment_id}/snippets/{snippet_identifier}

Request

Path parameters

environment_id
required · string
Identifies your environment.
snippet_identifier
required · string
Identifies a specific content type snippet by its internal ID (e.g., baf884be-531f-441f-ae88-64205efdd0f6), external ID (e.g., external-id/snippet-type-123), or codename (e.g., codename/metadata).

Request samples

TypeScript
C#
cURL
// Tip: Find more about JS/TS SDKs at https://kontent.ai/learn/javascript
import { ManagementClient } from '@kontent-ai/management-sdk';

const client = new ManagementClient({
  environmentId: 'KONTENT_AI_ENVIRONMENT_ID',
  apiKey: 'KONTENT_AI_MANAGEMENT_API_KEY',
});

const response = await client
  .deleteContentTypeSnippet()
  .byTypeId('baf884be-531f-441f-ae88-64205efdd0f6')
  // .byTypeCodename('metadata')
  // .byTypeExternalId('snippet-type-123')
  .toPromise();

Response

Status (204)
The specified snippet was deleted.
Empty response

Example responses

400
404
{
  "request_id": "|e7fd2e620a1e6445ab42f555d8fd7b6f.1c90015b_",
  "error_code": 0,
  "message": "Type 'Metadata (baf884be-531f-441f-ae88-64205efdd0f6)' is still used and cannot be archived."
}
Copyright © 2025 Kontent.ai. All rights reserved.
  • Web
  • Privacy policy
  • Cookies policy
  • Consent settings
  • Security
  • GDPR