Content elements
elements object property as part of the retrieved item or type.Each element in elements contains the properties type, name, and value. Certain elements, such as rich text or taxonomy, can contain additional properties.
Asset element
typerequired · string
The element's type.
namerequired · string · 1-50 chars
The element's display name.
value[]required · array
The assets inserted into the element. The asset objects are returned in the same order as shown in the UI.Some of the properties are specific to images only:
width and height represent the image’s width and height dimensions, and the renditions object contains details about customized images.
To display customized images on the website or an app, you first need to apply custom query parameters to the asset’s original URL.Show child attributes
JSON
{
"type": "asset",
"name": "Teaser image",
"value": {
"name": "sources.jpg",
"type": "image/jpeg",
"size": 45376,
"description": "Description of what the asset represents.",
"url": "https://assets-us-01.kc-usercontent.com/975bf280-fd91-488c-994c-2f04416e5ee3/3e76909f-599f-4742-b472-77fd4b510e92/sources.jpg",
"width": 640,
"height": 457,
"renditions": {
"default": {
"rendition_id": "85e77523-767b-487e-9be8-78fb0e917b96",
"preset_id": "a6d98cd5-8b2c-4e50-99c9-15192bce2490",
"width": 420,
"height": 451,
"query": "w=420&h=451&fit=clip&rect=0,0,420,451"
}
}
}
}Content type snippet element
The Content type snippet elements are expanded into the elements that they contain. You can recognize the expanded elements by their codenames, which use the following format:
<content_type_snippet_codename>__<content_element_codename>.For example, when you retrieve an item that uses a snippet element with 2 elements, the snippet itself will be structured as the 2 elements, without any encapsulation.JSON
{
"seo_metadata__meta_keywords": {
"type": "text",
"name": "Meta keywords",
"value": "AI agents, workflow automation"
},
"seo_metadata__meta_description": {
"type": "text",
"name": "Meta description",
"value": "Learn how AI agents can streamline your content workflows."
}
}Custom element
Create your own custom elements or discover existing custom elements built by the community
.
typerequired · string
The element's type.
namerequired · string · 1-50 chars
The element's display name.
valuerequired · string · nullable · 1-100000 chars
The element's value.
JSON
{
"type": "custom",
"name": "Markdown editor",
"value": "# Heading\n\nPlaintext\n\n[link](https://example.com)"
}Date and time element
typerequired · string
The element's type.
namerequired · string · 1-50 chars
The element's display name.
display_timezonestring · nullable
IANA time zone name
used to display time offset of the date & time element in the UI.The time zone doesn't modify the date specified in the
value property.
Obsolete values: "America/Ojinaga", "America/Scoresbysund", "Antarctica/Vostok", "Asia/Aqtobe", "Asia/Qyzylorda", "Europe/Kiev".Default value:
nullJSON
{
"type": "date_time",
"name": "Post date",
"value": "2019-08-26T13:56:37.7643832Z",
"display_timezone": "Europe/London"
}Linked items element
typerequired · string
The element's type.
namerequired · string · 1-50 chars
The element's display name.
value[]required · array · unique items
The linked content items as an array of item codenames.
Matching orderThe order of the codenames in the array matches the order of the content items in the UI. The content of these items can be found in the
modular_content property (where the items are not ordered) of the API response when getting content items.JSON
{
"type": "modular_content",
"name": "Author",
"value": [
"author_item_codename"
]
}Multiple choice element
typerequired · string
The element's type.
namerequired · string · 1-50 chars
The element's display name.
value[]required · array · unique items
The element's value as an array of selected multiple choice options.
Matching orderThe order of the objects in the array matches the order of the options in the UI.
Show child attributes
JSON
{
"type": "multiple_choice",
"name": "The Earth is flat",
"value": [
{
"name": "False",
"codename": "false"
}
]
}Number element
typerequired · string
The element's type.
namerequired · string · 1-50 chars
The element's display name.
valuerequired · number · nullable · Floating-point number
The element's value.
JSON
{
"type": "number",
"name": "Days since last accident",
"value": 7
}Rich text overview
The rich text element supports formatted content with embedded images, links, and modular content. The following sections describe the element structure and the format of embedded content.Rich text element
In addition to formatted text, the rich text element's
value property can contain objects representing images, components, and content items.Information about these objects is stored in separate properties:
images– contains metadata about the assets used in the rich text.links– contains metadata about the content items linked in the rich text.modular_content– contains metadata about the linked items and components inserted in the rich text.
typerequired · string
The element's type.
namerequired · string · 1-50 chars
The element's display name.
<image_id>object
The images inserted into the rich text element. Each image object contains the image's metadata.
Show child attributes
<content_item_id>object
The hyperlinks in the text that point to content items. Each link object contains the linked item's metadata.
Show child attributes
modular_content[]required · array · unique items
Contains codenames of the components and content items (not their contents) inserted into the rich text element.To get the contents of the inserted components and items, see how to retrieve linked content.
Two distinct
modular_content properties- The Delivery API responses for getting items contain the
modular_contentobject property. In this property, you'll find the contents of the linked content items and content components. - Rich text element objects contain the
modular_contentarray property. In this property, you'll find only the codenames of the inserted content items and content components. These codenames are grouped and ordered. First comes a group of content item codenames followed by a group of component codenames. The order of codenames in each group matches that in the UI.
valuerequired · string · max. 100000 chars
The element's value. If the rich text element doesn't contain any content, its value defaults to a single empty paragraph:
Nesting HTML elements in rich textAt the top level, only the following elements are allowed:
<p><br></p>.<p>, <h1>, <h2>, <h3>, <h4>, <h5>, <h6>, <ul>, <ol>, <table>, <object> (for content items and components), and <figure> (for images). These top-level elements can NOT be nested except for lists (<ul> and <ol>). Text is not allowed at the top level with the exception of new lines and white space characters.
The table <td> element can alternatively contain top level elements except for <table> and <object>.
The <p>, <h1>, <h2>, <h3>, <h4>, <h5>, <h6>, <li>, and <td> elements can contain text and the following inline elements: <a>, <code>, <em>, <strong>, <sub>, <sup>. These elements can also contain <br/> elements for specifying line breaks.
The <a>, <code>, <em>, and <strong> inline elements can be nested but they cannot cross one another. For example, it's not allowed to open the <em> element, then the <strong> element, and then close the <em> element. Lists can be nested as long as the nested list (<ul> or <ol>) is the last HTML element of the list item, for example, <ol><li>List item<ul><li>Nested list item</li></ul></li></ol>.JSON
{
"type": "rich_text",
"name": "Rich text showcase",
"<image_id>": {
"66d73245-10e5-4478-93e7-5609fee3cdf7": {
"image_id": "66d73245-10e5-4478-93e7-5609fee3cdf7",
"description": null,
"url": "https://assets-us-01.kc-usercontent.com:443/38af179c-40ba-42e7-a5ca-33b8cdcc0d45/66d73245-10e5-4478-93e7-5609fee3cdf7/image.jpg",
"width": 600,
"height": 457
}
},
"<content_item_id>": {
"ef23e568-6aa2-42cd-a120-7823c0ef19f7": {
"codename": "content_item_codename",
"type": "article",
"url_slug": "my-article"
}
},
"modular_content": [
"content_item_codename",
"n26275539_7e71_01ce_ee08_e55340bb9ea6"
],
"value": "<p>Basic formatted text: plain text, <strong>bold</strong>, <em>italics</em>, <code>monospace</code>, <sub>subscript</sub>, <sup>superscript</sup>.</p>\n<p>Links: <a data-item-id=\"ef23e568-6aa2-42cd-a120-7823c0ef19f7\" href=\"\">link to a content item</a>, <a href=\"https://kontent.ai/\" data-new-window=\"true\" target=\"_blank\" rel=\"noopener noreferrer\">link to web URL</a>, <a data-email-address=\"sales@kontent.ai\" href=\"mailto:sales@kontent.ai\">email link</a>, <a data-asset-id=\"237362b4-5f2b-480e-a1d3-0ad5a6d5f8bd\" href=\"https://assets-us-01.kc-usercontent.com:443/38af179c-40ba-42e7-a5ca-33b8cdcc0d45/237362b4-5f2b-480e-a1d3-0ad5a6d5f8bd/image.jpg\">link to asset</a>.</p>\n<p>Table</p>\n<table><tbody>\n <tr><td>A</td><td>B</td><td>C</td></tr>\n <tr><td>D</td><td>E</td><td>F</td></tr>\n <tr><td>G</td><td>H</td><td>I</td></tr>\n</tbody></table>\n<p>Image</p>\n<figure data-asset-id=\"66d73245-10e5-4478-93e7-5609fee3cdf7\" data-image-id=\"66d73245-10e5-4478-93e7-5609fee3cdf7\"><img src=\"https://assets-us-01.kc-usercontent.com:443/38af179c-40ba-42e7-a5ca-33b8cdcc0d45/66d73245-10e5-4478-93e7-5609fee3cdf7/image.jpg\" data-asset-id=\"66d73245-10e5-4478-93e7-5609fee3cdf7\" data-image-id=\"66d73245-10e5-4478-93e7-5609fee3cdf7\" alt=\"\"></figure>\n<p>Inserted content item</p>\n<object type=\"application/kenticocloud\" data-type=\"item\" data-rel=\"link\" data-codename=\"content_item_codename\"></object>\n<p>Component</p>\n<object type=\"application/kenticocloud\" data-type=\"item\" data-rel=\"component\" data-codename=\"n26275539_7e71_01ce_ee08_e55340bb9ea6\"></object>"
}HTML5 elements allowed in rich text
The rich text value can contain specific HTML elements, tags, and attributes, and must form a valid HTML5 fragment. Only the documented HTML attributes are supported. When transforming HTML to JSON, make sure to escape all double quotes.Top-level elements
The following HTML elements must be used at the top level in rich text content. They can also be used within a table cell<td>.
| Types | HTML elements | Notes |
| Paragraphs | <p>...</p> | Can contain text with inline formatting elements. |
| Headings | <h1>...</h1>, <h2>...</h2>, <h3>...</h3>, <h4>...</h4>, <h5>...</h5>, <h6>...</h6> | Can contain text with inline formatting elements. |
| Lists | <ol><li>...</li></ol>, <ul><li>...</li></ul> | Individual list items <li> can contain text with inline formatting elements. |
| Assets | <figure ...><img ...></figure> | |
| Tables | <table><tbody><tr><td>...</td></tr></tbody></table> | The <thead> and <tfoot> tags are not supported.
Individual table cells <td> can contain either text with inline formatting elements or top-level elements.
Nested tables are not supported inside table cells.
|
| Content items and components | <object ...></object> | Content items and components are not supported inside table cells. |
Elements for inline text formatting
The following inline HTML elements can be used within the top-level elements and table cells.| Types | HTML elements | Notes |
| Bold text | <strong>...</strong> | The <b> tag is not supported. |
| Italic text | <em>...</em> | The <i> tag is not supported. |
| Superscript | <sup>...</sup> | Superscript and subscript are mutually exclusive. |
| Subscript | <sub>...</sub> | Superscript and subscript are mutually exclusive. |
| Code | <code>...</code> | |
| Links | <a ...>...</a> | For the list of supported <a> attributes, see Links in rich text. |
| Line breaks | <br/> |
Images in rich text
Images inserted into a rich text element are represented in two ways: as metadata defined by the rich text image object and as HTML markup in the element’svalue property. This structure ensures accurate rendering and easy programmatic access to image details.Rich text image object
The name of the object represents an image id such as
14mio.image_idrequired · string · uuid
The image's ID.
descriptionrequired · string
The image's description in a specific language. Used for the alt attribute of an
<img> tag.urlrequired · string
The image's absolute URL.
widthrequired · number · int32
The image's width.
heightrequired · number · int32
The image's height.
JSON
{
"image_id": "04e4957f-08ed-4329-9c7a-0d7b7c6f3590",
"description": "Person sitting on a wooden pier",
"url": "https://assets-us-01.kc-usercontent.com/8d20758c-d74c-4f59-ae04-ee928c0816b7/6e38c039-ad00-47f3-a584-26252827655a/daylight.jpg",
"width": 4000,
"height": 2525
}Image HTML representation
The image assets in the rich text'svalue are represented by the figure and img HTML tags. These tags include the data-asset-id and data-image-id attributes, which link the HTML markup to the corresponding image asset and its metadata.
HTML
<figure
data-asset-id="66d73245-10e5-4478-93e7-5609fee3cdf7"
data-image-id="66d73245-10e5-4478-93e7-5609fee3cdf7"
>
<img
src="https://assets-us-01.kc-usercontent.com:443/38af179c-40ba-42e7-a5ca-33b8cdcc0d45/66d73245-10e5-4478-93e7-5609fee3cdf7/image.jpg"
data-asset-id="66d73245-10e5-4478-93e7-5609fee3cdf7"
data-image-id="66d73245-10e5-4478-93e7-5609fee3cdf7"
alt=""
/>
</figure>
Links in rich text
Links to content items are stored in the rich text element object under a property named after the content item’s ID. Each entry uses the rich text link object to provide metadata such as codename, type, and URL slug. Other link types (external URLs, assets, email, phone) appear only in the HTML markup in the rich text'svalue property.Rich text link object
The name of the object represents a content item ID, such as
f4b3fc05-e988-4dae-9ac1-a94aba566474.typerequired · string
The linked item's content type codename.
codenamerequired · string
The linked item's codename.
url_slugrequired · string
The linked item's URL slug. If the linked item doesn't use a URL slug element, the
url_slug property's value is an empty string.JSON
{
"type": "article",
"codename": "my_article",
"url_slug": "my-article"
}Link HTML representation
The links in the rich text'svalue are represented by the a HTML tags.
<a> tags and stored under a property named after the content item's ID. Inserted items and components are represented by <object> tags and listed in the rich text’s modular_content array. To retrieve their content, you need to resolve them separately via Delivery API.HTML
<!-- Link to a content item -->
<a
data-item-id="ef23e568-6aa2-42cd-a120-7823c0ef19f7"
href=""
>link to a content item</a
>
<!-- Link to a Web URL with title, set to open in a new window -->
<a
href="https://example.com"
data-new-window="true"
title="Link title"
target="_blank"
rel="noopener noreferrer"
>link to a Web URL that opens in a new window</a
>
<!-- Link to a Web URL without title -->
<a href="https://example.com/">link to a Web URL</a>
<!-- Link to an email address with a subject line -->
<a
data-email-address="full.name@domain.com"
data-email-subject="Hello"
href="mailto:full.name@domain.com?subject=Hello"
>contact me</a
>
<!-- Link to a phone number -->
<a
data-phone-number="+31-682144594"
href="tel:+31-682144594"
>+31-682144594</a
>
<!-- Link to an asset -->
<a
data-asset-id="237362b4-5f2b-480e-a1d3-0ad5a6d5f8bd"
href="https://assets-us-01.kc-usercontent.com:443/38af179c-40ba-42e7-a5ca-33b8cdcc0d45/237362b4-5f2b-480e-a1d3-0ad5a6d5f8bd/image.jpg"
>link to asset</a
>
Content items and components in rich text
The content items and components inserted in the rich text'svalue are represented by the object HTML element.For both content items and components, the object HTML element specifies these attributes:
data-type– Its value isitemfor both content items and components. This lets you use a single method to resolve your items and components.data-rel– Its value is eitherlink(for content items inserted into rich text) orcomponent(for components inserted into rich text). Use the attribute to differentiate between components and items.data-codename– Its value specifies the codename of the content item or component.
HTML
<!-- Inserted content item -->
<object
type="application/kenticocloud"
data-type="item"
data-rel="link"
data-codename="content_item_codename"
></object>
<!-- Inserted component; the component's codename is system-generated -->
<object
type="application/kenticocloud"
data-type="item"
data-rel="component"
data-codename="n249afaaf_1de5_011f_f683_c78fd9ec9d7c"
></object>
Subpages element
This element works with live preview and Web Spotlight enabled.
typerequired · string
The element's type.
namerequired · string · 1-50 chars
The element's display name.
value[]required · array · unique items
The linked pages as an array of item codenames.
Matching orderThe order of the codenames in the array matches the order of the content items in the UI. The content of these items can be found in the
modular_content property (where the items are not ordered) of the API response when getting content items.JSON
{
"type": "modular_content",
"name": "Subpages",
"value": [
"about_us",
"contact"
]
}Taxonomy element
typerequired · string
The element's type.
namerequired · string · 1-50 chars
The element's display name.
taxonomy_grouprequired · string
The codename of a specific taxonomy group that the element is using.
value[]required · array
The element's value as an array of selected taxonomy terms.
Show child attributes
JSON
{
"type": "taxonomy",
"name": "Categories",
"taxonomy_group": "categories",
"value": {
"name": "Technology",
"codename": "technology"
}
}Text element
typerequired · string
The element's type.
namerequired · string · 1-50 chars
The element's display name.
valuerequired · string · nullable · max. 100000 chars
The element's value.
JSON
{
"type": "text",
"name": "Meta keywords",
"value": "donation, charity"
}URL slug element
typerequired · string
The element's type.
namerequired · string · 1-50 chars
The element's display name.
valuerequired · string
The element's value can be either auto-generated from a text element or custom.
JSON
{
"type": "url_slug",
"name": "URL",
"value": "structure-your-content"
}