Skip to content

A block of preformatted text, such as code, in a monospace font.

Available in Messages, Modals, Home tab
Used in Rich text block
Field Type Description Required?
type String The type of sub-element; in this case, rich_text_preformatted. Required
elements Object[] An array of text or link elements. Required
border Number Turns a border on (1) or off (0). Optional
language String The language of the code, used for syntax highlighting, e.g. json or python. Optional

A code block — how it renders in Repzo Chat

{
"blocks": [
{
"type": "rich_text",
"elements": [
{
"type": "rich_text_section",
"elements": [
{
"type": "text",
"text": "The webhook payload we received:"
}
]
},
{
"type": "rich_text_preformatted",
"language": "json",
"elements": [
{
"type": "text",
"text": "{\n \"event\": \"invoice.paid\",\n \"invoice\": \"INV-2041\",\n \"amount\": 12450\n}"
}
]
}
]
}
]
}