# Create a Message Template

In this quickstart, you'll learn how to create a message template for WhatsApp Business API. Templates are pre-approved message formats that allow businesses to initiate conversations with users or send notifications after the 24-hour messaging window has closed.

{% stepper %}
{% step %}
**Understanding Template Basics**

Before creating a template, it's important to understand the key components:

**Template Categories:**

* **Marketing**: For promotional offers and sales notifications
* **Utility**: For transactional updates like order confirmations
* **Authentication**: For sending verification codes

**Template Components:**

* **Header** (Optional): Can include text, image, video, or document
* **Body** (Required): Main content with variables (`{{1}}`, `{{2}}`, etc.)
* **Footer** (Optional): Additional static information
* **Buttons** (Optional): Action buttons like links or quick replies
  {% endstep %}

{% step %}
**Choose Your Creation Method**

{% tabs %}
{% tab title="Template Library Method" %}
**Using the Template Library:**

* Pre-written templates for common use cases
* Instant approval in most cases
* Limited customization options
* Best for getting started quickly
  {% endtab %}

{% tab title="Custom Template Method" %}
**Creating a Custom Template:**

* Complete flexibility over content and structure
* Requires approval from Meta (up to 24 hours)
* Full control over all template elements
* Best when you need specific messaging formats
  {% endtab %}
  {% endtabs %}

We'll cover both methods in the following steps.
{% endstep %}

{% step %}
**Creating a Template from the Template Library**

Here's how to create a template using the Template Library:

* In WhatsApp Business Manager, navigate to **Message Templates** in the left sidebar
* Select **Create Template**
* Under "Browse the WhatsApp Template Library," click **Browse Templates**
* Find a suitable template for your use case
* Click on your desired template to select it
* Complete the template form by adding your template name, selecting the language, and filling in button details if applicable
* Click **Submit**

If using the API instead, please use this [endpoint](https://docs.360dialog.com/docs/messaging-api/api-reference/templates#post-v1-configs-templates).&#x20;
{% endstep %}

{% step %}
**Creating a Custom Template**

For more flexibility, you can create a custom template using this [endpoint](https://docs.360dialog.com/docs/messaging-api/api-reference/templates#post-v1-configs-templates).

{% hint style="info" %}
Including `"allow_category_change": true` lets Meta recategorize your template if needed, preventing rejection.
{% endhint %}
{% endstep %}

{% step %}
**Review and Approval Process**

After submitting your template:

* **Category Validation**: Meta checks if your template is correctly categorized
* **Template Review**: Meta reviews the content against their guidelines
  * Library templates are usually approved instantly
  * Custom templates can take up to 24 hours for approval
* **Check Status**: You can check the status using this [endpoint](https://docs.360dialog.com/docs/messaging-api/api-reference/templates#get-v1-configs-templates):

Your template will be marked as `PENDING`, `APPROVED`, or `REJECTED`.
{% endstep %}

{% step %}
**Tips for Template Success**

For better approval chances and user engagement:

* Keep content clear and consistent with your template category
* Provide accurate examples for all variables
* Use `allow_category_change: true` to prevent miscategorization rejections
* Make the first 60-65 characters engaging (this appears in message previews)
* For marketing templates, include clear opt-out options
* Test different templates to see which ones perform better

Once approved, your template is ready to use in your WhatsApp messaging campaigns!
{% endstep %}
{% endstepper %}

### Quick Examples

Here are simple examples for each template category:

{% tabs %}
{% tab title="Marketing Template" %}

```json
{
  "name": "seasonal_promotion",
  "category": "MARKETING",
  "components": [
    {
      "type": "HEADER",
      "format": "TEXT",
      "text": "Our Summer Sale is on!"
    },
    {
      "type": "BODY",
      "text": "Shop now through August 31 and use code SUMMER25 to get 25% off all merchandise."
    },
    {
      "type": "FOOTER",
      "text": "Reply STOP to unsubscribe from promotions"
    }
  ]
}
```

{% endtab %}

{% tab title="Utility Template" %}

```json
{
  "name": "order_status",
  "category": "UTILITY",
  "components": [
    {
      "type": "BODY",
      "text": "Your order #{{1}} has been shipped! It should arrive by {{2}}. Track your delivery here: {{3}}",
      "example": {
        "body_text": [
          ["ABC123", "Aug 25", "https://example.com/track/ABC123"]
        ]
      }
    }
  ]
}
```

{% endtab %}

{% tab title="Authentication Template" %}

```json
{
  "name": "verification_code",
  "category": "AUTHENTICATION",
  "components": [
    {
      "type": "BODY",
      "text": "Your verification code is {{1}}. This code expires in 10 minutes.",
      "example": {
        "body_text": [
          ["123456"]
        ]
      }
    },
    {
      "type": "BUTTONS",
      "buttons": [
        {
          "type": "COPY_CODE",
          "example": "123456"
        }
      ]
    }
  ]
}
```

{% endtab %}
{% endtabs %}

That's it! You're now ready to create your first WhatsApp template and start sending structured messages to your customers.


---

# 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/get-started/quickstarts/create-a-message-template.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.
