> ## Documentation Index
> Fetch the complete documentation index at: https://docs.prelude.so/llms.txt
> Use this file to discover all available pages before exploring further.

# Rich templates on RCS and WhatsApp

> Send a card with an image or a video, a title, a body and buttons on RCS and WhatsApp, with the plain text as the SMS.

A template variant can hold a **card** in its `rich` field: an image or a video, a title, a body, a footer and buttons. RCS and WhatsApp send the card; SMS sends the variant `text`. Two to ten cards make a carousel the user swipes through.

You send a rich template like any other: the template ID and the values of its variables. The card is filled with the same values.

## `text` and `body`

A rich variant has two texts, for two different places:

| Field | Where it shows |
| - | - |
| `text` | The SMS. Also the message when it falls back to SMS, and, on a WhatsApp carousel, the bubble above the cards. Required on every variant. |
| `rich.cards[].body` | Inside the card, on RCS and WhatsApp only. Leave it out and the card shows the `text`. |

Use `body` only when the card needs a different wording from the SMS, for example a shorter one because the buttons carry the link.

## When to add a card

Add `rich` when the message needs an **image, a video or buttons**. A template without `rich` is sent as a plain message on every channel.

> [!WARNING]
>
> On RCS, a message with a card is billed as a rich message, even when the card holds only text. If a template has no image, video or button, leave `rich` out.

## Card fields

| Field | What it is | Limits |
| - | - | - |
| `media.type` | `image` or `video` | |
| `media.url` | A public https link, or a `{{variable}}` you fill with one when sending | |
| `title` | The bold line above the body | 200 characters on RCS; on WhatsApp 60 without media |
| `body` | The text inside the card | 2,000 characters on RCS, 1,024 on WhatsApp |
| `footer` | A short line under the body, no variables | 60 characters on WhatsApp |
| `buttons[].type` | `url` (opens a link), `call` (calls a number) or `reply` (sends a code back to you) | Up to 4 buttons, at most 2 `url` and 1 `call` |
| `buttons[].label` | The text on the button, no variables | 25 characters |
| `buttons[].url` | For `url`: an https link. On WhatsApp it may end with one `{{variable}}` | |
| `buttons[].phone` | For `call`: a number in E.164 format, such as `+33612345678` | |
| `buttons[].payload` | For `reply`: the code you receive when the user taps it | 256 characters |

The full rules per channel, including carousels, are in [Create a template](https://docs.prelude.so/notify/v2/api-reference/management/templates/create-template.md).

## Example

```json theme={null}
{
  "name": "order_shipped",
  "type": "transactional",
  "channels": ["rcs", "whatsapp", "sms"],
  "default_locale": "en",
  "variants": [{
    "locale": "en",
    "text": "Order {{order_id}} shipped: https://example.com/t/{{order_id}}",
    "rich": {
      "cards": [{
        "media": { "type": "image", "url": "https://cdn.example.com/parcel.png" },
        "title": "Your order is on its way",
        "body": "Order {{order_id}} left our warehouse.",
        "buttons": [
          { "type": "url", "label": "Track order", "url": "https://example.com/t/{{order_id}}" }
        ]
      }]
    }
  }],
  "variable_examples": { "order_id": "A-1001" }
}
```

## WhatsApp

* WhatsApp reviews each template before it can be sent. Set `variable_examples` with one sample value per variable; WhatsApp uses them, and the sample image, for its review.
* A carousel on WhatsApp needs a `marketing` template.
* WhatsApp can approve a `transactional` template as `marketing` when it reads promotional content in it, which changes its price. The `whatsapp.category` of each variant shows the category WhatsApp holds.

## Sending your templates in a file

If you send your templates to your Customer Success Manager in a spreadsheet instead of through the API, use the fields above as columns: one row per card, with `name`, `type`, `locale` and `text`, then `media.type`, `media.url`, `title`, `body`, `footer`, and for each button its `type`, `label` and `url`, `phone` or `payload`. Add one column with a sample value for each variable. For a carousel, put each card on its own row, with the same `name` and `locale`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.