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

# Message templates

> Create WhatsApp message templates and use them to message customers outside the 24-hour reply window.

WhatsApp only lets businesses send free-form messages within 24 hours of the customer's last message. After that, you can only reach the customer with a **message template** that Meta has approved, such as an order update, appointment reminder, or announcement.

Templates in Chatling are available for AI agents connected to WhatsApp.

<Note>Meta charges your WhatsApp Business Account for every template message. Make sure a valid payment method is added in [Meta Business Suite](https://business.facebook.com/billing_hub/payment_settings), otherwise templates won't be delivered.</Note>

## What are message templates?

Message templates are pre-approved messages that you can send to customers outside the 24-hour reply window.

WhatsApp only allows free-form replies within 24 hours of the customer's last message. Once that window closes, the only way to message the customer is with a template. When the customer replies, the window reopens and you can chat normally again.

Templates are commonly used for:

* **Follow-ups** — Re-engaging a customer who stopped replying.
* **Order and account updates** — Shipping confirmations, payment receipts, or appointment reminders.
* **Announcements** — New products, offers, or events sent to existing customers.

Each template is reviewed by Meta before it can be sent, which usually takes a few minutes. Templates belong to one of two categories:

* **Utility** — Transactional messages related to an existing order, account, or request.
* **Marketing** — Promotions, announcements, and anything else not tied to a specific transaction.

A template can include a header (text, image, video, or document), a body, a footer, and buttons.

## Open the templates page

1. Go to the `Deploy` page of your AI agent.

<img src="https://chatling-assets.b-cdn.net/open-deploy-page-2610.jpg" width="200" alt="Open the deploy page" />

2. On the WhatsApp card, click `Templates`.

<img src="https://chatling-assets.b-cdn.net/whatsapp-card-templates-button.jpg" width="450" alt="Open the templates page" />

The page lists every template in your WhatsApp Business Account along with its status. Templates created directly in Meta are shown with a `Synced from Meta` label.

<img src="https://chatling-assets.b-cdn.net/how-to-open-whatsapp-templates-page.jpg" width="600" alt="Whatsapp templates page" />

## Create a template

1. Click `+ New template`.

<img src="https://chatling-assets.b-cdn.net/whatsapp-template-new-button.jpg" width="600" alt="Create new whatsapp template" />

2. Fill in the template details:
   * **Name**: Lowercase letters, numbers, and underscores only (e.g. `order_update`).
   * **Category**: `Marketing` for promotions and announcements, or `Utility` for transactional messages like order and account updates.
   * **Language**: The language the template is written in.
   * **Header** (optional): Text (up to 60 characters), an image (JPG or PNG, up to 2 MB), a video (MP4, up to 5 MB), or a document (PDF, up to 5 MB).
   * **Body**: The main message, up to 1,024 characters. Use `*bold*`, `_italic_`, and `~strikethrough~` to format text.
   * **Footer** (optional): Short text shown below the body, up to 60 characters.
   * **Buttons** (optional): Up to 3 quick reply buttons, 2 website buttons, and 1 phone number button. Keep quick reply buttons together, either before or after the other buttons.

<img src="https://chatling-assets.b-cdn.net/whatsapp-template-editor.jpg" width="600" alt="Whatsapp template editor" />

3. Add a sample value for each variable. Meta uses these to review your template, so don't include real customer data.
4. Click `Submit for review`.

The live preview on the right shows how the message will look on WhatsApp.

### Using variables

Type `{{` in the header, body, or a website button's URL to insert one of your AI agent's variables, such as `{{contact_fname}}`. The value is filled in each time the template is sent.

* The header can contain at most one variable.
* The body can't start or end with a variable.
* A website button's URL can contain one variable, at the very end (e.g. `https://example.com/orders/{{order_id}}`).
* The footer, button text, quick reply buttons, and phone number buttons can't contain variables.

## Template statuses

| Status | Meaning |
| - | - |
| In review | Meta is reviewing the template. This can take anywhere from a few minutes up to 24 hours. |
| Approved | The template can be sent. |
| Rejected | Meta didn't approve the template. Open it to see the reason, then edit and resubmit. |
| Paused | Meta paused the template because of negative customer feedback. |
| Disabled | Meta disabled the template after repeated quality issues. |

Statuses update automatically when Meta reviews or changes a template.

## Send a template from a conversation

1. Open a WhatsApp conversation in the `Conversations` page.
2. Click the `WhatsApp templates` icon in the reply box.
3. Select an approved template.
4. Fill in the variables. Values already known for the conversation, such as the customer's name, are filled in automatically.
5. If the template has a media header, optionally upload a different file. Otherwise, the template's default file is used.
6. Click `Send template`.

The template appears in the conversation thread. When the customer replies, the 24-hour window reopens and you can send regular messages again.

## Send a template from a workflow

Use the `Send WhatsApp template` action in a [workflow](/ai-agent/workflows/overview) to send templates automatically, for example a follow-up a day after a conversation ends.

1. Add the `Send WhatsApp template` action and select an approved template.
2. Fill in each variable with fixed text or workflow variables.
3. Use the `Success` and `Failed` paths to decide what happens next. If sending fails, the reason from WhatsApp is shown in the workflow's run history.

<Info>The action only runs for WhatsApp conversations. For conversations on other channels, the step is skipped and the workflow continues.</Info>

## Troubleshooting

* **Template not delivered due to a payment issue**: Add or update the payment method for your WhatsApp Business Account in [Meta Business Suite](https://business.facebook.com/billing_hub/payment_settings).
* **Meta isn't accepting changes to this template right now**: You've reached Meta's edit limit for approved templates. Try again later, or duplicate the template under a new name.
* **A template named ... already exists**: Template names must be unique per language. Use a different name, or wait 30 days if the template was recently deleted.


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