Skip to content

Rich content schema

Instead of plain text, a bot turn can return a rich content payload: a list of components the SDK renders natively. The bot produces this; you rarely author it by hand, but this is the exact shape.

{
"type": "rich_content",
"components": [ /* one or more components, in order */ ]
}

Every component has a type discriminator. Unknown types render as nothing (forward-compatible).

Components

text

Markdown (or plain) text.

FieldTypeDefaultNotes
contentstring—Markdown by default.
formatmarkdown|plainmarkdown

card

Image + title + optional subtitle/description/metadata/actions.

FieldTypeNotes
idstringStable id.
titlestringRequired.
imageRichImageOptional.
subtitlestringOptional.
descriptionstringOptional (clamped to a few lines in carousels).
metadatamap<string,string>e.g. {"price":"$29"}; price/badge get special styling.
actionsRichAction[]Buttons under the card.

Horizontally-paged cards.

FieldTypeNotes
itemsComponent[]Usually cards.
configCarouselConfigautoPlay, autoPlayInterval, showIndicators, itemsVisible, spacing.

product_list

Vertical list/grid of cards.

FieldType
itemsComponent[]
configProductListConfig

image

A standalone image.

FieldTypeNotes
urlstring
altstring?
captionstring?
aspect_ratiostringe.g. 16:9, 1:1. Default 16:9.
actionsRichAction[]Tap actions.
on_tap_callbackOnTapCallback?Fire a host callback on tap instead of the default zoom viewer.

button_group

A row or column of buttons.

FieldTypeNotes
buttonsRichButton[]Each wraps a RichAction.
layouthorizontal|verticalDefault horizontal.

swatch_grid

Colour swatches (e.g. shade pickers), wrapping rows.

FieldTypeNotes
swatchesRichSwatch[]Each: hex, label, optional action.
columnsintDefault 4.

host_slot

A placeholder your app fills with its own native widget. See Host callbacks & actions.

FieldTypeNotes
slot_idstringYour hostSlotBuilder maps this to a widget.
payloadmap?Must fully re-render the slot on history reload — never key on local state.

RichImage

Used by card and (as its own fields) image.

FieldTypeDefaultNotes
urlstring—Empty + loading:true → shimmer placeholder.
altstring?null
aspect_ratiostring16:9width:height.
loadingboolfalseShimmer while an async tool runs; the host swaps in the final URL when done.
on_tap_callbackOnTapCallback?null