> For the complete documentation index, see [llms.txt](https://help.novatalks.com.ua/en/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.novatalks.com.ua/en/get-started/conversations/conversation-panel/hsm-templates.md).

# HSM templates in the WhatsApp Business API

### What are HSM templates?

**HSM (Highly Structured Message) templates** are pre-agreed with Meta standard messages that businesses can use to start communicating with customers via the WhatsApp Business API. Messages can include appointment reminders, delivery information, payment updates, etc.

{% hint style="success" %}
Templates are created and approved via [WhatsApp Manager](https://business.facebook.com/wa/manage/message-templates/).
{% endhint %}

A template can include a header (text or attachments: images, videos, PDFs), body text with the ability to add variables, a footer, and buttons.

{% hint style="info" %}
Currently, templates containing Catalogue, Location, and Autocomplete Authentication are not supported (Authentication templates with code copying are supported).
{% endhint %}

***

### A 24-hour window for communication

WhatsApp Business uses 24-hour sessions for messaging.

When a customer sends a message to your number, a 24-hour window opens during which you can write free-form messages to users.

Outside of the 24-hour customer service window, you can only send HSM-approved templates. As soon as a customer replies to a template message, a new 24-hour window for communication opens.

Using HSM templates allows you to initiate a dialogue even with customers who have not yet written to the company.

***

### Sending an HSM template from NovaTalks

To send an HSM template from NovaTalks, in the message sending panel, enter the text in the appropriate markup consisting of several lines:

* **@HSM@ -** a label that informs the system that an HSM template is being sent.
* **template\_name|language -** the name of the template in lowercase with lowercase underscore and the [language code](https://developers.facebook.com/docs/whatsapp/business-management-api/message-templates/supported-languages). They must be the same as in the Meta template builder.
* **Template variables -** names of the template variables (if exists).

If the template contains an **attachment**, it must be attached to the message.

{% hint style="warning" %}
**Features of adding variables:**

* If several variables are used in a template, each variable must be written on a new line in the sequence specified in the template.
* If the template contains a button that contains a variable, the value of this variable must be added to the markup.
* If the template contains variables and they are not specified in the message, the template will not be sent.
* If the template contains a **Copy Code** button, the code must be specified twice in the markup of the message to be sent from NovaTalks: as a variable value in the body text and as a variable value for the button.
* You can substitute NovaTalks variables. To do this, enter two double curly brackets {{ in the corresponding line, after which a list of available variables will appear.
  {% endhint %}

After sending the template, the text and other elements from the template registered in WhatsApp Manager will be added to the message that will be sent to the client.&#x20;

The NovaTalks user will see it as a markup in the message history window in Conversation.

{% hint style="danger" %}
Before sending the template, make sure that the message does not contain any extra spaces or characters and that it follows the structure. Otherwise, it will not be delivered.
{% endhint %}

{% hint style="success" %}
For convenience, we recommend adding the HSM template structure to [Canned responces](/en/get-started/settings/canned-responses.md).
{% endhint %}

***

## Examples of HSM templates

### HSM template without variables and attachments

#### **Setting up a template in Meta:**

<figure><img src="https://2498134934-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5yF7NRiGknx3Bqj4OgYA%2Fuploads%2Fk8E7ee2GhJOJAQsgf1bC%2Fimage.png?alt=media&amp;token=da1f7c4f-af0d-4e96-9ccc-1010a42d2dab" alt=""><figcaption></figcaption></figure>

#### Marking up a template for submission to NovaTalks

<figure><img src="https://2498134934-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5yF7NRiGknx3Bqj4OgYA%2Fuploads%2Fs88rEQR58StY6zto0deR%2Fimage.png?alt=media&amp;token=04a25842-d59c-4946-9bf8-de395ed8bba0" alt=""><figcaption></figcaption></figure>

#### The message that the client will receive:

<figure><img src="https://2498134934-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5yF7NRiGknx3Bqj4OgYA%2Fuploads%2FS2s4hFFj7uE3spiEg0OE%2Fimage.png?alt=media&amp;token=10e96ae5-5eab-4f2a-8f10-5ebb153d43fa" alt=""><figcaption></figcaption></figure>

### HSM template with variables in the main text

#### Setting up a template in Meta:

<figure><img src="https://2498134934-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5yF7NRiGknx3Bqj4OgYA%2Fuploads%2FqgxYTOr8BgHGsDnXIxH8%2Fimage.png?alt=media&amp;token=01909344-243a-4cc9-a6da-03a4ca48e39e" alt=""><figcaption></figcaption></figure>

#### Marking up a template for submission to NovaTalks:

<figure><img src="https://2498134934-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5yF7NRiGknx3Bqj4OgYA%2Fuploads%2Fil9koWoUcGgvHaujadux%2Fimage.png?alt=media&amp;token=019e8952-37d1-466e-87d5-d7c8e3a2bef2" alt=""><figcaption></figcaption></figure>

#### The message that the client will receive:

<figure><img src="https://2498134934-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5yF7NRiGknx3Bqj4OgYA%2Fuploads%2FtePtIFOnwpn5WaeeNr7P%2Fimage.png?alt=media&amp;token=78e76c4e-7d51-46c1-a255-6869159353bb" alt=""><figcaption></figcaption></figure>

### HSM template using the **NovaTalks** variable

#### Setting up a template in Meta:

<figure><img src="https://2498134934-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5yF7NRiGknx3Bqj4OgYA%2Fuploads%2FIms0RvlHRlqvIOLj8v65%2Fimage.png?alt=media&amp;token=a8d23cdd-4427-45d6-bcc7-8053e546d52f" alt=""><figcaption></figcaption></figure>

#### Marking up a template for submission to NovaTalks:

<figure><img src="https://2498134934-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5yF7NRiGknx3Bqj4OgYA%2Fuploads%2FdpLVea3URkITZcUCbKPe%2Fimage.png?alt=media&amp;token=aeef0035-ba4d-4338-8876-b5dc0a95076a" alt=""><figcaption></figcaption></figure>

#### The message that the client will receive:

<figure><img src="https://2498134934-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5yF7NRiGknx3Bqj4OgYA%2Fuploads%2FXQw2n8v4tKsaR4MZTAzs%2Fimage.png?alt=media&amp;token=5865384b-0379-4617-9079-2cce8dc1a338" alt=""><figcaption></figcaption></figure>

### HSM template with a Button

Setting up a template in Meta:

<figure><img src="https://2498134934-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5yF7NRiGknx3Bqj4OgYA%2Fuploads%2F65K3Q9ZArYHBldlstxxm%2Fimage.png?alt=media&amp;token=3400f7bb-38f7-4f1d-875a-91f14cae9314" alt=""><figcaption></figcaption></figure>

Marking up a template for submission to NovaTalks:

<figure><img src="https://2498134934-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5yF7NRiGknx3Bqj4OgYA%2Fuploads%2FL6j2NhpXS67X7sXJlh60%2Fimage.png?alt=media&amp;token=807d1229-cdcb-4e35-b35e-7d5c946fc6b4" alt=""><figcaption></figcaption></figure>

The message that the client will receive:

<figure><img src="https://2498134934-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5yF7NRiGknx3Bqj4OgYA%2Fuploads%2F9mretGu9tO2o9XG5KBkt%2Fimage.png?alt=media&amp;token=f56d6154-2358-4949-b8e9-589e80769ca2" alt=""><figcaption></figcaption></figure>

### HSM template with variables in the Header, Body and Button

#### Setting up a template in Meta:

<figure><img src="https://2498134934-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5yF7NRiGknx3Bqj4OgYA%2Fuploads%2FBgnHSDEcHH3puVMdKahh%2Fimage.png?alt=media&amp;token=4062342b-9731-493b-b968-a020aaab6802" alt=""><figcaption></figcaption></figure>

#### Marking up a template for submission to NovaTalks:

<figure><img src="https://2498134934-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5yF7NRiGknx3Bqj4OgYA%2Fuploads%2FdTPIsssohmtfDtOhaCRY%2Fimage.png?alt=media&amp;token=c0b52b99-b1dd-406f-9a09-04d26a91acca" alt=""><figcaption></figcaption></figure>

#### The message that the client will receive:

<figure><img src="https://2498134934-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5yF7NRiGknx3Bqj4OgYA%2Fuploads%2FfTo1LZs0gUTQpXPqWb88%2Fimage.png?alt=media&amp;token=e76e29aa-b345-4533-bbc1-eab24a931cb9" alt=""><figcaption></figcaption></figure>

### HSM template with attachment

#### Setting up a template in Meta:

<figure><img src="https://2498134934-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5yF7NRiGknx3Bqj4OgYA%2Fuploads%2F4xEdwzxd9EsB2S4hiZVC%2Fimage.png?alt=media&amp;token=504d68eb-5bef-4f50-a222-555a614c566a" alt=""><figcaption></figcaption></figure>

#### Marking up a template for submission to NovaTalks:

<figure><img src="https://2498134934-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5yF7NRiGknx3Bqj4OgYA%2Fuploads%2FCJpFqkgZ2H5ESclQdEY5%2Fimage.png?alt=media&amp;token=a72c7218-9808-46b9-bea1-8ed25062d540" alt=""><figcaption></figcaption></figure>

#### The message that the client will receive:

<figure><img src="https://2498134934-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5yF7NRiGknx3Bqj4OgYA%2Fuploads%2Fbk15JT3UK2wtamBustqi%2Fimage.png?alt=media&amp;token=83fd9f1a-3e59-4367-baa8-73ecae2dbec5" alt=""><figcaption></figcaption></figure>

### HSM Authentication template

#### Setting up a template in Meta:

<figure><img src="https://2498134934-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5yF7NRiGknx3Bqj4OgYA%2Fuploads%2F2z1Mw6Z3J2lf08LP1CdA%2Fimage.png?alt=media&amp;token=3fe4b635-56dd-4229-a761-e4ea23a802ce" alt=""><figcaption></figcaption></figure>

#### Marking up a template for submission to NovaTalks:

<figure><img src="https://2498134934-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5yF7NRiGknx3Bqj4OgYA%2Fuploads%2FyKosJH6GayByO6Zg9bMd%2Fimage.png?alt=media&amp;token=3786587f-c5d5-4117-ae28-bdbbcda33d13" alt=""><figcaption></figcaption></figure>

#### The message that the client will receive:

<figure><img src="https://2498134934-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5yF7NRiGknx3Bqj4OgYA%2Fuploads%2FV7OzBYikrxTitXHJO78q%2Fimage.png?alt=media&amp;token=caea36d9-e518-41ce-94bc-995e48ff3ba3" alt=""><figcaption></figcaption></figure>
