# Sending Template Messages

It is only possible to send Templates with Active status. A message template status can change automatically from **Active** to **Paused** or **Disabled** based on feedback from customers. See [Template Statuses](#template-statuses).&#x20;

Currently, you can send the following template types:

* [Text-based message templates](https://docs.360dialog.com/partner/messaging/sending-and-receiving-messages/text-messages): To send a text-based message template, make a `POST` call to the endpoint below and attach a text message object.&#x20;
* [Media-based message templates](https://docs.360dialog.com/partner/messaging/media-messages): When sending messages with media such as images, videos, or audio files, see our Media documentation to find details.&#x20;
* [Interactive message templates](https://docs.360dialog.com/partner/messaging/sending-and-receiving-messages/text-messages/interactive-messages): Interactive message templates expand the content you can send recipients beyond the standard message template and media messages template types to include interactive buttons.&#x20;
* [Multi-Product Message templates](https://docs.360dialog.com/partner/messaging/template-messages/multi-product-templates): Showcase your products to customers directly from a template message.&#x20;
* [Location-based message templates](https://docs.360dialog.com/partner/messaging/sending-and-receiving-messages/text-messages/contacts-and-location-messages): Send location-based message templates.&#x20;
* [Authentication templates with one-time password buttons](https://docs.360dialog.com/partner/messaging/template-messages/authentication-templates): Specific Authentication Templates to authenticate and validate OTPs directly from WhatsApp.&#x20;

## API Reference&#x20;

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

#### Request Body

<table><thead><tr><th width="356">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>to<mark style="color:red;">*</mark></td><td>string</td><td>Recipient wa_id</td></tr><tr><td>type<mark style="color:red;">*</mark></td><td>string</td><td>Message type</td></tr><tr><td>language<mark style="color:red;">*</mark></td><td>string</td><td>Template language</td></tr><tr><td>policy<mark style="color:red;">*</mark></td><td>string</td><td>Delivery policy</td></tr><tr><td>code<mark style="color:red;">*</mark></td><td>string</td><td>Language code</td></tr><tr><td>name<mark style="color:red;">*</mark></td><td>string</td><td>Template name</td></tr><tr><td>messaging_product<mark style="color:red;">*</mark></td><td>string</td><td><br>Messaging service used for the request. Use <code>"whatsapp"</code>.</td></tr></tbody></table>

## Delivery Sequence of Multiple Messages&#x20;

When sending a series of messages, the order in which messages are delivered is not guaranteed to match the order of your API requests. If you need to ensure the sequence of message delivery, confirm receipt of a delivered status in a messages webhook before sending the next message in your message sequence. See [Webhooks and events.](https://docs.360dialog.com/partner/onboarding/webhook-events-and-setup/webhook-events-partner-and-messaging-api#messaging-webhook-associated-with-messaging-api)&#x20;

## **Text Truncation for Marketing Messages**

{% hint style="info" %}
The rollout of the Text Truncation feature is currently gradual, so you may have experienced it during your campaigns. It is expected to reach all users by mid-October 2024.
{% endhint %}

Text Truncation impacts how users view marketing messages in their chat screens. It shortens, or "truncates," messages that exceed five (5) lines of text, displaying a clickable ‘Read more’ option. This allows users to view the complete message if they choose.

<figure><img src="https://2248475362-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuyAl2S0lSHJaNDXJHo7A%2Fuploads%2F8lleKk8gnKxBxbmUt2Fc%2FImage%203%20(1).png?alt=media&#x26;token=93c852d8-1628-472a-928b-f356751d3fd2" alt=""><figcaption></figcaption></figure>

This update is part of WhatsApp's commitment to enhancing the user experience with marketing messages, helping clients achieve more value from marketing campaigns. Meta has implemented this change to boost user satisfaction while optimizing click-through rates (CTR). *You should expect this update in Marketing Messages campaigns.*

Initially, Text Truncation applies to the ‘**Single image + text + click-to-action button(s)**’ templates. Over time, it will extend to all formats of Marketing Messages, including group chats.

<figure><img src="https://2248475362-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuyAl2S0lSHJaNDXJHo7A%2Fuploads%2F26Psg01dUigUuPjjEbPL%2FImage%204.png?alt=media&#x26;token=1322a986-a45a-483b-82cd-f29fcd32f90f" alt=""><figcaption></figcaption></figure>

To maximize the impact of your marketing messages with this update, consider these best practices:

* **Make Your Message Engaging**: Capture the user's attention quickly with content that speaks to their interests and interactions with the business.
* **Focus on the First 5 Lines**: Create a clear and powerful opening with the first five lines. This is the text that will be visible to users, even when the message is truncated.
* **Build on Previous Interactions**: Use past interactions with the user to craft a message that feels relevant and personalized.
* **Structure Longer Messages**: If your message requires more than five lines, use distinct sections with clear spacing. Aim to keep your message concise, limiting to 3-4 well-defined sections.

## Time-To-Live <a href="#time-to-live" id="time-to-live"></a>

If Meta is unable to deliver a message to a WhatsApp user, they will continue attempting to deliver the message for a period of time known as a **time-to-live** (TTL), or message validity period. If Meta is unable to deliver a message for an amount of time that exceeds the TTL, they will stop trying and drop the message.

* The TTL for all messages, except for template messages that use an authentication template, is **30 days**.
* Template messages that use an authentication template have a default TTL of **10 minutes**.

You can customize these defaults by setting a custom TTL on **authentication,** **utility and marketing templates**. See [Customizing Time-To-Live](https://docs.360dialog.com/partner/messaging/template-messages/..#customizing-time-to-live).

If you send a message but do not receive a corresponding [messages webhook ](https://docs.360dialog.com/partner/onboarding/webhook-events-and-setup/webhook-events-partner-and-messaging-api#messaging-webhook-associated-with-messaging-api)indicating that the message was delivered before the TTL is exceeded, assume the message was dropped.

Note that if a message fails for some unrelated reason and it triggers a [delivery failure messages webhook](https://docs.360dialog.com/partner/onboarding/webhook-events-and-setup/webhook-events-partner-and-messaging-api#status--message-undeliverable), there could be a minor delay before you receive the webhook, so you may wish to build in a small buffer before assuming a drop.

## Template Pacing

{% hint style="info" %}
**Template pacing applies worldwide to both Marketing and Utility templates**.

For Marketing Templates campaigns with fewer recipients that do not reach their 'pace limit', their messages will not be subjected to pacing. This 'pace limit' number is dynamically determined by Meta and may vary depending on the template or business.
{% endhint %}

Template pacing is a mechanism that allows time for customers to provide early [feedback](https://docs.360dialog.com/partner/messaging-limits-and-quality-rating#quality-rating) on newly created or unpaused marketing or utility templates. This identifies and pauses templates that have received poor feedback, giving the business time to adjust their contents before they are sent to too many customers, thereby reducing the likelihood of negative feedback impacting the business.

Template pacing is valid for **utility and marketing** templates. Newly created templates, [paused templates that are unpaused](https://docs.360dialog.com/partner/messaging/template-messages/..#template-pausing), and templates that may have been created previously but don’t have a `GREEN` quality rating are potentially subject to pacing. [Template quality history](https://docs.360dialog.com/partner/messaging/template-messages/..#template-statuses) — for example, low quality resulting in a template pause — is one of the primary reasons for template pacing and you may see other templates get paced.

When a template is paced, messages will be sent normally until an unspecified threshold is reached. Once this threshold is reached, subsequent messages using that template will be held to allow enough time for customer feedback. Once Meta receives a good quality signal, subsequent messages using that template will be scaled to the entire target audience. If they receive a bad quality signal, subsequent messages using that template will be dropped, giving the business the opportunity to adjust content, targeting, etc.

#### Utility Template Pacing <a href="#utility-template-pacing" id="utility-template-pacing"></a>

Utility templates are subject to pacing only if  the number had a utility [template paused.](https://docs.360dialog.com/partner/messaging/template-messages/..#template-pausing) Once a utility template has been paused, newly created templates, paused templates that are unpaused, and templates that may have been created previously but don’t have `GREEN` quality rating are potentially subject to pacing for the next 7 days.

#### API Behaviour <a href="#api-behavior" id="api-behavior"></a>

The immediate response from the messages endpoint will indicate if the message was sent (`accepted`) or held (`held_for_quality_assessment`) with the `message_status` property in the `message` object. &#x20;

If the feedback is positive and changes the template's quality rating to **high quality**, the held messages will be released and sent normally which will trigger the `sent` and `delivered` webhooks. The [`message_template_quality_update`](https://docs.360dialog.com/partner/onboarding/webhook-events-and-setup/webhook-events-partner-and-messaging-api#quality-rating-event) will send the quality update and the [`messages`](https://docs.360dialog.com/partner/onboarding/webhook-events-and-setup/webhook-events-partner-and-messaging-api#messaging-webhook-associated-with-messaging-api) webhook will send the sent and delivered updates.

If the feedback is negative and changes the template's quality to **low quality**:

* The template's `status` will be set to `PAUSED`
* A [`message_template_quality_update`](https://docs.360dialog.com/partner/onboarding/webhook-events-and-setup/webhook-events-partner-and-messaging-api#quality-rating-event) will be sent with an `event` value of `paused`
* Each held message will be dropped and trigger a `messages` webhook with `"status":"failed"` and `"code":"132015"`&#x20;
* A  [`message_template_quality_update`](https://docs.360dialog.com/partner/onboarding/webhook-events-and-setup/webhook-events-partner-and-messaging-api#quality-rating-event) webhook will be triggered with the quality change
* Admins of the WhatsApp Business Account owning business will be informed of the dropped messages by Meta Business Suite notification, WhatsApp Manager banner, and email

See[ Template Pausing ](https://docs.360dialog.com/partner/messaging/template-messages/..#unpausing)to learn how to unpause a template that has been paused due to pacing.

Note that Meta has internal guardrails in place to ensure that we evaluate and make a pacing decision within a reasonable time to avoid impact on time sensitive campaigns. The goal is that even if paced, campaign messages with highest throughput still get delivered within an hour (99 percentile).

Thus, if Meta internal guardrails are reached before a template has received enough feedback to change its quality to high or low, the held messages will be released normally along with any appropriate `messages` webhooks. See [Webhooks and events.](https://docs.360dialog.com/partner/onboarding/webhook-events-and-setup/webhook-events-partner-and-messaging-api#messaging-webhook-associated-with-messaging-api)&#x20;

## Per-User Marketing Template Message Limits

{% hint style="warning" %}
This limit is not active in these countries: European Economic Area, United Kingdom, Japan, South Korea
{% endhint %}

WhatsApp may limit the number of marketing template messages a person receives from any business in a given period of time, starting with delivering fewer marketing conversations to those users who are less likely to engage with them. In most WhatsApp markets, this is determined based on a number of factors, including a dynamic view of an individual’s marketing message read rate, and is not related to your business specifically.

For individuals with United States phone numbers (numbers composed of a +1 dialing code and a US area code), where WhatsApp is growing quickly but at an earlier stage, WhatsApp will not deliver any marketing template messages to focus on building the consumer experience.

#### Why it's important <a href="#why-it-s-important" id="why-it-s-important"></a>

WhatsApp has found that per-user marketing template limits maximize message engagement and improve the user experience, measured through improvements in user read rates and sentiment. This limit helps WhatsApp users find business messaging more valuable and feel less like they receive too many business messages.

#### How this Applies to Your Business <a href="#how-this-applies-to-your-business" id="how-this-applies-to-your-business"></a>

The limit only applies to [marketing template messages](https://docs.360dialog.com/partner/messaging/template-messages/..#marketing-templates) that would normally open a [new marketing conversation. ](#customer-service-window)If a marketing conversation is **already open** between you and a WhatsApp user, marketing template messages sent to the user **will not be affected.** Further marketing template messages can only be sent in an open marketing conversation if the person responds to any message.

Example:

* The first marketing template message is delivered and opens a new [24-hour marketing conversation ](https://docs.360dialog.com/partner/messaging/template-messages/broken-reference)customer service window. The per-user marketing template message limit applies.
* A second marketing template message can be sent in an existing conversation.
* Each time the WhatsApp user responds in an existing conversation window, you can send one additional marketing template message. You can also send unlimited [free-form](https://docs.360dialog.com/partner/messaging/template-messages/broken-reference) messages.

#### What to watch for: `131049` Error Code <a href="#how-we-notify-via-error-code" id="how-we-notify-via-error-code"></a>

If a marketing template message is not delivered to a given user due to the limit, Cloud API will return error code `131049` with the description *“This message was not delivered to maintain a healthy ecosystem engagement.”*  See error code: `131049` in [Error Messages.](https://docs.360dialog.com/partner/messaging/template-messages/broken-reference)

If you do receive one this error code and suspect it is due to the limit, avoid immediately resending the template message, as it will only result in another error response. Instead, retry in increasing larger time increments until the message is delivered, since the limit may be in effect for differing periods of time.

To understand more about these limits and how to adapt strategies, [read our blog post on this subject](https://www.360dialog.com/blog/guide-whatsapp-user-messaging-limits).

### Experiments

Meta's ongoing experiment on the WhatsApp Business Platform is focused on evaluating how marketing messages impact consumer experience and engagement. As part of this experiment, **approximately 1% of WhatsApp consumers will not receive marketing messages.**

Businesses will not be charged for undelivered messages. While there is no guaranteed timeframe for how long a number may be part of the experiment, we do not recommend retrying to send marketing messages to consumers with experimentation error codes unless there is an active conversation open. See [Cloud API](https://developers.facebook.com/docs/whatsapp/cloud-api/guides/experiments?content_id=4j0t9YFqVY0Mq3p) on Meta's Official Documentation.


---

# 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/sending-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.
