# Rich text block

Displays formatted, structured text — styled runs, lists, quotes, code — built from rich text elements.

| | |
|---|---|
| **Type** | `rich_text` |
| **Available in** | Messages, Modals, Home tab |
| **Compatible block elements** | [Rich text section element](https://workstation.repzo.com/docs/developers/block-kit/rich-text/rich-text-section-element), [Rich text list element](https://workstation.repzo.com/docs/developers/block-kit/rich-text/rich-text-list-element), [Rich text preformatted element](https://workstation.repzo.com/docs/developers/block-kit/rich-text/rich-text-preformatted-element), [Rich text quote element](https://workstation.repzo.com/docs/developers/block-kit/rich-text/rich-text-quote-element) |

## Usage

This is the format chat messages are written in, and what a [rich text input](https://workstation.repzo.com/docs/developers/block-kit/elements/rich-text-input-element) returns. Elements nest: a list holds sections, and a section holds text, links, emoji, mentions and dates.

## Fields

| Field | Type | Description | Required? |
|---|---|---|---|
| `type` | String | The type of block. For a rich text block, `type` is always `rich_text`. | Required |
| `elements` | Object[] | An array of [`rich_text_section`](https://workstation.repzo.com/docs/developers/block-kit/rich-text/rich-text-section-element), [`rich_text_list`](https://workstation.repzo.com/docs/developers/block-kit/rich-text/rich-text-list-element), [`rich_text_preformatted`](https://workstation.repzo.com/docs/developers/block-kit/rich-text/rich-text-preformatted-element) and [`rich_text_quote`](https://workstation.repzo.com/docs/developers/block-kit/rich-text/rich-text-quote-element) elements. | Required |
| `block_id` | String | A unique identifier for the block. Maximum length is 255 characters. It must be unique within the message or view — a duplicate is replaced and reported as a warning. | Optional |

> **How Repzo Chat differs from Slack**
>
> - `usergroup` elements show the name of the Repzo department with that id.

## Examples

### Styled text, a list and a link

```json
{
  "blocks": [
    {
      "type": "rich_text",
      "elements": [
        {
          "type": "rich_text_section",
          "elements": [
            {
              "type": "text",
              "text": "Handover for "
            },
            {
              "type": "text",
              "text": "Gulf Retail Co. ",
              "style": {
                "bold": true
              }
            },
            {
              "type": "emoji",
              "name": "package"
            }
          ]
        },
        {
          "type": "rich_text_list",
          "style": "bullet",
          "elements": [
            {
              "type": "rich_text_section",
              "elements": [
                {
                  "type": "text",
                  "text": "Delivery window: 08:00–12:00"
                }
              ]
            },
            {
              "type": "rich_text_section",
              "elements": [
                {
                  "type": "text",
                  "text": "Ask for the store manager at the loading bay"
                }
              ]
            },
            {
              "type": "rich_text_section",
              "elements": [
                {
                  "type": "link",
                  "url": "https://example.com/orders/SO-2041",
                  "text": "Order SO-2041"
                }
              ]
            }
          ]
        }
      ]
    }
  ]
}
```

### A quote and a code block

```json
{
  "blocks": [
    {
      "type": "rich_text",
      "elements": [
        {
          "type": "rich_text_quote",
          "elements": [
            {
              "type": "text",
              "text": "The terminal shows error E-104 after the latest update."
            }
          ]
        },
        {
          "type": "rich_text_preformatted",
          "elements": [
            {
              "type": "text",
              "text": "device_id=POS-X2-00917\nfirmware=4.2.1\nerror=E-104"
            }
          ]
        }
      ]
    }
  ]
}
```

## Related

- [Blocks](https://workstation.repzo.com/docs/developers/block-kit/blocks)
- [Block Kit overview](https://workstation.repzo.com/docs/developers/block-kit)
