Content types
Content type object
systemrequired · object
The content type's system properties.
Show child attributes
<element_codename>object
A list of elements that define the content type.
Order may not match the order in UIThe order of the elements in the API response might not match their order in the UI.
Show child attributes
JSON
{
"system": {
"id": "b2c14f2c-6467-460b-a70b-bca17972a33a",
"name": "Article",
"codename": "article",
"last_modified": "2019-10-20T12:03:17.4685693Z"
},
"<element_codename>": {
"multiple_choice": {
"type": "multiple_choice",
"name": "Multiple choices",
"options": [
{
"name": "True",
"codename": "true"
},
{
"name": "False",
"codename": "false"
}
]
},
"text": {
"type": "text",
"name": "Text element"
},
"taxonomy": {
"type": "taxonomy",
"name": "Categories taxonomy",
"taxonomy_group": "categories"
}
}
}List content types
Retrieve a paginated list of content types. By default, the API returns all content types ordered alphabetically by codename.You can customize pagination by specifying both the
skip and limit query parameters.GET
https://deliver.kontent.ai/{environment_id}/typesGET
https://preview-deliver.kontent.ai/{environment_id}/typesRequest
Path parameters
environment_idrequired · string
Identifies your environment.
Query parameters
elementsstring
Determines a subset of the content type's elements to retrieve. The elements are specified using a comma-separated list of element codenames. By default, all elements are retrieved.Examples
- Retrieve a single element –
elements=title - Retrieve multiple elements –
elements=title,summary,related_articles
elements filter applies to all content types within the types array. The filter doesn't apply to the content types' system properties. This means you cannot omit the system object from the response.skipnumber · int32
Sets the number of objects to skip when requesting a list of objects. The
skip parameter must be combined with the limit parameter to work. If skip is not specified, the API returns the first page of results.You can combine the limit and skip parameters to specify page size and page number. For example, using limit=10&skip=10 sets the page size to 10 and gets the second page of results.limitnumber · int32
Sets the number of objects to retrieve in a single request. If the
limit parameter is not specified, the API returns all requested objects by default.If limit is lower than the total number of objects matching your query, the next_page property in the pagination object of the API response will contain a URL to the next page of results.
The limit parameter affects only the number of items in the items property. It doesn't reduce the number of linked items in the modular_content property so you may hit the response size limit unexpectedly. You can set depth=0 to avoid that.Header parameters
X-KC-Wait-For-Loading-New-Contentboolean
Determines whether the API waits while fetching latest content. By default, the header is not set and the API serves stale content (if cached by the CDN) while fetching the new content to minimize wait time.The header can be useful if you know that the requested content had changed since your last request in a reaction to a webhook notification.
Request samples
TypeScript
C#
Java
PHP
Ruby
cURL
// Tip: Find more about JS/TS SDKs at https://kontent.ai/learn/javascript
import { createDeliveryClient } from '@kontent-ai/delivery-sdk';
const deliveryClient = createDeliveryClient({
environmentId: 'KONTENT_AI_ENVIRONMENT_ID',
});
const response = await deliveryClient.types().limitParameter(3).toPromise();
Response
Status (200)
A list of content types.
types[]required · array · unique items
Show child attributes
paginationrequired · object
Information about the current page of results.
Show child attributes
Example responses
200
{
"types": {
"system": {
"id": "b2c14f2c-6467-460b-a70b-bca17972a33a",
"name": "Article",
"codename": "article",
"last_modified": "2019-10-20T12:03:17.4685693Z"
},
"<element_codename>": {
"multiple_choice": {
"type": "multiple_choice",
"name": "Multiple choices",
"options": [
{
"name": "True",
"codename": "true"
},
{
"name": "False",
"codename": "false"
}
]
},
"text": {
"type": "text",
"name": "Text element"
},
"taxonomy": {
"type": "taxonomy",
"name": "Categories taxonomy",
"taxonomy_group": "categories"
}
}
},
"pagination": {
"skip": 20,
"limit": 10,
"count": 10,
"total_count": 0,
"next_page": "https://deliver.kontent.ai/<environment_id>/<resource>?limit=10&skip=30"
}
}Retrieve a content type
Retrieve a specific content type.
GET
https://deliver.kontent.ai/{environment_id}/types/{type_codename}GET
https://preview-deliver.kontent.ai/{environment_id}/types/{type_codename}Request
Path parameters
environment_idrequired · string
Identifies your environment.
type_codenamerequired · string
Identifies the content type by codename.
Query parameters
elementsstring
Determines a subset of the content type's elements to retrieve. The elements are specified using a comma-separated list of element codenames. By default, all elements are retrieved.Examples
- Retrieve a single element –
elements=title - Retrieve multiple elements –
elements=title,summary,related_articles
elements filter applies to all content types within the types array. The filter doesn't apply to the content types' system properties. This means you cannot omit the system object from the response.Header parameters
X-KC-Wait-For-Loading-New-Contentboolean
Determines whether the API waits while fetching latest content. By default, the header is not set and the API serves stale content (if cached by the CDN) while fetching the new content to minimize wait time.The header can be useful if you know that the requested content had changed since your last request in a reaction to a webhook notification.
Request samples
TypeScript
C#
Java
PHP
Ruby
cURL
// Tip: Find more about JS/TS SDKs at https://kontent.ai/learn/javascript
import { createDeliveryClient } from '@kontent-ai/delivery-sdk';
const deliveryClient = createDeliveryClient({
environmentId: 'KONTENT_AI_ENVIRONMENT_ID',
});
const response = await deliveryClient.type('article').toPromise();
Response
Status (200)
A content type object.
systemrequired · object
The content type's system properties.
Show child attributes
<element_codename>object
A list of elements that define the content type.
Order may not match the order in UIThe order of the elements in the API response might not match their order in the UI.
Show child attributes
Example responses
200
404
{
"system": {
"id": "b2c14f2c-6467-460b-a70b-bca17972a33a",
"name": "Article",
"codename": "article",
"last_modified": "2019-10-20T12:03:17.4685693Z"
},
"<element_codename>": {
"multiple_choice": {
"type": "multiple_choice",
"name": "Multiple choices",
"options": [
{
"name": "True",
"codename": "true"
},
{
"name": "False",
"codename": "false"
}
]
},
"text": {
"type": "text",
"name": "Text element"
},
"taxonomy": {
"type": "taxonomy",
"name": "Categories taxonomy",
"taxonomy_group": "categories"
}
}
}Retrieve a content type element
Retrieve a content type element defined in a specific content type. Both the type and element must be specified by their codenames.
GET
https://deliver.kontent.ai/{environment_id}/types/{type_codename}/elements/{element_codename}GET
https://preview-deliver.kontent.ai/{environment_id}/types/{type_codename}/elements/{element_codename}Request
Path parameters
environment_idrequired · string
Identifies your environment.
type_codenamerequired · string
Identifies the content type by codename.
element_codenamerequired · string
Identifies the element by codename within the specified content type.
The element's codename has no relation to the type of the element.
Header parameters
X-KC-Wait-For-Loading-New-Contentboolean
Determines whether the API waits while fetching latest content. By default, the header is not set and the API serves stale content (if cached by the CDN) while fetching the new content to minimize wait time.The header can be useful if you know that the requested content had changed since your last request in a reaction to a webhook notification.
Request samples
TypeScript
C#
Java
PHP
Ruby
cURL
// Tip: Find more about JS/TS SDKs at https://kontent.ai/learn/javascript
import { createDeliveryClient } from '@kontent-ai/delivery-sdk';
const deliveryClient = createDeliveryClient({
environmentId: 'KONTENT_AI_ENVIRONMENT_ID',
});
const response = await deliveryClient.element('article', 'title').toPromise();
Response
Status (200)
A content element object.
nestedSchema
Any of:
Asset element
Custom element
Date & time element
Linked items element
Multiple choice element
Number element
Subpages element
Taxonomy element
Text element
Rich text element
URL slug element
Asset element
typerequired · string
The element's type.
namerequired · string · 1-50 chars
The element's display name.
codenamestring
The element's codename.
Example responses
200
404
Asset element
Custom element
Date & time element
Linked items element
Multiple choice element
Number element
Subpages element
Taxonomy element
Text element
Rich text element
URL slug element
{
"type": "asset",
"name": "Teaser image",
"codename": "teaser_image"
}