# Template Library

Meta has recently made available the Template Library, which makes it faster and easier for businesses to create templates for common use cases, like payment reminders, delivery updates and more.

These pre-written templates have already been categorized and priced as utility or authentication. These templates contain fixed content that cannot be edited and parameters you can adapt for business or user-specific information.

Clients with a Shared WABA can browse and create templates using the Template Library in WhatsApp Manager, or it is also possible create them via the API.

## via WhatsApp Manager <a href="#creating-templates-via-whatsapp-manager-wam" id="creating-templates-via-whatsapp-manager-wam"></a>

### Creating Templates <a href="#creating-templates-via-whatsapp-manager-wam" id="creating-templates-via-whatsapp-manager-wam"></a>

Follow the instructions below to create templates using the Template Library in [WhatsApp Manager](https://business.facebook.com/wa/manage/template-library).

1: In the left sidebar of WhatsApp Manager under **Message Templates**, select **Create Template**.

<figure><img src="https://2248475362-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuyAl2S0lSHJaNDXJHo7A%2Fuploads%2F7SMSKrX3bMGASuI2zwwd%2FScreenshot%202024-10-16%20at%2011.33.18.png?alt=media&#x26;token=f0812115-8384-420e-9538-d8dde8701e06" alt="" width="156"><figcaption></figcaption></figure>

2: Under *Browse the WhatsApp Template Library*, select **Browse Templates**.

<figure><img src="https://2248475362-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuyAl2S0lSHJaNDXJHo7A%2Fuploads%2FNGFGCqB6hBxGtUXNQHSo%2FScreenshot%202024-10-16%20at%2011.33.46.png?alt=media&#x26;token=ef96523c-3718-4802-b34b-5f40f9b86b96" alt=""><figcaption></figcaption></figure>

3: Clients will now see all currently available utility templates. Use the search bar to search by topic or use case, or use the dropdown options on the sidebar to filter the results.

Hovering over a template will show you its parameter values that you can use.&#x20;

<figure><img src="https://2248475362-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuyAl2S0lSHJaNDXJHo7A%2Fuploads%2Ffc8tZOSMG4Vi8xTwwyAD%2FScreenshot%202024-10-16%20at%2011.34.22.png?alt=media&#x26;token=c9d56fe0-97ca-4a98-a255-5b21424a7176" alt=""><figcaption></figcaption></figure>

4: To create a template, **select one** by clicking on it. Then, add your template name, select the language, and fill out the button details. Once you have completed these steps, click **Submit**.

{% hint style="info" %}
If you choose **Customize template**, your template will have to go through review before you are able to send messages.
{% endhint %}

<figure><img src="https://2248475362-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuyAl2S0lSHJaNDXJHo7A%2Fuploads%2FCI5itcsOfbacTy8lvsrk%2FScreenshot%202024-10-16%20at%2011.34.42.png?alt=media&#x26;token=85052243-36db-4d6f-96b6-fae2aad8e68d" alt=""><figcaption></figcaption></figure>

### Template Parameters and Restrictions <a href="#template-parameters-and-restrictions" id="template-parameters-and-restrictions"></a>

When a template contains the value `library_template_name` in the [response](https://app.gitbook.com/s/-M4sMxKjL6eJRvZn6jeG-887967055/messaging-api/api-reference/templates#get-v1-configs-templates), it is a template created from the Template Library and is subject to type checks and restrictions.

<figure><img src="https://2248475362-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuyAl2S0lSHJaNDXJHo7A%2Fuploads%2F1PFvjHi4d64mup6BD8r0%2FScreenshot%202024-10-16%20at%2011.36.48.png?alt=media&#x26;token=2d10689c-79a9-4e9d-bc1a-621790ccd46d" alt=""><figcaption></figcaption></figure>

The templates in the library contain both fixed content and parameters. The parameters represent spaces in the template where variable information can be inserted, such as names, addresses, and phone numbers.

In the example above, parameters like the name `Jim` or the business name `CS Mutual` can be modified to accept variables like your customer's name and your business's name.

Messages sent using templates from Template Library are subject to parameter checks during send time. Values used in parameters that are outside of the established ranges listed below will cause the message send to fail.

#### List of parameters and sample values <a href="#list-of-parameters-and-sample-values" id="list-of-parameters-and-sample-values"></a>

All parameters are length restricted. If you receive an error, try again with a shorter value.

| Parameter Type | Description                                                                                                                                                                                                                             | Sample Value                                                                                                                                                                                                           |
| -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `ADDRESS`      | <p>A location address.</p><ul><li>Must be a valid address</li></ul>                                                                                                                                                                     | <ul><li><code>1 Hacker Way, Menlo Park, CA 94025</code></li></ul>                                                                                                                                                      |
| `TEXT`         | Basic text.                                                                                                                                                                                                                             | <ul><li><code>regarding your order.</code></li><li><code>12 pack of paper towels</code></li><li><code>your request</code></li><li><code>puchase</code></li><li><code>Jasper's Market</code></li></ul>                  |
| `AMOUNT`       | <p>A number signifying a quantity.</p><ul><li>May contain a prefix or suffix for monetary values such as USD or RS</li><li>May contain decimals (.) and commas (,)</li><li>May contain valid currency symbols such as $ and €</li></ul> | <ul><li><code>145</code></li><li><code>USD $375.32</code></li><li><code>€1,376.22 EUR</code></li><li><code>R$ 1200</code></li></ul>                                                                                    |
| `DATE`         | A standard calendar date.                                                                                                                                                                                                               | <ul><li><code>2021-04-19</code></li><li><code>13/03/2021</code></li><li><code>5th January 1982</code></li><li><code>08.22.1991</code></li><li><code>January 1st, 2024</code></li><li><code>05 12 2022</code></li></ul> |
| `PHONE NUMBER` | <p>A telephone number.</p><ul><li>May contain numbers, spaces, dashes (-), parentheses, and plus symbols (+)</li></ul>                                                                                                                  | <ul><li><code>+1 4256789900</code></li><li><code>+91-7884-789122</code></li><li><code>+39 87 62232</code></li></ul>                                                                                                    |
| `EMAIL`        | <p>A standard email address.</p><ul><li>Must be a valid email address</li></ul>                                                                                                                                                         | <ul><li><code><1hackerway@meta.com></code></li><li><code><yourcustomername@gmail.com></code></li><li><code><abusinessorcustomername@hotmail.com></code></li></ul>                                                      |
| `NUMBER`       | <p>A number.</p><ul><li>Must be a number.</li><li>Cannot contain spaces.</li></ul>                                                                                                                                                      | <ul><li><code>23444</code></li><li><code>90001234921388904</code></li><li><code>453638</code></li></ul>                                                                                                                |

### Forms <a href="#forms" id="forms"></a>

Forms are only available to accounts who have had their message limits increased (1k). See [Messaging Limits](https://docs.360dialog.com/partner/messaging/messaging-limits-and-quality-rating).

Some templates in Template Library are interactive forms that are powered by WhatsApp Flows.

In WhatsApp Manager, you can identify these specific templates by the "Form" label they contain. The current supported use cases are *Customer Feedback* and *Delivery Failure*.

<figure><img src="https://2248475362-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuyAl2S0lSHJaNDXJHo7A%2Fuploads%2F4S4OMhMAMtFujFf22xzM%2FScreenshot%202024-10-16%20at%2011.37.47.png?alt=media&#x26;token=cfd66222-addc-499d-a19a-451c96c70f99" alt=""><figcaption></figcaption></figure>

Identifying FORMS in the API response

When calling this [endpoint](https://app.gitbook.com/s/-M4sMxKjL6eJRvZn6jeG-887967055/messaging-api/api-reference/templates#get-message_template_library) (see documentation below), the `type` key in the `buttons` array will show as `"FLOW"`.

```json
 
{
      "name": "delivery_failed_2_form",
      "language": "en_US",
      "category": "UTILITY",
      "topic": "ORDER_MANAGEMENT",
      "usecase": "DELIVERY_FAILED",
      "industry": [
        "E_COMMERCE"
      ],
      "body": "We were unable to deliver order {{1}} today. 
      Please {{2}} to schedule another delivery attempt.",
      "body_params": [
        "#12345",
        "try a redelivery"
      ],
      "body_param_types": [
        "TEXT",
        "TEXT"
      ],
      "buttons": [
        {
          "type": "FLOW", //indicates Form type
          "text": "Reschedule"
        }
      ],
      "id": "7138055039625658"
}
```

## via API

### **Searching and Filtering Available Template Library**

To browse and filter available templates, use this [endpoint](https://app.gitbook.com/s/-M4sMxKjL6eJRvZn6jeG-887967055/messaging-api/api-reference/templates#get-message_template_library).

#### Query String Parameters

To search for specific Utility Templates, insert the query string parameters below.&#x20;

| Placeholder                                              | Description                                                                                                                                                                                                                                      | Sample Value            |
| -------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------- |
| <p><code>\<SEARCH\_KEY></code></p><p><em>String</em></p> | <p><strong>Optional.</strong></p><p></p><p>A substring you are searching for in the content, name, header, body, or footer of the template.</p>                                                                                                  | `payments`              |
| <p><code>\<TOPIC></code></p><p><em>Enum</em></p>         | <p><strong>Optional.</strong><br></p><p>The topic of the template.<br></p><p>See <a href="#template-filters">Template Filters</a> below</p>                                                                                                      | `ORDER_MANAGEMENT`      |
| <p><code>\<USECASE></code></p><p><em>Enum</em></p>       | <p><strong>Optional.</strong><br></p><p>The use case of the template.</p><p></p><p>See <a href="#template-filters">Template Filters</a> below</p>                                                                                                | `SHIPMENT_CONFIRMATION` |
| <p><code>\<INDUSTRY></code></p><p><em>Enum</em></p>      | <p><strong>Optional.</strong></p><p></p><p>The industry of the template.</p><p></p><p>See <a href="#template-filters">Template Filters</a> below</p>                                                                                             | `E_COMMERCE`            |
| <p><code>\<LANGUAGE></code></p><p><em>Enum</em></p>      | <p><strong>Optional.</strong></p><p></p><p>The template language locale code.</p><p></p><p>See <a href="https://developers.facebook.com/docs/whatsapp/business-management-api/message-templates/supported-languages">Supported Languages</a></p> | `en_US`                 |

### **Template Filters**

There are several templates to choose from in the Utility Template Library. You can use the API to filter them based on a few factors.

```json
// Get all available templates
GET /message_template_library

// Search for substring
GET /message_template_library?search=<SEARCH_KEY>

// Filter by template language
GET/message_template_library?language=<LANGUAGE>
```

#### List of available filters by: Industry, Topic, and Use Case Enums

**Example Request**

[Endpoint](https://app.gitbook.com/s/-M4sMxKjL6eJRvZn6jeG-887967055/messaging-api/api-reference/templates#get-message_template_library)

<mark style="color:green;">`GET`</mark>`https://waba-v2.360dialog.io/message_template_library?industry=<INDUSTRY>`

**Available Filters**

|       Industry       |
| :------------------: |
|     `E_COMMERCE`     |
| `FINANCIAL_SERVICES` |

**Example Request**

[Endpoint](https://app.gitbook.com/s/-M4sMxKjL6eJRvZn6jeG-887967055/messaging-api/api-reference/templates#get-message_template_library)

<mark style="color:green;">`GET`</mark>`https://waba-v2.360dialog.io/message_template_library?topic=<TOPIC>`

**Available Filters**

|        Topic        |
| :-----------------: |
|  `ACCOUNT_UPDATES`  |
| `CUSTOMER_FEEDBACK` |
|  `ORDER_MANAGEMENT` |
|      `PAYMENTS`     |

**Example Request**

[Endpoint](https://app.gitbook.com/s/-M4sMxKjL6eJRvZn6jeG-887967055/messaging-api/api-reference/templates#get-message_template_library)

<mark style="color:green;">`GET`</mark>`https://waba-v2.360dialog.io/message_template_library?usecase=<USECASE>`

**Available Filters**

|             Use Case            |                           |
| :-----------------------------: | ------------------------- |
| `ACCOUNT_CREATION_CONFIRMATION` | `PAYMENT_DUE_REMINDER`    |
|        `FEEDBACK_SURVEY`        | `PAYMENT_ACTION_REQUIRED` |
|     `SHIPMENT_CONFIRMATION`     | `PAYMENT_OVERDUE`         |
|        `DELIVERY_UPDATE`        | `PAYMENT_CONFIRMATION`    |
|          `ORDER_DELAY`          | `FRAUD_ALERT`             |
|        `DELIVERY_FAILED`        | `AUTO_PAY_REMINDER`       |
|     `DELIVERY_CONFIRMATION`     | `PAYMENT_SCHEDULED`       |
|         `ORDER_PICK_UP`         | `PAYMENT_REJECT_FAIL`     |
|      `ORDER_ACTION_NEEDED`      | `STATEMENT_AVAILABLE`     |
|       `ORDER_CONFIRMATION`      | `LOW_BALANCE_WARNING`     |
|  `ORDER_OR_TRANSACTION_CANCEL`  | `RECEIPT_ATTACHMENT`      |
|      `RETURN_CONFIRMATION`      | `STATEMENT_ATTACHMENT`    |
|       `TRANSACTION_ALERT`       |                           |

### Creating Templates

You can use the 360dialog API when you are ready to create a template from the library. Alternatively, you can also [create it using the WhatsApp Business Manager](#creating-templates-via-whatsapp-manager-wam-1).&#x20;

To create a new template using the *Template Library API*, call the endpoint using the body properties fetched from the GET endpoint. Please use this [endpoint](https://app.gitbook.com/s/-M4sMxKjL6eJRvZn6jeG-887967055/messaging-api/api-reference/templates#post-message_templates).&#x20;

### Sending Template Messages

See our [Sending Template Messages ](https://docs.360dialog.com/partner/messaging/template-messages/sending-template-messages)to learn how to send it to customers.
