# Chatbot - How to use WhatsApp API Templates

The **WhatsApp Templates** (also called *template messages*) are pre-approved messages by Meta that allow initiating or resuming conversations with customers outside the 24-hour service window.

They are mainly used for notifications, confirmations, reminders and customer re-engagement in automations or chatbot flows.

{% embed url="<https://youtu.be/XY7XlN-fiZg>" %}

***

## What WhatsApp Templates are

Templates are messages that need to be **created and approved by Meta** before being used.

They allow companies to send messages to a customer even when **there has been no recent interaction**, unlike regular messages that can only be sent within the 24-hour window after the customer's last message.

Examples of use:

* Appointment confirmation
* Order update
* Appointment reminder
* Follow-up message
* Reopening conversation

To create a Template, see the article below:&#x20;

{% content-ref url="/pages/2931613a95d8ec8100532b4f6d6098def1b0c491" %}
[Message Templates - WhatsApp API](/en/topics/relate/message-templates-meta/message-templates-whatsapp-api.md)
{% endcontent-ref %}

***

## When to use a Template

The use of Templates is necessary when:

* The conversation with the customer **has already passed 24 hours since the last received message**
* The company wants to **start a new conversation with the customer**
* It is necessary to send **automatic notifications** via chatbot or automation

Within the 24-hour window, it is also possible to use **Interactive Templates**.

***

## Interactive templates within the 24-hour window

When the conversation is within the **24-hour window**, it is possible to send **templates with interactive buttons**, allowing the customer to choose an option directly in the message.

These buttons make navigation within the chatbot easier and help steer support more quickly.

Example of a message with buttons:

> Hello! How can we help you today?

Buttons:

* Check products
* Talk to an agent
* Track order

By clicking a button, the customer automatically sends the corresponding response to the chatbot.

***

## Use of variable responses with buttons

In chatbot flows, the responses selected in the **interactive buttons** can be used as variables to define the next step of the conversation.

That is, the flow path can **change automatically according to the customer's choice**.

#### Example of operation

Message sent by the chatbot:

> Which information do you want?

Available buttons:

* Products
* Quote
* Support

Flow behavior:

* If the customer clicks on **Products** → the chatbot sends the catalog or product information
* If they click on **Quote** → the flow directs to collecting information for a quote
* If they click on **Support** → the support can be directed to the support team or to another specific flow

Thus, the response chosen by the customer acts as a **variable that defines the automation path**.

***

## Variables in Templates

Templates can also contain **dynamic variables**, used to automatically personalize the message.

Example of template:

```
Hello {{1}}, your order {{2}} has been confirmed and will be delivered on {{3}}.
```

When sending the message, these variables are replaced with specific information about the customer or the process.

Example of sent message:

> Hello João, your order #4587 has been confirmed and will be delivered on 03/10.

This feature allows sending more personalized messages within automated flows.

***

## Templates in automations and chatbots

Templates can be used within:

* **Automation Flows**
* **Chatbots**
* **Automatic follow-ups**
* **System notifications**

This allows messages to be sent automatically according to events, conditions or customer interactions.

***

## Best practices when using Templates

To ensure better performance and avoid rejections by Meta:

* Use clear and objective language
* Avoid excessive promotional messages
* Make sure the customer has authorized receiving messages
* Use variables to personalize messages whenever possible

***


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sprinthub.com/en/topics/convert/chatbot/chatbot-common-questions/chatbot-how-to-use-whatsapp-api-templates.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
