List content items
GET https://deliver.kontent.ai/:environment_id/items
Retrieve a list of content items from the specified environment. By default, the API returns an unfiltered paginated list of content items in the default language ordered alphabetically by codename. The response size is limited to 2000 items.
The modular_content object property will contain both components and linked items in the API response. See Linked content and components for more details.
If you need to export all content items, we recommend you enumerate content items.
Get only the items you need
To retrieve specific content items, use the filtering parameters in your requests. For example, you can request items tagged with a taxonomy term, items of a specific type, or items modified in the past three days.
Request Params
| Key | Datatype | Required | Description |
|---|---|---|---|
language | string | Determines which language variant of content items to return. By default, the API returns content in the default language. |
<div class="callout callout--info">
If the requested content is not available in the specified language variant, the API follows the language fallbacks as configured in the Localization settings.</div>
|
| elements | string | | Determines which content elements to retrieve. The elements are specified as 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
Usage notes
- The filter applies to all content items within the response. That is both the
itemsarray andmodular_contentobject property. - If the specified elements don't match the elements present in the content items, the API returns the content items without any elements.
- The filter doesn't apply to content components. For example, if you retrieve only rich text elements, you need complete components used in the rich text to construct the rich text content. |
|
excludeElements| string | | Determines which content elements to exclude. The elements are specified as a comma-separated list of element codenames. By default, all elements are retrieved.
Examples
- Exclude a single element –
excludeElements=title - Exclude multiple elements –
excludeElements=title,summary,related_articles
Usage notes
- The filter applies to all content items within the response. That is both the
itemsarray andmodular_contentobject property. - If the specified elements don't match the elements present in the content items, the API response returns all elements of the content items without any exclusion.
- The filter doesn't apply to content components. For example, if you retrieve only rich text elements, you need complete components used in the rich text to construct the rich text content. |
|
order| string | | Determines the order of the returned content items. By default, the content items are sorted alphabetically by their codenames from A to Z.
To sort the items in a specific order, use the asc and desc modifiers in square brackets. For example, to sort by the value of the Title element in ascending order, use order=elements.title[asc], or to sort by content item codenames in descending order, use order=system.codename[desc].
You can sort by any content item properties in the items array of the API response.
Examples
-
Sort by the date of last modification from oldest to newest –
order=system.last_modified[desc] -
Sort by a content item name from A to Z –
order=system.name[asc] -
Sort by an element value from A to Z –
order=elements.<element_codename>[asc]| |depth| string | | Determines the nesting level for linked content items that the API returns. By default, only the first level of linked items is returned, which is the same as settingdepth=1. -
To include more than one level of linked items in the response, set
depthto2or more. -
To exclude all linked items from the response, set
depthto0.
<div class="callout callout--info">
Components are always present in response. See Linked content and components for more details.</div>
|
| skip | string | | 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. |
| limit | string | | 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. |
| includeTotalCount | string | | Adds the information about the total number of content items matching your query. Only the content filtering parameters affect the resulting number. Other parameters in your query, such as limit, skip, or order, don't have an effect on it.
The number doesn't include linked items returned as part of the modular_content property. For the total number of items returned within the response, see the X-Request-Charge header.
When set to true, the pagination object returned in the API response contains an additional total_count property. |
HEADERS
| Key | Datatype | Required | Description |
|---|---|---|---|
X-KC-Wait-For-Loading-New-Content | string | 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. |
| Accept | string | | |
RESPONSES
status: OK
{"items":[{"system":{"id":"4d4dc14d-8c7c-471f-b797-c6694c604964","name":"About us","codename":"about_us","language":"en-US","type":"article","collection":"default","sitemap_locations":[],"last_modified":"2020-02-17T07:22:51.6711216Z","workflow":"default","workflow_step":"published"},"elements":{"title":{"type":"text","name":"Title","value":"Great news about us"},"body_copy":{"type":"rich_text","name":"Body","images":{},"links":{},"modular_content":["n43768251_0eaa_01f6_69c2_f93047f076e1"],"value":"\u003cp\u003eLorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\u003c/p\u003e\n\u003cobject type=\"application/kenticocloud\" data-type=\"item\" data-rel=\"component\" data-codename=\"n43768251_0eaa_01f6_69c2_f93047f076e1\"\u003e\u003c/object\u003e"},"related_articles":{"type":"modular_content","name":"Related articles","value":["my_article"]},"author":{"type":"modular_content","name":"Author","value":["jenny_brown"]},"url":{"type":"url_slug","name":"URL pattern","value":"great-news-about-us"}}},{"system":{"id":"0afdd600-d6c5-4ac4-bb6b-d2847ca779fe","name":"About us","codename":"about_us_0afdd60","language":"en-US","type":"navigation_item","collection":"default","sitemap_locations":[],"last_modified":"2020-02-04T15:14:48.0057835Z","workflow":"default","workflow_step":"published"},"elements":{"title":{"type":"text","name":"Title","value":"About us"},"url":{"type":"url_slug","name":"URL","value":"about-us"},"subitems":{"type":"modular_content","name":"Subitems","value":["about_us"]}}}],"modular_content":{"about_us":{"system":{"id":"4d4dc14d-8c7c-471f-b797-c6694c604964","name":"About us","codename":"about_us","language":"en-US","type":"article","collection":"default","sitemap_locations":[],"last_modified":"2020-02-17T07:22:51.6711216Z","workflow":"default","workflow_step":"published"},"elements":{"title":{"type":"text","name":"Title","value":"Great news about us"},"body_copy":{"type":"rich_text","name":"Body","images":{},"links":{},"modular_content":["n43768251_0eaa_01f6_69c2_f93047f076e1"],"value":"\u003cobject type=\"application/kenticocloud\" data-type=\"item\" data-rel=\"component\" data-codename=\"n43768251_0eaa_01f6_69c2_f93047f076e1\"\u003e\u003c/object\u003e"},"related_articles":{"type":"modular_content","name":"Related articles","value":["my_article"]},"author":{"type":"modular_content","name":"Author","value":["jenny_brown"]},"url":{"type":"url_slug","name":"URL pattern","value":"great-news-about-us"}}},"jenny_brown":{"system":{"id":"59838cfd-ba15-4607-8e6a-d91931fc7ce6","name":"Jenny Brown","codename":"jenny_brown","language":"en-US","type":"author","collection":"default","sitemap_locations":[],"last_modified":"2020-02-05T11:33:54.5271987Z","workflow":"default","workflow_step":"published"},"elements":{"name":{"type":"text","name":"Name","value":"Jenny Brown"},"bio":{"type":"rich_text","name":"Bio","images":{},"links":{},"modular_content":[],"value":"\u003cp\u003eJenny is here for all things wildlife and, newly, climate changes. Check her out.\u003c/p\u003e"}}},"my_article":{"system":{"id":"29b82988-fb9e-4327-a34b-b568cfaa39e9","name":"My article","codename":"my_article","language":"en-US","type":"article","collection":"default","sitemap_locations":[],"last_modified":"2020-02-03T13:58:21.5779868Z","workflow":"default","workflow_step":"published"},"elements":{"title":{"type":"text","name":"Title","value":"My article"},"body_copy":{"type":"rich_text","name":"Body","images":{},"links":{},"modular_content":[],"value":"\u003cp\u003eLorem ipsum dolor sit amet.\u003c/p\u003e"},"related_articles":{"type":"modular_content","name":"Related articles","value":["about_us"]},"author":{"type":"modular_content","name":"Author","value":["jean_morris"]},"url":{"type":"url_slug","name":"URL pattern","value":"my-article"}}},"n43768251_0eaa_01f6_69c2_f93047f076e1":{"system":{"id":"43768251-0eaa-01f6-69c2-f93047f076e1","name":"43768251-0eaa-01f6-69c2-f93047f076e1","codename":"n43768251_0eaa_01f6_69c2_f93047f076e1","language":"en-US","type":"tweet","collection":"default","sitemap_locations":[],"last_modified":"2020-02-17T07:22:51.6711216Z"},"elements":{"theme":{"type":"multiple_choice","name":"Theme","value":[{"name":"Light","codename":"light"}]},"tweet_link":{"type":"text","name":"Tweet link","value":"https://twitter.com/Kontent_ai/status/1222987911940972545"},"display_options":{"type":"multiple_choice","name":"Display options","value":[{"name":"Hide thread","codename":"hide_thread"}]}}}},"pagination":{"skip":0,"limit":3,"count":3,"next_page":"https://deliver.kontent.ai/8d20758c-d74c-4f59-ae04-ee928c0816b7/items/?limit=3\u0026skip=3"}}