# Create WhatsApp message templates through the API

> Create WhatsApp templates with a POST to message_templates: name rules, components, review status, category changes, listing, edits and deletes.

Published 2026-11-04. Z-API Omni team.

Create a WhatsApp template with a `POST` to `https://graph.facebook.com/v26.0/WABA_ID/message_templates`, where `WABA_ID` is your Messaging account ID. The JSON body carries `name`, `language`, `category` and `components`. Meta replies with the template `id`, a `status` of `PENDING` and the `category` it assigned. Only an `APPROVED` template can be sent ([Meta template fundamentals, accessed 2026-11-04](https://developers.facebook.com/documentation/business-messaging/whatsapp/templates/overview)). Meta's review page says "It can take up to 24 hours for an approval decision to be made" ([Meta template review, accessed 2026-11-04](https://developers.facebook.com/documentation/business-messaging/whatsapp/templates/template-review)).

## What the request needs

The token needs the `whatsapp_business_management` permission. Meta's permissions page says it is "needed to access metadata on your Messaging account, template management" ([Meta permissions, accessed 2026-11-04](https://developers.facebook.com/documentation/business-messaging/whatsapp/permissions)). A system user token is the usual choice for a backend, covered in [Cloud API access tokens](/academy/articles/whatsapp-cloud-api-access-tokens-system-user/).

The fields below come from Meta's template API reference ([Meta message template API reference, accessed 2026-11-04](https://developers.facebook.com/documentation/business-messaging/whatsapp/reference/whatsapp-business-account/message-template-api)).

| Field | Required | What it does |
|---|---|---|
| `name` | Yes | Lowercase letters, digits and underscores |
| `language` | Yes | Language code, such as `en_US` |
| `category` | Yes | `AUTHENTICATION`, `MARKETING` or `UTILITY` |
| `parameter_format` | No | `NAMED` or `POSITIONAL`; positional is the default |
| `components` | No | Header, body, footer and buttons (a body is still required, see below) |
| `sub_category` | No | Values such as `ORDER_STATUS`, `FRAUD_ALERT` or `BOOKING_STATUS` |
| `message_send_ttl_seconds` | No | Time-to-live for messages sent with the template |
| `library_template_name` | No | Clones a template from Meta's template library |

The reference enum also lists `FREE_SERVICE`, but the overview says every template is authentication, marketing or utility. The [template categories guide](/academy/articles/whatsapp-template-categories-marketing-utility-authentication/) explains how to pick one.

Names must match `^[a-z0-9_]+$` and be at most 512 characters. Any other character returns error `100`. Names aren't unique, so `order_confirmation` can exist in `en_US` and `es_MX` as two templates. A second one in the same language fails with error `100`, subcode `2388024`, "Content in This Language Already Exists". Invalid categories and unsupported language codes also return `100` ([Meta template management, accessed 2026-11-04](https://developers.facebook.com/documentation/business-messaging/whatsapp/templates/template-management)).

Meta doesn't translate your text or example values. Each language version "counts against your template limit."

## Build the components

The body is the only required component. Limits come from Meta's components page ([Meta template components, accessed 2026-11-04](https://developers.facebook.com/documentation/business-messaging/whatsapp/templates/components)).

| Component | Limits |
|---|---|
| Header | Optional, one. Text up to 60 characters with 1 parameter, no Markdown characters. Media formats: `IMAGE`, `VIDEO`, `GIF`, `DOCUMENT`, with `GIF` only through the Marketing Messages API |
| Body | Required. Up to 1,024 characters, multiple parameters, an example value for each |
| Footer | Optional. Text only, up to 60 characters |
| Buttons | Up to 10 in total. Quick reply: up to 10, label 25 characters. URL: up to 2, URL 2,000 characters with 1 variable at the end. Phone: 1, number 20 characters. Copy code: 1 |

Group quick replies apart from other buttons. Meta accepts "Quick Reply, Quick Reply, URL, Phone" and rejects "Quick Reply, URL, Quick Reply". With more than three buttons, the delivered message shows two and hides the rest under "See all options". WhatsApp desktop clients can't show templates with four or more buttons, or with a quick reply mixed with another button type.

This is Meta's marketing sample from the components page, reindented, with shell variables in place of the account ID and token.

```bash
curl -L "https://graph.facebook.com/v26.0/$WABA_ID/message_templates" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '
{
  "name": "seasonal_promotion",
  "language": "en_US",
  "category": "MARKETING",
  "components": [
    {
      "type": "HEADER",
      "format": "TEXT",
      "text": "Our {{1}} is on!",
      "example": { "header_text": ["Summer Sale"] }
    },
    {
      "type": "BODY",
      "text": "Shop now through {{1}} and use code {{2}} to get {{3}} off of all merchandise.",
      "example": { "body_text": [["the end of August", "25OFF", "25%"]] }
    },
    {
      "type": "FOOTER",
      "text": "Use the buttons below to manage your marketing subscriptions"
    },
    {
      "type": "BUTTONS",
      "buttons": [
        { "type": "QUICK_REPLY", "text": "Unsubscribe from Promos" },
        { "type": "QUICK_REPLY", "text": "Unsubscribe from All" }
      ]
    }
  ]
}'
```

Meta writes `category` and `type` in uppercase here and in lowercase on the overview page, so both appear in its samples. For `{{first_name}}` style variables, set `"parameter_format": "named"` and follow [template variables: positional and named parameters](/academy/articles/whatsapp-template-variables-named-parameters/).

A media header needs an uploaded example. Meta's utility sample uses `"format": "image"` with `"example": {"header_handle": ["4::aW..."]}`. The handle comes from the Resumable Upload API, the same two-step flow shown in [updating the business profile](/academy/articles/whatsapp-business-profile-api/). Location headers work only in `UTILITY` or `MARKETING` templates.

## Read the response and wait for review

Meta's utility templates page shows this create response ([Meta utility templates, accessed 2026-11-04](https://developers.facebook.com/documentation/business-messaging/whatsapp/templates/utility-templates/utility-templates)).

```json
{
  "id": "546151681022936",
  "status": "PENDING",
  "category": "UTILITY"
}
```

Store the `id`, then check `category`. Since April 9, 2025, a template submitted as `UTILITY` whose content WhatsApp judges to be marketing is approved as `MARKETING` ([Meta template categorization, accessed 2026-11-04](https://developers.facebook.com/documentation/business-messaging/whatsapp/templates/template-categorization)). Meta calls this "the default behavior", so you no longer need `allow_category_change` for it. The page doesn't call that field deprecated. It also lists a `REJECTED` status with reason `INCORRECT_CATEGORY`, without saying when that applies instead.

Review runs automatically on every create and edit. Subscribe to the `message_template_status_update` webhook, or poll the template with Meta's status call.

```bash
curl "https://graph.facebook.com/v26.0/$TEMPLATE_ID?fields=status" \
  -H "Authorization: Bearer $ACCESS_TOKEN"
```

The answer is `{"status": "APPROVED", "id": "1259544702043867"}` in Meta's sample. Other values include `REJECTED`, `PAUSED`, `DISABLED` and `ARCHIVED`. A rejection is covered in [why WhatsApp templates get rejected](/academy/articles/whatsapp-template-rejected-common-reasons/), and pauses in [template quality rating](/academy/articles/whatsapp-template-quality-rating-paused-disabled/).

Approval doesn't freeze the category. The `template_category_update` webhook announces later changes with `previous_category`, `new_category` and `correct_category`. Utility-to-marketing changes normally get one day of notice and take effect on the first day of the next month. Meta says "You have 60 days to review and appeal these changes" through Business Support Home.

## How many templates you can create

A Messaging account can create at most 100 templates per hour. If its business portfolio is unverified, it is limited to 250 templates. A verified portfolio raises that to 6,000 ([Meta template fundamentals, accessed 2026-11-04](https://developers.facebook.com/documentation/business-messaging/whatsapp/templates/overview)). The condition is that at least one WhatsApp account in the portfolio has a phone number with an approved display name. The steps are in [business verification](/academy/articles/whatsapp-business-verification-meta-business-portfolio/) and [display name approval](/academy/articles/whatsapp-display-name-guidelines-approval/). Meta's pages don't name the error code for hitting either cap.

## List and filter templates

A `GET` on the same edge lists templates. The template management page documents `fields`, `limit` and `status` as parameters. This call merges Meta's two list samples into one, adds `language` to the fields and raises the version to v26.0.

```bash
curl "https://graph.facebook.com/v26.0/$WABA_ID/message_templates?fields=name,category,status,language&status=approved&limit=5" \
  -H "Authorization: Bearer $ACCESS_TOKEN"
```

The response holds templates in `data` and cursors in `paging.cursors.before` and `paging.cursors.after`, plus a `next` URL. Neither the guide nor the reference documents a filter by category, language or name. Request those fields and filter in your own code.

## Edit a template

Send a `POST` to `https://graph.facebook.com/v26.0/TEMPLATE_ID`. Meta says "You can only edit a template's category, components, or time-to-live" ([Meta template management, accessed 2026-11-04](https://developers.facebook.com/documentation/business-messaging/whatsapp/templates/template-management)). Only templates in `APPROVED`, `REJECTED` or `PAUSED` status can be edited. The `components` array replaces every component, so send the full set each time.

"You cannot edit the category of an approved template." Approved templates also have a quota: "up to 10 times in a 30-day window, or 1 time in a 24-hour window." Rejected and paused templates have no edit limit. An edited approved or paused template goes back to approved automatically unless it fails review. A successful edit returns `{"success": true}`.

## Delete a template

Deletes are a `DELETE` on the account edge. A token with only `whatsapp_business_messaging` gets error `200`.

| Query | What gets deleted |
|---|---|
| `?name=NAME` | Every template with that name, in all languages |
| `?hsm_id=ID&name=NAME` | Only the template with that ID |
| `?hsm_ids=[ID,ID]` | Up to 100 templates by ID; nothing is deleted if any ID is invalid |

This is Meta's single-template delete, with shell variables and the version raised to v26.0.

```bash
curl -X DELETE "https://graph.facebook.com/v26.0/$WABA_ID/message_templates?hsm_id=$TEMPLATE_ID&name=order_confirmation" \
  -H "Authorization: Bearer $ACCESS_TOKEN"
```

URL-encode the brackets of `hsm_ids` when you build the query in an HTTP library. After you delete an approved template, its name is locked for 30 days. A template that was sent but not yet delivered moves to `PENDING_DELETION`, and WhatsApp keeps trying delivery for 30 days. Disabled templates can't be deleted.

Templates inactive for 12 months or more are archived automatically and scheduled for deletion 28 days later.

*Z-API Omni team*
