# Create and manage Template Messages

You can create and manage Template Messages using either the API or the UI. This guide explains both methods, so you can choose the option that best fits your workflow. You may combine both approaches or simply use the one that is most efficient for your scenario.

* [#via-api](#via-api "mention")
* [#in-the-waba-management-ui](#in-the-waba-management-ui "mention")

## Via API

### Create new WABA template

Please use this [endpoint](https://docs.360dialog.com/docs/messaging-api/api-reference/templates#post-v1-configs-templates).&#x20;

The message template name field is limited to 512 characters.  The message template content field is limited to 1024 characters.

#### Headers

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

#### Body Properties <a href="#body-properties" id="body-properties"></a>

<table><thead><tr><th width="286">Placeholder</th><th>Description</th><th>Sample Value</th></tr></thead><tbody><tr><td><p><code>&#x3C;NAME></code></p><p><em>String</em></p></td><td><p><strong>Required.</strong></p><p>Template name.<br></p><p>Maximum 512 characters.</p></td><td><code>order_confirmation</code></td></tr><tr><td><p><code>&#x3C;CATEGORY></code></p><p><em>Enum</em></p></td><td><p><strong>Required.</strong></p><p>Template category.</p></td><td>Allowed values: <strong><code>AUTHENTICATION, MARKETING, UTILITY</code></strong></td></tr><tr><td><p><code>&#x3C;LANGUAGE></code></p><p><em>Enum</em></p></td><td><p><strong>Required.</strong><br></p><p>Template <a href="https://developers.facebook.com/docs/whatsapp/business-management-api/message-templates/supported-languages">language and locale code</a>.</p></td><td><code>en_US</code></td></tr><tr><td><p><code>&#x3C;LIBRARY_TEMPLATE_NAME></code></p><p><em>String</em></p></td><td><p><strong>Optional.</strong><br></p><p>The exact name of the Utility Template Library template.</p><p></p><p><em>Learn how to create templates using Utility Template Library</em></p></td><td><code>delivery_update_1</code></td></tr><tr><td><p><code>&#x3C;LIBRARY_TEMPLATE_BUTTON_INPUTS></code></p><p><em>Array of objects</em></p></td><td><p><strong>Optional.</strong></p><p></p><p>The website and/or phone number of the business being used in the template.</p><p></p><p><strong>Note: For utility templates that contain buttons, this property is </strong><em><strong>not</strong></em><strong> optional.</strong></p><p></p><p><em>Learn how to create templates using Utility Template Library</em></p></td><td><code>“[ {'type': 'URL', 'url': {'base_url' : 'https://www.example.com/{{1}}', 'url_suffix_example' : 'https://www.example.com/demo'}}, {type: 'PHONE_NUMBER', 'phone_number': '+16315551010'} ]"</code></td></tr><tr><td><p><code>&#x3C;COMPONENTS></code></p><p><em>Array of objects</em></p></td><td><p><strong>Required.</strong></p><p></p><p>Components that make up the template.</p><p>See<a href="/pages/NRHTZ7dMOFGlTnsxKCJw"> Template Elements</a>.</p></td><td>See<a href="/pages/NRHTZ7dMOFGlTnsxKCJw"> Template Elements</a>.</td></tr></tbody></table>

#### Request body <a href="#template-components" id="template-components"></a>

Templates are composed of various text, media, and interactive components, based on your business needs. Refer to the [Template Elements ](/partner/messaging/template-messages/template-elements.md)for a list of all possible components.

When creating a template, define its components by assigning an array of component objects to the components property in the body of the request.

For example, here's an array containing a **text body** component with two variables and sample values, a **phone number button** component, and a **URL button** component:

```json
[
  {
    "type": "BODY",
    "text": "Thank you for your order, {{1}}! Your confirmation number is {{2}}. If you have any questions, please use the buttons below to contact support. Thank you for being a customer!",
    "example": {
      "body_text": [
        [
          "Pablo","confirmation_number"
        ]
      ]
    }
  },
  {
    "type": "BUTTONS",
    "buttons": [
      {
        "type": "PHONE_NUMBER",
        "text": "Call",
        "phone_number": "phone_number"
      },
      {
        "type": "URL",
        "text": "Contact Support",
        "url": "https://www.website.com/support"
      }
    ]
  }
]
```

Note that templates categorized as `AUTHENTICATION` have unique component requirements. See [Authentication Templates](/partner/messaging/template-messages/authentication-templates.md).<br>

{% tabs %}
{% tab title="200: OK " %}
In addition, if Meta determines that a template has been miscategorized, its status will be set to `REJECTED` and you will receive a [template status webhook](#webhook-events-for-status-changes) indicating that it was rejected for miscategorization.&#x20;

```json
{
  "category": "MARKETING",
  "components": [
    {
      "example": {
        "body_text": [
          [
            "Lorem"
          ]
        ]
      },
      "text": "Lorem {{1}} ipsum",
      "type": "BODY"
    }
  ],
  "created_at": "2024-06-25T09:42:33Z",
  "created_by": {
    "user_id": "360dialog_user_id",
    "user_name": "360dialog_user_name"
  },
  "external_id": "template_external_id",
  "id": "template_id",
  "language": "en_US",
  "modified_at": "2024-06-25T09:42:37Z",
  "modified_by": {
    "user_id": "360dialog_user_id",
    "user_name": "360dialog_user_name"
  },
  "name": "string",
  "namespace": "string",
  "partner_id": "string",
  "quality_score": null,
  "rejected_reason": null,
  "status": "submitted",
  "updated_external": true,
  "waba_account_id": "string"
}
```

{% endtab %}

{% tab title="400: Bad Request " %}

```json
{
  "meta": {
    "success": false,
    "http_code": 400,
    "developer_message": "There was an error with your request",
    "details": [
      "string"
    ],
    "error_data": {
      "code": "string",
      "message": "string",
      "real_message": "string",
      "status": 0
    }
  }
}
```

{% endtab %}

{% tab title="404: Not Found " %}

```json
{
  "meta": {
    "success": false,
    "http_code": 400,
    "developer_message": "There was an error with your request",
    "details": [
      "string"
    ],
    "error_data": {
      "code": "string",
      "message": "string",
      "real_message": "string",
      "status": 0
    }
  }
}
```

{% endtab %}
{% endtabs %}

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.

### Get WABA templates

Please use this [endpoint](https://docs.360dialog.com/docs/messaging-api/api-reference/templates#get-v1-configs-templates).

See [Template Statuses](#template-statuses)

#### Query Parameters

| Name    | Type   | Description                                                                                                                                                                                      |
| ------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| 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> |
| limit   | string | <p>Objects limit to return in the response<br><br>default: <code>1000</code></p>                                                                                                                 |
| offset  | string | <p>Show the results starting from an offset<br><br>default: <code>0</code></p>                                                                                                                   |
| sort    | string | <p>Use minus <code>-</code> symbol for descending sorting<br><br><code>id</code> , <code>name</code> , <code>status</code></p>                                                                   |

#### Headers

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

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

```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 %}

{% tab title="404: Not Found " %}

```
{
  "meta": {
    "success": false,
    "http_code": 400,
    "developer_message": "There was an error with your request",
    "details": [
      "string"
    ],
    "error_data": {
      "code": "string",
      "message": "string",
      "real_message": "string",
      "status": 0
    }
  }
}
```

{% endtab %}
{% endtabs %}

### Remove a Template Message

Before deleting a Template Message, keep the following points in mind:

* **Pending delivery**: Messages that have already been sent but not yet delivered (e.g., if the customer’s device is offline) will continue to attempt delivery for up to 30 days.
* **After deletion**: If a message is sent from a previously approved template **30 days after deletion**, you will receive a <mark style="color:red;">`"Structure Unavailable"`</mark> error, and the customer will not receive the message.
* **Name reuse restriction**: Once a template is deleted, **its name cannot be reused** for **30 days**. To create a new template during this period, use a different name.
* **Template elements**: For details on the components available in a Template Message, see Template Elements.

#### How to remove a Template Message

You can delete a WABA Template Message by using either its **name** or **template ID**.&#x20;

* [#remove-by-template-id](#remove-by-template-id "mention")
* [#remove-by-template-name](#remove-by-template-name "mention")

{% hint style="info" %}
Refer to [#get-waba-templates](#get-waba-templates "mention") to get a template name or ID.&#x20;
{% endhint %}

#### Remove by template ID

To delete a template message by ID, you may need to retrieve the ID and in the request by including the template's ID:

* Only the template with the **specified Template ID** will be deleted.
* Each template has a **unique ID** for **each language**, so make sure you use the correct Template ID when making a deletion request.

Please use this [endpoint](/partner/partner-api/api-reference/templates-management.md#delete-api-v2-partners-partner_id-waba_accounts-waba_account_id-waba_templates-template_id).&#x20;

#### Remove by template name

Deleting a template by name deletes all templates that match that name (meaning templates with the same name but **different languages will also be deleted**).

Please use this [endpoint](https://docs.360dialog.com/docs/messaging-api/api-reference/templates#delete-v1-configs-templates-template_name).&#x20;

#### Update template&#x20;

Please use this [endpoint](https://docs.360dialog.com/docs/messaging-api/api-reference/templates#post-v1-configs-templates-whats_app_message_template_id).&#x20;

## In the WABA Management UI

The Template Management feature in the 360Dialog WABA Management UI supports both text and media templates. To manage Template Messages in the UI you will need to access the Template Manager: the Template Manager supports both text and media templates and has the following functions:&#x20;

* Create and preview new template messages
* Monitor current approval status of all your templates
* Copy and Delete templates
* Add different template Languages
* Allow template category change
* Edit Templates

### Access

Each WABA has it's own set of Message Templates. To access your Message Templates, find the WABA number you would like to add a Message Template to in the Numbers page > Manage > Templates.

In WhatsApp Account > Manage Templates.&#x20;

<figure><img src="/files/2clDPACBHqbX0RDzKOsL" alt=""><figcaption></figcaption></figure>

### Overview

This is the Template Management home page where you can get an overview of all Templates under your number.

* <img src="/files/-MNYZBDS24koDAfnyp0E" alt="" data-size="line"> Delete Template
* <img src="/files/-MNY_MqlyjwgiHeUdIbZ" alt="" data-size="line"> Replicate Template. Useful for creating variants of a similar template
* <img src="/files/-MNYa1WcJR4IlFzmixRh" alt="" data-size="line"> Add different language to a template
* Edit Templates
* See Templates Category

![](/files/x2wDbuOKHEvNTTLyZFy2)

{% hint style="info" %}
Edited templates will be submitted to Meta for approval **once** in a 24-hour window or up to 10 times in a 30-day window.

The edited version will appear in the 360dialog hub with the "last sync" date, referencing to when it was last submitted. See[ Meta's Template Editing rules](https://developers.facebook.com/docs/whatsapp/business-management-api/message-templates#edit-a-message-template).  &#x20;
{% endhint %}

### Template Verification Process

Template messages must be submitted to Meta for review before they are available to use. The status of this review can be seen by the color of the template language. Please review our tips on [Template Messaging](/partner/messaging/template-messages.md) before submitting any templates for review.

{% tabs %}
{% tab title="Draft" %}
&#x20;Templates with a gray background are in draft mode and have not been submitted for review by Meta yet.

![](/files/-MNYnVy_5dEJrjEeD_zj)
{% endtab %}

{% tab title="Pending" %}
Pending Templates have a yellow background. Facebook is verifying the template request. Please wait until more information is given by Facebook.

![](/files/-MNYnxNoQKsNyTIw_9l4)
{% endtab %}

{% tab title="Approved" %}
Your Template has been approved by Facebook and may be used to send Template Messages to your clients.

![](/files/-MNYoT189JW7sJVhMHrF)
{% endtab %}

{% tab title="Rejected" %}
This Template has been rejected. Please review our [Template Messaging docs](https://docs.360dialog.com/api/template-messaging) for help with Template Message approval.&#x20;

![](/files/-MNYp-PiMmfLGqMP59jY)
{% endtab %}

{% tab title="Untitled" %}
This template is Paused from sending for a period of time. See [Template Pausing](#template-pausing).

{% endtab %}
{% endtabs %}

### Create a template

To create a Message Template, click on the blue `Add Template` button in the home page.

When creating your template, you will need to include the following information:&#x20;

* Template Name
  * Name can only contain lowercase alphanumeric characters and underscores ( \_ )&#x20;
* Template Category
  * See [Template Categories](#template-categories)
* Template Language
  * Language that the template is written in
* Allow Template Category Change
  * Selecting Yes to this value will allow Meta to assign whatever category they determine to be appropriate to avoid template rejection due to miscategorization.
* Template Type
  * Standard (text only) or Media Template

<figure><img src="/files/4guWvYj4hmfzSEgq5HJO" alt=""><figcaption><p>360dialog Client Hub v1</p></figcaption></figure>

<figure><img src="/files/BGYkCZeQWEjkMayVMEzZ" alt=""><figcaption><p>360dialog Client Hub v2</p></figcaption></figure>

### Creating Standard (text only) Templates:&#x20;

Standard Message Templates only have a BODY section. In order to add a variable, insert {{#}} at the given position, where # represents the variable index, which needs to start at {{1}}

![Preview feature with variable insertion](/files/-MNbqR_DVx_rnuDSp6bf)

### Creating Media Templates

The Media Templates have more building blocks and features. It consists of the following building blocks:&#x20;

{% tabs %}
{% tab title="Header" %}
The Header is optional and serves as the title or header of your template. It supports the following:&#x20;

* Text&#x20;
* Image
* Document
* Video
  {% endtab %}

{% tab title="Body" %}
The Body should contain the most important text of your template. Only text is supported.
{% endtab %}

{% tab title="Footer" %}
The Footer only supports text and can be used to provide less relevant information in your template message.
{% endtab %}

{% tab title="Button" %}
The button adds interactivity to your templates. There are two main types.

* Quick Reply Button
  * Used for getting quick answers from your client
  * Max 3 Quick Reply Buttons per Template
* Call to Action Button
  * Used to send your client to a Website or call a Phone Number
  * Max one URL and Phone Number per Template
    {% endtab %}
    {% endtabs %}

{% hint style="info" %}
All Templates require a Body. Headers, Footers, and Buttons are optional.
{% endhint %}

![Example Media Template with Image, Body, Call to Action Button and Placeholder Variables](/files/-MNZHaAeCDUvi6WhbvmT)

**Important**: all media examples must be urls that point to a valid media file.

{% hint style="info" %}
Visit our [Template Messaging](broken://pages/-MKJcOJCZHT02NZHO3yd) for more information about creating template messages and best practices.&#x20;
{% endhint %}

### Creating templates with Buttons

Through the 360Dialog Client Hub, you can add buttons and combinations as per our[ Buttons documentation](/partner/messaging/template-messages/template-elements.md).&#x20;

{% content-ref url="/pages/-MKJcOJCZHT02NZHO3yd" %}
[Broken mention](broken://pages/-MKJcOJCZHT02NZHO3yd)
{% endcontent-ref %}

<figure><img src="/files/MtJfR9124o2MkHfCpNyc" alt=""><figcaption></figcaption></figure>

### Sample Templates

For all accounts, WhatsApp already registers a number of pre-approved sample templates. These templates can be used at any time and **cannot be deleted**.

Sample templates always have *sample\_* in the name.

![](/files/cnGhESyPWFckvLQqCI8Z)

### Appeal Template Rejections

Rejected Template messages [can be appealed](https://docs.360dialog.com/docs/waba-platform-policy-enforcement#appeal-template) via the **Account Quality** section in Meta Business Manager.&#x20;


---

# 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/partner/messaging/template-messages/create-and-manage-template-messages.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.
