# Templates

A business can only send message templates when the business does not have an active conversation with the customer. A conversation becomes active when the customer has sent a message to the business in the last 24 hours. [Click here to learn more about conversation windows, and free vs billed messages.](https://docs.360dialog.com/docs/get-started/pricing/free-vs-billed-messaging)

After a template is created or edited, it is automatically submitted to Meta for approval. The template can be used to send messages after Meta's approval. Meta may revoke its approval by disabling the template automatically based on customer feedback. Once disabled, a template cannot be sent in a template message until its quality rating has improved or it no longer violates Meta's [Business and Commerce policies](https://www.whatsapp.com/legal/business-policy/?fbclid=IwAR0DjcZvVN560bFJibrVSmuB47tPI8xAZIe9izHNRLKWB5HlMAi7m1mHpDY).

Each WhatsApp Business Account (WABA) can have up to 250 message templates. That means 250 message template names, and each of them can have multiple language translations. For example, a message template called `hello_world` translated into two languages counts as a single message template in regards to this limit.

## Create and Manage your Template Messages

There are multiple ways to submit a template message for approval and manage your approved templates.

### In the 360Dialog Hub

The Template Management feature in the 360Dialog WABA Management UI supports both text and media templates. See our [Template Message Management ](https://docs.360dialog.com/docs/hub/template-management-ui)documentation.

### In the API

There are multiple ways to submit a Template Message for approval and manage your approved templates. Use the Create new WABA template endpoint to submit new template for approval.&#x20;

You can also retrieve or delete template messages from a specific account.

Some important things to note:

{% hint style="warning" %}
Ensure that your templates meet Facebook's strict [Message Template Guidelines](https://developers.facebook.com/docs/whatsapp/message-templates/guidelines).&#x20;
{% endhint %}

* [x] We support **create**, **edit** and **delete** for templates.&#x20;
* [x] The **Create** API call allows you to add a message template in a specific language.
* [x] The **Edit** API call allows you to edit an existing template.
* [x] The **Delete** API call allows you to delete all translations of a message template you specify by name.&#x20;
* [x] When you create a message template, make sure to be consistent when providing translations.
  * If you don't do that, you might see a `structure unavailable` error and notifications won't be delivered.
  * See the [Why am I seeing 'structure unavailable' errors in my callback or my oncall pager group?](https://developers.facebook.com/docs/whatsapp/faq/#faq_259315284718276) FAQ for more information about this.
* [x] Every template has to be approved by Facebook. You can use your template, as soon as its status changes to `approved`

  This can take up to 48h. If your template is still in status `submitted` after two days, please contact [Help and Support](https://docs.360dialog.com/useful/help-and-support).

To see the different elements that can be used in a Template Message, read [Template Elements](https://docs.360dialog.com/docs/resources/templates/template-elements).\
\
After April 9, 2025 Meta no longer supports `allow_category_change` property. Previously, if set to `true` in a template creation request, this allowed Meta to update a template’s category to `marketing` automatically. This is now the default behaviour.

## Create a template&#x20;

<mark style="color:green;">`POST`</mark> `https://waba-v2.360dialog.io/v1/configs/templates`&#x20;

#### Headers

| Name         | Type   | Description |
| ------------ | ------ | ----------- |
| D360-API-KEY | string |             |

{% tabs %}
{% tab title="200 " %}

```json
{
    "category": "MARKETING",
    "components": [
        {
            "text": "Lorem ipsum dolor sit amet",
            "type": "BODY"
        },
        {
            "format": "TEXT",
            "text": "Lorem ipsum",
            "type": "HEADER"
        },
        {
            "text": "Lorem ipsum",
            "type": "FOOTER"
        },
        {
            "buttons": [
                {
                    "phone_number": "+1(650) 555-1111",
                    "text": "Lorem ipsum",
                    "type": "PHONE_NUMBER"
                },
                {
                    "example": [
                        "https://www.website.com/dynamic-url-example"
                    ],
                    "text": "your-url-button-text",
                    "type": "URL",
                    "url": "https://www.website.com/dynamic-url-example"
                }
            ],
            "type": "BUTTONS"
        }
    ],
    "language": "en_US",
    "name": "template_test_123",
    "namespace": "f65cda29_76cb_af89_cee6_f7f5b2a4006a",
    "rejected_reason": null,
    "status": "submitted"
}
```

{% endtab %}
{% endtabs %}

## Get template list

<mark style="color:blue;">`GET`</mark> `https://waba-v2.360dialog.io/v1/configs/templates`

#### Path Parameters

| Name    | Type    | Description                                                                                                                                                                                   |
| ------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| limit   | integer | default: `1000`                                                                                                                                                                               |
| offset  | integer | default: `0`                                                                                                                                                                                  |
| sort    | string  | Allowed Values: `id`, `name`, `status`                                                                                                                                                        |
| filters | string  | <p>A JSON object of params and their expected values.<br><br><code>id</code>  <code>partner\_id</code>  <code>business\_templates.name</code>  <code>status</code>  <code>category</code></p> |

#### Headers

| Name         | Type   | Description |
| ------------ | ------ | ----------- |
| D360-API-KEY | string |             |

{% tabs %}
{% tab title="200 " %}

```json
{
  "count": 0,
  "filters": [],
  "limit": 1000,
  "offset": 0,
  "sort": ["id"],
  "total": 0,
  "waba_templates": [
    {
      "category": "string",
      "components": [
        {
          "format": "string",
          "type": "string"
        },
        {
          "text": "string",
          "type": "string"
        }
      ],
      "external id": "string",
      "language": "string",
      "name": "string",
      "namespace": "string",
      "rejected_reason": "string",
      "status": "string"
    }
  ]
}
```

{% endtab %}
{% endtabs %}

## Delete a template

<mark style="color:red;">`DELETE`</mark> `https://waba-v2.360dialog.io/v1/configs/templates/{template_name}`

#### Path Parameters

| Name           | Type   | Description |
| -------------- | ------ | ----------- |
| template\_name | string |             |

#### Headers

| Name         | Type   | Description |
| ------------ | ------ | ----------- |
| D360-API-KEY | string |             |

{% tabs %}
{% tab title="200 This class of status code indicates that the client's request was successfully received, understood, and accepted." %}

```json
{
    "meta": {
        "developer_message": "template name=`<template_name>` was deleted",
        "http_code": 200,
        "success": true
    }
}
```

{% endtab %}

{% tab title="400  The 400 Bad Request Error is an HTTP response status code that indicates that the server was unable to process the request sent by the client due to invalid syntax." %}

```
object {API Response}
meta object optional
    success boolean optional
    developer_message string optional
    http_code integer optional
```

{% endtab %}
{% endtabs %}

Some things to keep in mind before deleting a message template:

* If that message template name exists in multiple languages, all languages will be deleted.
* Messages that have been sent but not delivered (e.g., if the customer's device is offline) will attempt to be delivered for 30 days.&#x20;
* If a message from an approved message template is sent 30 days after deletion, you will receive a "Structure Unavailable" error and the customer will not receive the message.
* Once deleted, the name of an approved template cannot be used again for 30 days. Use a different name to create future templates.

## Edit  WABA template

<mark style="color:green;">`POST`</mark> `https://waba-v2.360dialog.io/v1/configs/templates/{external_id}`

**Request example**

`curl --request POST`\
`--url https://waba.360dialog.io/v1/configs/templates/{external_id}`\
`--header 'D360-API-KEY: '`\
`--header 'Content-Type: application/json'`

#### Path Parameters

| Name                                           | Type   | Description                                                      |
| ---------------------------------------------- | ------ | ---------------------------------------------------------------- |
| external\_id<mark style="color:red;">\*</mark> | string | external id (can be fetched with the get WABA templates request) |

#### Headers

| Name                                           | Type   | Description |
| ---------------------------------------------- | ------ | ----------- |
| D360-API-KEY<mark style="color:red;">\*</mark> | string |             |

## Template Categories

A template message can have three different categories:

* [Utility](https://docs.360dialog.com/docs/resources/utility-messages) - `UTILITY` - Non-promotional template messages commonly sent in response to user actions or requests.
* [Marketing](https://docs.360dialog.com/docs/resources/marketing-messages) - `MARKETING` - Template messages sent for promotional purposes. Most commonly used type of template.
* [Authentication](https://docs.360dialog.com/docs/resources/authentication-messages) - `AUTHENTICATION` - Authentication template messages used to deliver one-time codes to customers.

We recommend reading about each template category to understand their differences, and which ones best suit the business's use cases.

## Template Statuses

Once a template is created and approved, it can have the following statuses:

* **In-Review**: Indicates that the template is still under review. The review process is done by Meta and it can take up to 24 hours.
* **Rejected**: The template has been rejected during our review process or violates one or more of [Meta's Policies](https://developers.facebook.com/docs/whatsapp/overview/policy-enforcement).&#x20;
* **Active - Quality pending**: The message template has yet to receive quality feedback from customers. Message templates with this status can be sent to customers and will be monitored for rating. See [Quality Rating](https://docs.360dialog.com/docs/resources/phone-numbers/quality-rating).
* **Active - High Quality**: The template has received little or no negative customer feedback. Message templates with this status can be sent to customers. See [Quality Rating](https://docs.360dialog.com/docs/resources/phone-numbers/quality-rating).
* **Active - Medium Quality**: The template has received negative feedback from multiple customers but may soon become paused or disabled. Message templates with this status can be sent to customers. See [Quality Rating](https://docs.360dialog.com/docs/resources/phone-numbers/quality-rating).
* **Active - Low Quality**: The template has received negative feedback from multiple customers. Message templates with this status can be sent to customers but are in danger of being paused or disabled soon, so it is recommended that you address the issues that customers are reporting. See [Quality Rating](https://docs.360dialog.com/docs/resources/phone-numbers/quality-rating).
* **Paused**: The template has been paused due to recurring negative feedback from customers. Message templates with this status cannot be sent to customers. See [Template Pausing](#template-pausing).
* **Disabled**: The template has been disabled due to recurring negative feedback from customers. Message templates with this status cannot be sent to customers.&#x20;
* **Appeal Requested**: Indicates that an appeal has been requested. See [Appeals](#appeals).

You can see the exact payload of every status when received via webhook [here](https://developers.facebook.com/docs/whatsapp/business-management-api/webhooks/components#message-template-updates).

## Template Approval Process

Each template must be reviewed and approved by Meta before you can send them to customers.

### Category Validation <a href="#category-validation" id="category-validation"></a>

When you send a template creation request, Meta immediately validate its category using the [template categorization](#templates-categories) guidelines.

* **If Meta agrees** with the category you selected, the template status is set to `PENDING`; the template will then go through template review.&#x20;
* **If Meta disagrees** with your designation, the template will be created, but its `status` is set to `REJECTED` . This will trigger a message template status update webhook with `reason` set to `INCORRECT_CATEGORY` and the  `rejected_reason` field will have the value `TAG_CONTENT_MISMATCH.`

In both cases, the template's initial status is returned as part of the API response with `template ID`, `status`, and `category`. For example:

#### Example Response <a href="#example-response" id="example-response"></a>

```json
{
    "id": "572279198452421",
    "status": "PENDING",
    "category": "MARKETING"
}
```

### Template Review <a href="#template-review" id="template-review"></a>

Templates with a status of `PENDING` are undergoing template review. Meta reviews the contents of each newly created or edited template to make sure it adheres to their content guidelines and policies.

The review process can take up to 24 hours. In case you encounter any delays with the approval process, please reach out to our Support Team: [get-support](https://docs.360dialog.com/docs/support/get-support "mention")

Based upon the outcome of this review, it will automatically change its status to `APPROVED` or `REJECTED`, which triggers a message template status update webhook, that can have one of the listed statuses below.

### Monitoring Status Changes <a href="#monitoring-status-changes" id="monitoring-status-changes"></a>

Based on the outcome of category validation and template review, Meta will set or change the template's `status` to one of the following values:

* `APPROVED` — The template has passed template review and been approved, and can now[ be sent in template messages.](https://docs.360dialog.com/docs/messaging/overview)
* `PENDING` — The template passed category validation and is undergoing template review.
* `REJECTED` — The template failed category validation or template review.&#x20;

Businesses can only send templates with an **Active** status. You receive the template status by the  `template_message_update` webhook

## Template Rejection

Submissions are commonly rejected for the following reasons, so make sure you avoid these mistakes.

#### Parameter Formatting

* Avoid starting or ending a template with parameters.
* Avoid having 2 parameters next to each other.
* Variable parameters are missing or have mismatched curly braces. The correct format is `{{1}}`.
* Variable parameters contain special characters such as a `#`, `$`, or `%`.
* Variable parameters are not sequential. For example, `{{1}}`, `{{2}}`, `{{4}}`, `{{5}}` are defined but `{{3}}` does not exist.
* Template contains too many variable parameters relative to the message length. You need to decrease the number of variable parameters or increase the message length.
* The message template cannot start or end with a parameter i.e. dangling parameters are not allowed.

#### Content and Policy Violations

* The message template contains content that violates WhatsApp’s Commerce Policy: When you offer goods or services for sale, we consider all messages and media related to your goods or services, including any descriptions, prices, fees, taxes and/or any required legal disclosures, to constitute transactions. Transactions must comply with the [WhatsApp Commerce Policy](https://www.whatsapp.com/legal/commerce-policy/).
* The message template contains content that violates the [WhatsApps Business Policy](https://www.whatsapp.com/legal/business-policy): Do not request sensitive identifiers from users. For example, do not ask people to share full length individual payment card numbers, financial account numbers, National Identification numbers, or other sensitive identifiers. This also includes not requesting documents from users that might contain sensitive identifiers. Requesting partial identifiers (ex: last 4 digits of their Social Security number) is OK.
* The content contains potentially abusive or threatening content, such as threatening a customer with legal action or threatening to publicly shame them.

#### Character Limits and Text Format

* The body component will have different character limits depending on the format and tag of the template. The number of emojis allowed in the body component may also be limited.

#### Duplication

* The message template is a duplicate of an existing template. If a template is submitted with the same wording in the body and footer of an existing template, the duplicate template will be rejected.

#### If your template is rejected, you have the following options:

1. **Correct the error and re-submit:** Edit the template so they align with Meta guidelines, and resubmit to review. You can do this from the 360dialog Hub, or via WhatsApp Manager.&#x20;
2. **Request review via Account Quality:** Appeal the rejection directly through Meta Business Suite. Go to  Account Quality >  ‘Rejected message templates’, check the rejected template, and select Request review
3. **Create a new template:** Create a new template via [API, 360Dialog Hub](#create-and-manage-template-messages) or WhatsApp Manager to submit to the approval process. Make sure to create it with different name and content, otherwise it will be rejected immediately.&#x20;

<figure><img src="https://3527970750-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M4sMxKjL6eJRvZn6jeG-887967055%2Fuploads%2Fj77KlK276rgoEoYAd6zE%2Fimage.png?alt=media&#x26;token=2806f0e7-a540-448b-b2cc-c6ff8e3c6ec1" alt=""><figcaption></figcaption></figure>

## Template Pausing <a href="#template-pausing" id="template-pausing"></a>

If a message template reaches the lowest quality rating (a status of **Active - Low quality**), it will automatically be paused for a period of time. Pausing durations are as follows:

* 1st Instance: **Paused** for 3 hours
* 2nd Instance: **Paused** for 6 hours
* 3rd Instance: **Disabled**

When a message template is paused (status of **Paused**) it can't be sent to customers, so you should suspend any automated messaging campaigns that rely on that template. Although you won't be charged for attempting to send a paused message template to a customer, and the attempt won't count against your [messaging limit](https://docs.360dialog.com/docs/resources/wabas/messaging-limits), the API will reject such attempts. You should only resume these campaigns once the template's status has been changed back to **Active**.

<figure><img src="https://3527970750-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M4sMxKjL6eJRvZn6jeG-887967055%2Fuploads%2FMfQ8WCqdXNKSMEhP3C87%2FScreenshot%202024-02-19%20at%2013.18.11%20(1).png?alt=media&#x26;token=b8c7bdff-37c2-478d-8b94-e36f794b7d69" alt=""><figcaption></figcaption></figure>

You may wish to edit a paused template if you feel that editing its content will reduce the amount of negative feedback it may receive. Keep in mind, however, that once you edit a message template and resubmit it for approval, its status will change to **In Review** and it can't be sent to customers again until it has been re-approved and the status set back to **Active**.&#x20;

Having Paused Templates won't impact the WABA from which the message template was sent, or cause the Messaging Limit to decrease. Other high-quality message templates can continue to be sent from the phone number. However, if a business consistently sends message templates that reach a **Low quality** status, the WhatsApp Business Account may eventually be impacted. See [WABA Policy Enforcement](https://docs.360dialog.com/docs/resources/broken-reference).

### Unpausing <a href="#unpausing" id="unpausing"></a>

A template will unpause on its own after satisfying the pause duration outlined above. Once unpaused, the template's status will be set to **Active** and you may begin sending it to customers again. If you haven't suspended any automated messaging campaigns that relied on a paused template, they should start working again. However, we recommend that you hold any campaigns that rely on a template that has been paused until it is unpaused, because the API will reject your requests anyway.

The template's quality rating will also be reset to a value based on the most recent customer feedback the template has received.

Similar to pause notifications, Meta will notify you by WhatsApp Manager notification, email, and webhook once the template's status has been set to **Active**.&#x20;

<details>

<summary>Unpausing through the WhatsApp Manager </summary>

You can unpause any paused template through the WhatsApp Manager by clicking the ‘manually unpause it’ link highlighted in the screenshots below:

![](https://3527970750-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M4sMxKjL6eJRvZn6jeG-887967055%2Fuploads%2FeMQTvrkdQGyt2BEQzVWd%2Fimage.png?alt=media\&token=c83e18b0-9a8b-4985-b3fb-a7fc17007a58)

*Note that templates paused during Template Pacing must be manually unpaused before they can be used again.*

</details>

## Template Read Rates

{% hint style="info" %}
Beginning April 1, 2024, Meta is including templates read rates as a key factor in determining the quality of [Marketing Message Templates](#marketing-templates), as an addition to traditional metrics like blocks and reports. This means that Meta will [temporarily pause marketing message](#template-pausing) campaigns with low read rates, giving businesses time to iterate/edit the templates with the lowest engagement before scaling volume. Use the `message_template_status_change` webhook for information and template statuses changes.&#x20;
{% endhint %}

#### How to track template message read rates?

In the WhatsApp Manager, you can monitor message read rates in real time via a dedicated dashboard with message template metrics.

Go to WhatsApp Manager > Left side menu in "Account Tools" > Template messages.

&#x20;Select any message template, then click the template Insights tab to see additional metrics, including “Messages Read”. You also receive a read event webhook for each message (if the user has turned the “read receipts” setting on) via the messages webhook.  See [Webhook Events and Notifications](https://docs.360dialog.com/docs/messaging/webhook/webhook-reference).&#x20;

<figure><img src="https://3527970750-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M4sMxKjL6eJRvZn6jeG-887967055%2Fuploads%2FcUHtiq2VzPuHQ4srl5sI%2FScreenshot%202024-02-21%20at%2013.05.28%20(1).png?alt=media&#x26;token=8e57dc31-09ad-46ac-944a-2214b68a4277" alt="" width="375"><figcaption></figcaption></figure>

Note that Meta system accounts for variations in user availability, analyzing read rate trends over an appropriate period, instead of solely relying on immediate response times, for example, in cases where the user may not check messages during work hours, which could result in low read rates. This ensures a fair and realistic assessment of message engagement.

#### How to improve template messages read rates?

Here are some strategies to improve template messages read rates:&#x20;

* [x] **Audience:** Tailor your messages to specific user segments for more relevant communication.
* [x] **Timing:** To maximize chances of engagement with your templates, consider not sending on days when many businesses are competing for your customers’ attention, such as weekends or seasonal peaks.
* [x] **Frequency of Messages:** Monitor how many marketing conversations a customer receives per day and week to avoid overloading the customer.&#x20;
* [x] **Cool downs:** Give customers that have stopped engaging with your templates a break. Always include the option to opt-out of marketing conversations on WhatsApp.
* [x] **Relevance of the Message:** Make sure the subject line or preview text clearly indicates the message's relevance. Similarly, if previous interactions have been negative, this may discourage people from reading messages.&#x20;
* [x] **Optimize the first 60-65 characters:** This is what people see first in their message preview on WhatsApp. Make it engaging, convey the main point, personalize it, and test different approaches to see what works best.

## Template Appeals

You can submit Template Appeals from the WhatsApp Manager. Meta's team reviews the case against the appealed violation and decides the outcome, which typically takes 24 to 48 hours. The appealed violation will either remain **Unchanged**, or be set as **Reversed**.

{% hint style="info" %}
See our documentation for [WABA Policy Enforcement](https://docs.360dialog.com/docs/resources/broken-reference).
{% endhint %}

{% hint style="info" %}

#### References&#x20;

Official Meta Developer Documentation:&#x20;

* <https://developers.facebook.com/docs/whatsapp/message-templates/guidelines>

Cost of WhatsApp Conversations:&#x20;

* <https://developers.facebook.com/docs/whatsapp/pricing>
  {% endhint %}


---

# 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.360dialog.com/docs/resources/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.
