https://manage.kontent.ai/v2/projects/{environment_id}/typeshttps://manage.kontent.ai/v2/projects/{environment_id}/types/{type_identifier}https://manage.kontent.ai/v2/projects/{environment_id}/typeshttps://manage.kontent.ai/v2/projects/{environment_id}/types/{type_identifier}https://manage.kontent.ai/v2/projects/{environment_id}/types/{type_identifier}environment_idThe content type to be added.
codenameexternal_idnamecontent_groups[]idcodenameexternal_idlast_modifiedenvironment_idtype_identifieridcodenameexternal_idlast_modifiedenvironment_idx-continuationtypes[]environment_idtype_identifierThe operations to perform on the specified content type and its elements.
idcodenameexternal_idlast_modifiedenvironment_idtype_identifierelements[]namecontent_groups[]elements[]namecontent_groups[]elements[]paginationoppathvaluestringArray[]namecontent_groups[]elements[]nametypecodenameexternal_idnametypeidcodenamenametypeidcodenamebeforeafternametypeidcodenameguidelinesasset_count_limitvalueconditionmaximum_file_sizeallowed_file_typesimage_width_limitvalueconditionimage_height_limitvalueconditionis_requiredis_non_localizabledefaultcontent_groupidcodenameexternal_idexternal_idguidelinesasset_count_limitvalueconditionmaximum_file_sizeallowed_file_typesimage_width_limitvalueconditionimage_height_limitvalueconditionis_requiredis_non_localizabledefaultcontent_groupidexternal_idguidelinesasset_count_limitvalueconditionmaximum_file_sizeallowed_file_typesimage_width_limitvalueconditionimage_height_limitvalueconditionis_requiredis_non_localizabledefaultcontent_groupidexternal_idguidelinesasset_count_limitvalueconditionmaximum_file_sizeallowed_file_typesimage_width_limitvalueconditionimage_height_limitvalueconditionis_requiredis_non_localizabledefaultcontent_groupidaddInto operation to add new objects. For example, add an element or content group to the content type, or add an option to a multiple choice element.move operation to reorder objects. For example, change the position of an element or content group within the content type, or the position of a multiple choice element option.remove operation to delete objects. For example, delete an element or content group from the content type, 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.path to the element or content group using a {path_reference}. Path references can use internal IDs, codenames, or external IDs.
id:5eb3d03e-c69d-4e93-b4cc-76f453271386codename:my_text_elementexternal_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.name and can later be modified.name and can later be modified.269202ad-1d9d-47fd-b3e8-bdb05b3e3cf0), external ID (e.g., external-id/Content-Type-123), or codename (e.g., codename/hosted_video).name and can later be modified.x-continuation header parameter to the value of the continuation_token property.269202ad-1d9d-47fd-b3e8-bdb05b3e3cf0), external ID (e.g., external-id/Content-Type-123), or codename (e.g., codename/hosted_video).name and can later be modified.269202ad-1d9d-47fd-b3e8-bdb05b3e3cf0), external ID (e.g., external-id/Content-Type-123), or codename (e.g., codename/hosted_video).content_groups array is empty.content_groups array is empty.content_groups array is empty.{path_reference} for the element.path to /elements.path to /content_groups.path to /elements/{path_reference}/allowed_content_types.path to /elements/{path_reference}/allowed_elements.path:content_groups array is empty.path to /elements/{path_reference}/options.path to /elements/{path_reference}/allowed_blocks.name.idcodenameexternal_idlast_modifiedidnamecodenamenamecontent_groups[]elements[]external_idvalue.value.value.content_group property is present only if one or more content groups are defined in the content type.codename property must meet the conditions defined in rules for codenames.name.value.value.value.content_group property is present only if one or more content groups are defined in the content type.name.value.value.value.content_group property is present only if one or more content groups are defined in the content type.name.value.value.value.content_group property is present only if one or more content groups are defined in the content type.nametypeidcodenameexternal_id property must not contain the following characters: /, ., ;.external_idguidelinesasset_count_limitvalueconditionmaximum_file_sizeallowed_file_typesimage_width_limitvalueconditionimage_height_limitvalueconditionis_requiredis_non_localizabledefaultcontent_groupidcodenameexternal_idname and can later be modified.name.content_groups array is empty.name.value.value.value.content_group property is present only if one or more content groups are defined in the content type.codename property must meet the conditions defined in rules for codenames.external_id property must not contain the following characters: /, ., ;.addInto to add new objectsmove to reorder objectsremove to delete objectsreplace to modify object properties{
"id": "dd1439d5-4ee2-4895-a4e4-5b0d9d8c754e",
"codename": "new_article",
"external_id": "custom-content-type-id",
"last_modified": "2021-06-17T06:28:11.6503569Z",
"name": "Article",
"content_groups": [
{
"id": "00000000-0000-0000-0000-000000000000",
"name": "Content",
"codename": "content"
},
{
"id": "0acae5f5-5479-46e9-aad0-9481abb4dcab",
"name": "Author",
"codename": "author"
},
{
"id": "b619a436-4e27-4cf3-8e42-c54ad9fccef7",
"name": "URL",
"codename": "url"
}
],
"elements": [
{
"snippet": {
"id": "b14f8a4a-229d-4429-9474-4d6b9789cb95"
},
"type": "snippet",
"id": "4e8b4583-f4f9-4db8-b9e5-683a9ed8cac6",
"codename": "snippet_with_title_element",
"is_non_localizable": false,
"content_group": {
"id": "00000000-0000-0000-0000-000000000000"
}
},
{
"maximum_text_length": null,
"maximum_image_size": null,
"allowed_content_types": [
{
"id": "f89956fd-92cc-473f-86bf-7616ffe72f5f"
}
],
"allowed_item_link_types": [],
"image_width_limit": null,
"image_height_limit": null,
"allowed_image_types": "any",
"allowed_blocks": [
"text",
"tables",
"components-and-items"
],
"allowed_formatting": [],
"allowed_text_blocks": [
"paragraph",
"heading-two",
"heading-three",
"heading-four",
"ordered-list",
"unordered-list"
],
"allowed_table_blocks": [
"text"
],
"allowed_table_formatting": [],
"allowed_table_text_blocks": [
"paragraph"
],
"name": "Content",
"guidelines": "Make it snappy.",
"is_required": true,
"is_non_localizable": false,
"type": "rich_text",
"id": "23375e4a-2ed8-42bf-aa3a-dfb32e6a42ec",
"codename": "content",
"content_group": {
"id": "00000000-0000-0000-0000-000000000000"
}
},
{
"item_count_limit": {
"value": 1,
"condition": "at_least"
},
"allowed_content_types": [
{
"id": "9fdd0ca7-e19d-4b83-9631-e9443f0e9d0e"
}
],
"name": "Author",
"guidelines": "Select the author or authors.",
"is_required": true,
"is_non_localizable": false,
"type": "modular_content",
"id": "02249cf0-e9db-4e96-a582-479a2650fbc1",
"codename": "author",
"content_group": {
"id": "0acae5f5-5479-46e9-aad0-9481abb4dcab"
}
},
{
"depends_on": {
"snippet": {
"id": "b14f8a4a-229d-4429-9474-4d6b9789cb95"
},
"element": {
"id": "e44db8df-3795-4455-95ee-d4fe10251371"
}
},
"name": "URL",
"guidelines": "If needed, provide a custom URL slug.",
"is_required": true,
"is_non_localizable": false,
"type": "url_slug",
"id": "4a90f541-2de4-4a69-b1ef-fe53c6abf0f4",
"codename": "url",
"content_group": {
"id": "b619a436-4e27-4cf3-8e42-c54ad9fccef7"
}
}
]
}{
"id": "325107f6-5dfb-21a1-b24e-fa13be1fef1c",
"name": "My first group",
"codename": "my_first_group",
"external_id": "first-group"
}{
"id": "d622fc28-5202-511a-9dbf-a3ee363b6c7c",
"codename": "my_article",
"last_modified": "2019-08-26T08:38:49.7302435Z",
"external_id": "article",
"name": "Article",
"content_groups": [
{
"id": "c2deb028-1bad-5191-952f-ace4b256ba61",
"name": "Article copy",
"codename": "article_copy",
"external_id": "article-copy"
},
{
"id": "46d8c4db-df5c-55ab-887a-458f7ad063a1",
"name": "Author",
"codename": "author"
}
],
"elements": [
{
"maximum_text_length": null,
"name": "Article title",
"guidelines": null,
"is_required": false,
"is_non_localizable": false,
"type": "text",
"id": "e32743cd-7616-4a4a-9948-c9fcb54bff3f",
"codename": "title",
"content_group": {
"id": "c2deb028-1bad-5191-952f-ace4b256ba61"
}
},
{
"maximum_text_length": null,
"maximum_image_size": null,
"allowed_content_types": [],
"allowed_item_link_types": [],
"image_width_limit": null,
"image_height_limit": null,
"allowed_image_types": "any",
"allowed_blocks": [],
"allowed_text_blocks": [],
"allowed_formatting": [],
"allowed_table_blocks": [],
"allowed_table_text_blocks": [],
"allowed_table_formatting": [],
"name": "Article body",
"guidelines": null,
"is_required": false,
"is_non_localizable": false,
"type": "rich_text",
"id": "bbddb422-774c-4226-984d-c15656df6108",
"codename": "body",
"content_group": {
"id": "c2deb028-1bad-5191-952f-ace4b256ba61"
}
},
{
"maximum_text_length": null,
"maximum_image_size": null,
"allowed_content_types": [],
"allowed_item_link_types": [],
"image_width_limit": null,
"image_height_limit": null,
"allowed_image_types": "any",
"allowed_blocks": [
"images",
"text"
],
"allowed_text_blocks": [],
"allowed_formatting": [],
"allowed_table_blocks": [],
"allowed_table_text_blocks": [],
"allowed_table_formatting": [],
"name": "Author bio",
"guidelines": null,
"is_required": false,
"is_non_localizable": false,
"type": "rich_text",
"id": "1c795ec7-368c-4c22-830e-e8b969f596be",
"codename": "bio",
"content_group": {
"id": "46d8c4db-df5c-55ab-887a-458f7ad063a1"
}
}
]
}{
"id": "dd1439d5-4ee2-4895-a4e4-5b0d9d8c754e",
"codename": "new_article",
"external_id": "custom-content-type-id",
"last_modified": "2021-06-17T06:28:11.6503569Z",
"name": "Article",
"content_groups": [
{
"id": "00000000-0000-0000-0000-000000000000",
"name": "Content",
"codename": "content"
},
{
"id": "0acae5f5-5479-46e9-aad0-9481abb4dcab",
"name": "Author",
"codename": "author"
},
{
"id": "b619a436-4e27-4cf3-8e42-c54ad9fccef7",
"name": "URL",
"codename": "url"
}
],
"elements": [
{
"snippet": {
"id": "b14f8a4a-229d-4429-9474-4d6b9789cb95"
},
"type": "snippet",
"id": "4e8b4583-f4f9-4db8-b9e5-683a9ed8cac6",
"codename": "snippet_with_title_element",
"is_non_localizable": false,
"content_group": {
"id": "00000000-0000-0000-0000-000000000000"
}
},
{
"maximum_text_length": null,
"maximum_image_size": null,
"allowed_content_types": [
{
"id": "f89956fd-92cc-473f-86bf-7616ffe72f5f"
}
],
"allowed_item_link_types": [],
"image_width_limit": null,
"image_height_limit": null,
"allowed_image_types": "any",
"allowed_blocks": [
"text",
"tables",
"components-and-items"
],
"allowed_formatting": [],
"allowed_text_blocks": [
"paragraph",
"heading-two",
"heading-three",
"heading-four",
"ordered-list",
"unordered-list"
],
"allowed_table_blocks": [
"text"
],
"allowed_table_formatting": [],
"allowed_table_text_blocks": [
"paragraph"
],
"name": "Content",
"guidelines": "Make it snappy.",
"is_required": true,
"is_non_localizable": false,
"type": "rich_text",
"id": "23375e4a-2ed8-42bf-aa3a-dfb32e6a42ec",
"codename": "content",
"content_group": {
"id": "00000000-0000-0000-0000-000000000000"
}
},
{
"item_count_limit": {
"value": 1,
"condition": "at_least"
},
"allowed_content_types": [
{
"id": "9fdd0ca7-e19d-4b83-9631-e9443f0e9d0e"
}
],
"name": "Author",
"guidelines": "Select the author or authors.",
"is_required": true,
"is_non_localizable": false,
"type": "modular_content",
"id": "02249cf0-e9db-4e96-a582-479a2650fbc1",
"codename": "author",
"content_group": {
"id": "0acae5f5-5479-46e9-aad0-9481abb4dcab"
}
},
{
"depends_on": {
"snippet": {
"id": "b14f8a4a-229d-4429-9474-4d6b9789cb95"
},
"element": {
"id": "e44db8df-3795-4455-95ee-d4fe10251371"
}
},
"name": "URL",
"guidelines": "If needed, provide a custom URL slug.",
"is_required": true,
"is_non_localizable": false,
"type": "url_slug",
"id": "4a90f541-2de4-4a69-b1ef-fe53c6abf0f4",
"codename": "url",
"content_group": {
"id": "b619a436-4e27-4cf3-8e42-c54ad9fccef7"
}
}
]
}{
"types": {
"id": "dd1439d5-4ee2-4895-a4e4-5b0d9d8c754e",
"codename": "new_article",
"external_id": "custom-content-type-id",
"last_modified": "2021-06-17T06:28:11.6503569Z",
"name": "Article",
"content_groups": [
{
"id": "00000000-0000-0000-0000-000000000000",
"name": "Content",
"codename": "content"
},
{
"id": "0acae5f5-5479-46e9-aad0-9481abb4dcab",
"name": "Author",
"codename": "author"
},
{
"id": "b619a436-4e27-4cf3-8e42-c54ad9fccef7",
"name": "URL",
"codename": "url"
}
],
"elements": [
{
"snippet": {
"id": "b14f8a4a-229d-4429-9474-4d6b9789cb95"
},
"type": "snippet",
"id": "4e8b4583-f4f9-4db8-b9e5-683a9ed8cac6",
"codename": "snippet_with_title_element",
"is_non_localizable": false,
"content_group": {
"id": "00000000-0000-0000-0000-000000000000"
}
},
{
"maximum_text_length": null,
"maximum_image_size": null,
"allowed_content_types": [
{
"id": "f89956fd-92cc-473f-86bf-7616ffe72f5f"
}
],
"allowed_item_link_types": [],
"image_width_limit": null,
"image_height_limit": null,
"allowed_image_types": "any",
"allowed_blocks": [
"text",
"tables",
"components-and-items"
],
"allowed_formatting": [],
"allowed_text_blocks": [
"paragraph",
"heading-two",
"heading-three",
"heading-four",
"ordered-list",
"unordered-list"
],
"allowed_table_blocks": [
"text"
],
"allowed_table_formatting": [],
"allowed_table_text_blocks": [
"paragraph"
],
"name": "Content",
"guidelines": "Make it snappy.",
"is_required": true,
"is_non_localizable": false,
"type": "rich_text",
"id": "23375e4a-2ed8-42bf-aa3a-dfb32e6a42ec",
"codename": "content",
"content_group": {
"id": "00000000-0000-0000-0000-000000000000"
}
},
{
"item_count_limit": {
"value": 1,
"condition": "at_least"
},
"allowed_content_types": [
{
"id": "9fdd0ca7-e19d-4b83-9631-e9443f0e9d0e"
}
],
"name": "Author",
"guidelines": "Select the author or authors.",
"is_required": true,
"is_non_localizable": false,
"type": "modular_content",
"id": "02249cf0-e9db-4e96-a582-479a2650fbc1",
"codename": "author",
"content_group": {
"id": "0acae5f5-5479-46e9-aad0-9481abb4dcab"
}
},
{
"depends_on": {
"snippet": {
"id": "b14f8a4a-229d-4429-9474-4d6b9789cb95"
},
"element": {
"id": "e44db8df-3795-4455-95ee-d4fe10251371"
}
},
"name": "URL",
"guidelines": "If needed, provide a custom URL slug.",
"is_required": true,
"is_non_localizable": false,
"type": "url_slug",
"id": "4a90f541-2de4-4a69-b1ef-fe53c6abf0f4",
"codename": "url",
"content_group": {
"id": "b619a436-4e27-4cf3-8e42-c54ad9fccef7"
}
}
]
},
"pagination": {
"continuation_token": "W3sidG9rZW4iOiIrUklEOn...",
"next_page": "https://manage.kontent.ai/v2/your/chosen/list/endpoint"
}
}{
"request_id": "|6374648c6c8f18449b027b68dad7808a.f72d851f_",
"error_code": 0,
"message": "Type 'Article (d622fc28-5202-511a-9dbf-a3ee363b6c7c)' is still used and cannot be archived."
}// 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
.viewContentType()
.byTypeId('269202ad-1d9d-47fd-b3e8-bdb05b3e3cf0')
// .byTypeCodename('hosted_video')
.toPromise();
// 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.listContentTypes().toPromise();
// Gets all pages of results
// const response = await client.listContentTypes()
// .toAllPromise();
{
"id": "2b4aa3ad-f008-45a2-9561-7483557facce",
"codename": "my_article",
"last_modified": "2019-12-11T15:51:52.7389684Z",
"name": "A new type name",
"content_groups": [],
"elements": [
{
"mode": "multiple",
"options": [
{
"id": "d66ffa49-86ff-eeaa-c33b-e5d9eefe8b81",
"codename": "my_other_multiple_choice_option",
"name": "My other multiple choice option"
},
{
"id": "523e6231-8d80-a158-3601-dffde4e64a78",
"codename": "another_multiple_choice_option",
"name": "Another multiple choice option"
}
],
"name": "My multiple choice element",
"guidelines": "",
"type": "multiple_choice",
"id": "87924912-4861-aa84-176a-1eae7b22529b",
"codename": "my_multiple_choice_element",
"external_id": "my-multiple-choice-id",
"is_non_localizable": false
},
{
"name": "My title",
"guidelines": "Title of the article in plain text.",
"type": "text",
"external_id": "my-title-id",
"id": "eacf283d-7e60-57b9-a68e-91180bfebb6d",
"codename": "my_title",
"is_non_localizable": false
},
{
"name": "My text element",
"guidelines": "Here you can tell users how to fill in the element.",
"type": "text",
"id": "116a2441-6441-7124-c85b-46a4fef5dcb9",
"codename": "my_text_element",
"is_non_localizable": false
},
{
"maximum_text_length": null,
"maximum_image_size": null,
"allowed_content_types": [],
"allowed_item_link_types": [],
"image_width_limit": null,
"image_height_limit": null,
"allowed_image_types": "any",
"allowed_blocks": [
"tables"
],
"name": "Rich text",
"guidelines": null,
"is_required": false,
"is_non_localizable": false,
"type": "rich_text",
"id": "e94fab1f-c2c1-4f4a-b36c-3f7a0808d2b8",
"codename": "rich_text"
}
]
}// 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
.deleteContentType()
.byTypeId('269202ad-1d9d-47fd-b3e8-bdb05b3e3cf0')
// .byTypeCodename('hosted_video')
.toPromise();
// Tip: Find more about JS/TS SDKs at https://kontent.ai/learn/javascript
import { ManagementClient, ElementModels } from '@kontent-ai/management-sdk';
const client = new ManagementClient({
environmentId: 'KONTENT_AI_ENVIRONMENT_ID',
apiKey: 'KONTENT_AI_MANAGEMENT_API_KEY',
});
const response = await client
.addContentType()
.withData((builder) => {
return {
name: 'Article',
codename: 'my_article',
external_id: 'article',
content_groups: [
{
name: 'Article copy',
external_id: 'article-copy',
},
{
name: 'Author',
codename: 'author',
},
],
elements: [
builder.textElement({
name: 'Article title',
codename: 'title',
type: ElementModels.ElementType.text,
content_group: {
external_id: 'article-copy',
},
}),
builder.richTextElement({
name: 'Article body',
codename: 'body',
type: ElementModels.ElementType.richText,
content_group: {
external_id: 'article-copy',
},
}),
builder.richTextElement({
name: 'Author bio',
codename: 'bio',
type: ElementModels.ElementType.richText,
allowed_blocks: ['images', 'text'],
content_group: {
codename: 'author',
},
}),
],
};
})
.toPromise();
// 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
.modifyContentType()
.byTypeId('0be13600-e57c-577d-8108-c8d860330985')
// .byTypeCodename('my_article')
// .byTypeExternalId('my-article-id')
.withData([
{
op: 'replace',
path: '/name',
value: 'A new type name',
},
{
op: 'replace',
path: '/elements/codename:my_text_element/guidelines',
value: 'Here you can tell users how to fill in the element.',
},
{
op: 'addInto',
path: '/elements',
value: {
name: 'My title',
type: 'text',
guidelines: 'Title of the article in plain text.',
external_id: 'my-title-id',
},
},
{
op: 'remove',
path: '/elements/id:0b2015d0-16ae-414a-85f9-7e1a4b3a3eae',
},
{
op: 'remove',
path: '/elements/external_id:my-multiple-choice-id/options/codename:my_option',
},
{
op: 'remove',
path: '/elements/id:e94fab1f-c2c1-4f4a-b36c-3f7a0808d2b8/allowed_blocks/text',
},
])
.toPromise();