When getting content items or content types, you get the 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.
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.
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.
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.
The element's type.
The element's display name.
The element's value.
The element's type.
The element's display name.
The element's value as a ISO-8601 formatted string. Time in this element is displayed and interpreted as UTC.
The element's type.
The element's display name.
The linked content items as an array of item codenames.
The element's type.
The element's display name.
The element's value as an array of selected multiple choice options.
The element's type.
The element's display name.
The element's value.
Rich text element
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".
The element's type.
The element's display name.
The linked pages as an array of item codenames.
The element's type.
The element's display name.
The codename of a specific taxonomy group that the element is using.
The element's type.
The element's display name.
The element's value.
The element's type.
The element's display name.
The element's value can be either auto-generated from a text element or custom.
The element's value as an array of selected taxonomy terms.
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.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>.
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’s value property. This structure ensures accurate rendering and easy programmatic access to image details.The image assets in the rich text's value 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.
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's value property.The links in the rich text's value are represented by the a HTML tags.
The content items and components inserted in the rich text's value are represented by the object HTML element.For both content items and components, the object HTML element specifies these attributes:
data-type – Its value is item for both content items and components. This lets you use a single method to resolve your items and components.
data-rel – Its value is either link (for content items inserted into rich text) or component (for components inserted into rich text). Use the attribute to differentiate between components and items.
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.
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>
– Its value specifies the codename of the content item or component.
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.
The images inserted into the rich text element. Each image object contains the image's metadata.
The hyperlinks in the text that point to content items. Each link object contains the linked item's metadata.
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.
The element's value. If the rich text element doesn't contain any content, its value defaults to a single empty paragraph: <p><br></p>.
The name of the object represents an image id such as 14mio.
The name of the object represents a content item ID, such as f4b3fc05-e988-4dae-9ac1-a94aba566474.
<!-- 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>
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.
Matching orderThe order of the objects in the array matches the order of the options in the UI.
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.
image_id
required · string · uuid
description
required · string
url
required · string
width
type
required · string
codename
required · string
url_slug
required · string
required · number · int32
height
required · number · int32
Links to content items differ from inserted content items. Links are simple hyperlinks represented by HTML <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.
The image's description in a specific language. Used for the alt attribute of an <img> tag.
The image's absolute URL.
The linked item's content type codename.
The linked item's codename.
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.
The image's width.
The image's height.
Two distinct modular_content properties
The Delivery API responses for getting items contain the modular_content object property. In this property, you'll find the contents of the linked content items and content components.
Rich text element objects contain the modular_content array 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.
Nesting HTML elements in rich textAt the top level, only the following elements are allowed: <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
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}
). 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
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>.