Skip to content

Template Management API

Also called: Message Templates API · WhatsApp template API · message_templates endpoint

The Graph API calls that create, list, edit and delete WhatsApp message templates through a WABA's message_templates edge and each template's own ID.

Reviewed

What is the Template Management API?

The Template Management API is the set of Graph API calls that manage WhatsApp message templates in code instead of in WhatsApp Manager. It is the template-specific slice of the WhatsApp Business Management API. Almost everything hangs off one edge of the WhatsApp Business Account (WABA), /{WABA_ID}/message_templates: POST creates a template, GET lists them and DELETE removes them. Each template also has its own node, /{TEMPLATE_ID}, which you GET to read one template and POST to edit it.

Every call needs an access token carrying the whatsapp_business_management permission, normally a system user access token assigned to the WABA. A token with only whatsapp_business_messaging can send templates but gets error 200 when it tries to manage them. A create request carries a name (lowercase letters, digits and underscores, up to 512 characters), a language code, a category (MARKETING, UTILITY or AUTHENTICATION) and a components array with example values, plus optional parameter_format (POSITIONAL or NAMED) and message_send_ttl_seconds. The response returns the new template's id, status and category.

Listing is filtered and paged. GET /{WABA_ID}/message_templates accepts name, language, category, status, quality_score and content filters, a fields list and a limit, and returns a data array with paging cursors and a paging.next URL to follow. Status values include APPROVED, PENDING, REJECTED, PAUSED, DISABLED, IN_APPEAL, PENDING_DELETION and ARCHIVED. A requested summary can also report message_template_count and message_template_limit, which shows how close the WABA is to its template limit.

The API manages templates; it does not send them. Sending goes through the Cloud API's /{PHONE_NUMBER_ID}/messages endpoint with type: template, and review outcomes come back asynchronously on the message_template_status_update webhook. It is also distinct from the Business Management API, which handles business portfolios, system users and asset sharing one level above the WABA.

Key takeaways

  • The Template Management API creates, lists, edits and deletes WhatsApp templates through Graph API calls on a WABA's message_templates edge.
  • Every call needs a token with whatsapp_business_management; a messaging-only token can send templates but not manage them.
  • Create with POST /{WABA_ID}/message_templates, edit with POST /{TEMPLATE_ID}, delete with DELETE on the edge by name, hsm_id or hsm_ids.
  • A WABA can create at most 100 templates per hour, and a name that already exists in that language returns error 100, subcode 2388024.
  • Review outcomes arrive on the message_template_status_update webhook, so listen for it instead of polling each template's status.

See InfiQ pricing

Interactive stop

Create a template and read Meta's answer

2 / 2
POSThttps://graph.facebook.com/v26.0/102290129340398/message_templates

POST 200 in 900 ms

Request

3 headers · body
POST /v26.0/102290129340398/message_templates HTTP/1.1
Host: graph.facebook.com
Authorization: Bearer {ACCESS_TOKEN}
Content-Type: application/json
{
"name": "class_reminder",
"language": "bn",
"category": "UTILITY",
"components": [
{
"type": "BODY",
"text": "নমস্কার {{1}}, আপনার {{2}} ক্লাস আজ {{3}}-এ শুরু হবে। কয়েক মিনিট আগে অ্যাপ থেকে যোগ দিন।",
"example": {
"body_text": [
[
"রিয়া",
"দশম শ্রেণির পদার্থবিদ্যা",
"সন্ধ্যা ৫:৩০"
]
]
}
}
]
}

Response

200 OK
HTTP/1.1 200 OK
Content-Type: application/json
{
"id": "1407680676729941",
"status": "PENDING",
"category": "UTILITY"
}
Try another response
Press Send to post a new utility template to the WABA's message_templates edge and get back its ID, PENDING status and category. Toggle the alternatives to see a duplicate name, an over-long body and a messaging-only token.

Response: 200 OK after 900 ms.

Why does the Template Management API matter?

With a handful of templates, WhatsApp Manager is enough. With dozens of messages in several languages, or many client WABAs on one platform, clicking through screens stops scaling and starts causing drift. The API lets a team treat templates as code: create every translation from version-controlled JSON, pull status and rejection reasons into its own dashboards, edit content without breaking the names integrations rely on, and clear out dead drafts before the template limit bites. It is also the only practical way for a platform or partner to keep hundreds of templates consistent across client accounts.

