- Templates
- Practitioner
- Developers
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.
Interactive stop
Create a template and read Meta's answer
https://graph.facebook.com/v26.0/102290129340398/message_templatesPOST 200 in 900 ms(simulated)
Request
3 headers · bodyResponse
200 OKResponse: 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?
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(pluswhatsapp_business_messagingif the same service also sends).Create the template
POST /{WABA_ID}/message_templateswithname,language,categoryandcomponents, including anexamplefor every variable. The response is{ id, status, category }, typically with statusPENDINGwhile review runs. A WABA can create at most 100 templates per hour.Track the review
Subscribe the app to the
message_template_status_updatewebhook field to hear about approvals, rejections, pauses and disables as they happen. For a one-off check,GET /{TEMPLATE_ID}?fields=name,language,status,categoryreads a single template.List and audit
GET /{WABA_ID}/message_templates?fields=id,name,language,status,category&status=REJECTED&limit=100returns one page; keep followingpaging.nextuntil it disappears so audits see every template.Edit in place
POST /{TEMPLATE_ID}with the completecomponentsarray (edits replace every component), a newmessage_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.Delete what you no longer need
DELETE /{WABA_ID}/message_templateswithname(every language),nameplushsm_id(one translation) orhsm_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}
- Permission
- whatsapp_business_management
- 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_messagingsends 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_updateand fall back to an occasional list call.Stopping at the first page
The list endpoint pages its results. Follow
paging.nextuntil 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
idwith name and language, and usehsm_idwhen 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
fieldsyou need; listing fullcomponentsfor thousands of templates is slow. - Run a daily audit with
status=REJECTEDandstatus=PAUSEDfilters 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.
Template Management API FAQs
Which permission does the WhatsApp template API need?+
How do I check a template's approval status through the API?+
Can I send messages with the Template Management API?+
How many templates can I create through the API?+
Is there an API to copy templates to another WABA?+
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.