How does the Template Management API work?

  1. Get a token with the management permission

    Create a system user in the business portfolio, assign it the WABA, and generate a token with whatsapp_business_management (plus whatsapp_business_messaging if the same service also sends).

  2. Create the template

    POST /{WABA_ID}/message_templates with name, language, category and components, including an example for every variable. The response is { id, status, category }, typically with status PENDING while review runs. A WABA can create at most 100 templates per hour.

  3. Track the review

    Subscribe the app to the message_template_status_update webhook field to hear about approvals, rejections, pauses and disables as they happen. For a one-off check, GET /{TEMPLATE_ID}?fields=name,language,status,category reads a single template.

  4. List and audit

    GET /{WABA_ID}/message_templates?fields=id,name,language,status,category&status=REJECTED&limit=100 returns one page; keep following paging.next until it disappears so audits see every template.

  5. Edit in place

    POST /{TEMPLATE_ID} with the complete components array (edits replace every component), a new message_send_ttl_seconds, or a new category on a template that is not approved. Approved templates allow 10 edits per 30 days and one per 24 hours.

  6. Delete what you no longer need

    DELETE /{WABA_ID}/message_templates with name (every language), name plus hsm_id (one translation) or hsm_ids (up to 100 IDs). A deleted approved template's name is blocked for 30 days.

The Template Management API in code

curl -X POST "https://graph.facebook.com/v26.0/{WABA_ID}/message_templates" \
-H "Authorization: Bearer {ACCESS_TOKEN}" \
-H "Content-Type: application/json" \
-d '{
"name": "class_reminder",
"language": "en_IN",
"category": "UTILITY",
"components": [
{ "type": "BODY",
"text": "Hi {{1}}, your {{2}} class starts at {{3}} today. Join from the app a few minutes early.",
"example": { "body_text": [["Riya", "Class 10 Physics", "5:30 pm"]] } }
]
}'
# 200 OK
# {"id": "{TEMPLATE_ID}", "status": "PENDING", "category": "UTILITY"}

Every variable needs an example value; templates without examples are not approved.

The Template Management API: key facts and limits

Create · list · delete
POST · GET · DELETE /{WABA_ID}/message_templates
Read · edit one template
GET · POST /{TEMPLATE_ID}
Creation rate
100 templates per WABA per hour
List filters
name, language, category, status, quality_score, content
Create response
id, status, category
Duplicate name + language
Error 100, subcode 2388024
Too many calls
Error 80008 (rate limit for the WABA)

Common mistakes with the Template Management API

  • Managing templates with a messaging-only token

    A token scoped to whatsapp_business_messaging sends fine but fails every create, edit and delete with error 200. Generate the management token for the service that owns templates and keep it out of the sending path if you can.

  • Polling status in a tight loop

    Checking every pending template every few seconds burns your rate limit and ends in error 80008. Subscribe to message_template_status_update and fall back to an occasional list call.

  • Stopping at the first page

    The list endpoint pages its results. Follow paging.next until it is absent, or audits and clean-ups will quietly miss templates.

  • Editing with a partial components array

    An edit replaces every component. Read the template first and send the whole array back, or the header, footer and buttons you left out disappear.

  • Keying everything on the template name

    One name can exist in many languages, each with its own ID and status. Store the id with name and language, and use hsm_id when only one translation should be deleted.

Best practices for the Template Management API

  • Keep each template's full JSON in version control and treat the API as the deploy target, not the source of truth.
  • Ask for only the fields you need; listing full components for thousands of templates is slow.
  • Run a daily audit with status=REJECTED and status=PAUSED filters and route the results to whoever owns the copy.
  • Validate lengths, variable order and example values locally before every create call, so review only ever sees clean payloads.

Example: Templates as code at a Kolkata tutoring platform

A Kolkata online tutoring platform keeps its 36 templates (12 messages in English, Hindi and Bengali) as JSON files in Git. On every merge, a deploy job lists the WABA's templates, creates any translation that is missing with a POST to message_templates, and edits changed ones with a POST to the template ID, holding back a second edit to the same approved template until 24 hours have passed. A webhook consumer writes every message_template_status_update event to the team's chat. When the new Bengali class_reminder came back REJECTED because its example values had been left in English, the developer saw the event within minutes, sent an edit with Bengali samples (rejected templates have no edit limit), and the translation was approved the same afternoon, without anyone opening WhatsApp Manager.

— Templates as code at a Kolkata tutoring platform

Template Management API FAQs

Which permission does the WhatsApp template API need?+
It needs `whatsapp_business_management`. Tokens that only hold `whatsapp_business_messaging` can send templates, but create, edit, list and delete calls fail with error 200.
How do I check a template's approval status through the API?+
Read it with `GET /{TEMPLATE_ID}?fields=status`, or list with a `status` filter. For real-time updates, subscribe to the `message_template_status_update` webhook instead of polling.
Can I send messages with the Template Management API?+
No. It only manages templates. Messages are sent through the Cloud API's `/{PHONE_NUMBER_ID}/messages` endpoint with `type: template`, naming the template and its language.
How many templates can I create through the API?+
Up to 100 per WABA per hour, within the WABA's template limit. That limit is 250 for an unverified portfolio and up to 6,000 once it is verified with an approved display name.
Is there an API to copy templates to another WABA?+
Yes. `POST /{DESTINATION_WABA_ID}/migrate_message_templates` copies eligible approved templates from another WABA owned by the same business; see template migration for the rules.

Talk to InfiQ

From definition to your first message

InfiQ is an official Meta Business Partner. Start a 7-day free trial — no card needed — and see this running on your own number.