WhatsApp Cloud API - Template API | Developer Documentation
WhatsApp Cloud API - Template API
Copy for LLM
Version
Create, retrieve, update, and delete message templates.
Manage pre-approved message formats for business-initiated conversations.
Includes template submission, localization, and quality score metrics.
Base
|
|
Endpoints
GET
/{Version}/{TEMPLATE_ID}
Request Syntax
Select language
curl--requestGET\--url'https://graph.facebook.com/{Version}/{TEMPLATE_ID}'\--header'Authorization: Bearer <Token>'\--header'Content-Type: application/json'\--data'{}'
Select status code
{"Example response": {"value": {"category":"MARKETING","components": [{"format":"TEXT","text":"Fall Sale","type":"HEADER"},{"example": {"body_text": [["FALL25"]]},"text":"Hi {{1}}, our Fall Sale is on! Use promo code {{2}} Get an extra 25% off every order above $350!","type":"BODY"},{"text":"Not interested in any of our sales? Tap Stop Promotions","type":"FOOTER"},{"buttons": [{"text":"Stop promotions","type":"QUICK_REPLY"}],"type":"BUTTONS"}],"id":"920070352646140","language":"en_US","name":"2023_april_promo","status":"APPROVED"}}}
Select language
Select status code
Select language
Select status code
Select language
Select status code
Select language
Select status code
Authentication
Scheme
Type
Location
curl--requestGET\--url'https://graph.facebook.com/{Version}/{TEMPLATE_ID}'\--header'Authorization: Bearer <Token>'\--header'Content-Type: application/json'\--data'{}'
{"Example response": {"value": {"category":"MARKETING","components": [{"format":"TEXT","text":"Fall Sale","type":"HEADER"},{"example": {"body_text": [["FALL25"]]},"text":"Hi {{1}}, our Fall Sale is on! Use promo code {{2}} Get an extra 25% off every order above $350!","type":"BODY"},{"text":"Not interested in any of our sales? Tap Stop Promotions","type":"FOOTER"},{"buttons": [{"text":"Stop promotions","type":"QUICK_REPLY"}],"type":"BUTTONS"}],"id":"920070352646140","language":"en_US","name":"2023_april_promo","status":"APPROVED"}}}
POST /{Version}/{TEMPLATE_ID}
Request Syntax
curl--requestPOST \--url'https://graph.facebook.com/{Version}/{TEMPLATE_ID}'\--header'Authorization: Bearer <Token>'\--header'Content-Type: application/json'\--data'{"category": "MARKETING","components": [{"format": "TEXT","text": "Fall Sale","type": "HEADER"},{"example": {"body_text": [["FALL25"]]},"text": "Hi {{1}}, our Fall Sale is on! Usepromo code {{2}} Get an extra 25% off every orderabove $350!","type": "BODY"},{"text": "Not interested in any of our sales?Tap Stop Promotions","type": "FOOTER"},{"buttons": [{"text": "Stop promotions","type": "QUICK_REPLY"}],"type": "BUTTONS"}],"language": "en_US","name": "2023_april_promo"}'
{"Example response": {"value": {"success":true}}}
curl--requestPOST \--url'https://graph.facebook.com/{Version}/{TEMPLATE_ID}'\--header'Authorization: Bearer <Token>'\--header'Content-Type: application/json'\--data'{"category": "MARKETING","components": [{"format": "TEXT","text": "Fall Sale","type": "HEADER"},{"example": {"body_text": [["FALL25"]]},"text": "Hi {{1}}, our Fall Sale is on! Usepromo code {{2}} Get an extra 25% off every orderabove $350!","type": "BODY"},{"text": "Not interested in any of our sales?Tap Stop Promotions","type": "FOOTER"},{"buttons": [{"text": "Stop promotions","type": "QUICK_REPLY"}],"type": "BUTTONS"}],"language": "en_US","name": "2023_april_promo"}'
{"Example response": {"value": {"success":true}}}
GET /{Version}/{WABA-ID}/message_templates
Request Syntax
curl--requestGET\--url'https://graph.facebook.com/{Version}/{WABA-ID}/message_templates'\--header'Authorization: Bearer <Token>'\--header'Content-Type: application/json'\--data'{}'
{"Example response": {"value": {"data": [{"category":"MARKETING","components": [{"format":"TEXT","text":"Hello World","type":"HEADER"},{"text":"Welcome and congratulations!! This messagedemonstrates your ability to send a messagenotification from WhatsApp Business Platform’sCloud API. Thank you for taking the time to testwith us.","type":"BODY"},{"text":"WhatsApp Business API Team","type":"FOOTER"}],"id":"1192339204654487","language":"en_US","name":"hello_world","previous_category":"ACCOUNT_UPDATE","status":"APPROVED"},{"category":"MARKETING","components": [{"format":"TEXT","text":"Fall Sale","type":"HEADER"},{"example": {"body_text": [["FALL25"]]},"text":"Hi {{1}}, our Fall Sale is on! Use promo code {{2}} Get an extra 25% off every order above $350!","type":"BODY"},{"text":"Not interested in any of our sales? Tap Stop Promotions","type":"FOOTER"},{"buttons": [{"text":"Stop promotions","type":"QUICK_REPLY"}],"type":"BUTTONS"}],"id":"920070352646140","language":"en_US","name":"2023_april_promo","status":"APPROVED"}],"paging": {"cursors": {"after":"MjQZD","before":"MAZDZD"}}}}}
curl--requestGET\--url'https://graph.facebook.com/{Version}/{WABA-ID}/message_templates'\--header'Authorization: Bearer <Token>'\--header'Content-Type: application/json'\--data'{}'
{"Example response": {"value": {"data": [{"category":"MARKETING","components": [{"format":"TEXT","text":"Hello World","type":"HEADER"},{"text":"Welcome and congratulations!! This messagedemonstrates your ability to send a messagenotification from WhatsApp Business Platform’sCloud API. Thank you for taking the time to testwith us.","type":"BODY"},{"text":"WhatsApp Business API Team","type":"FOOTER"}],"id":"1192339204654487","language":"en_US","name":"hello_world","previous_category":"ACCOUNT_UPDATE","status":"APPROVED"},{"category":"MARKETING","components": [{"format":"TEXT","text":"Fall Sale","type":"HEADER"},{"example": {"body_text": [["FALL25"]]},"text":"Hi {{1}}, our Fall Sale is on! Use promo code {{2}} Get an extra 25% off every order above $350!","type":"BODY"},{"text":"Not interested in any of our sales? Tap Stop Promotions","type":"FOOTER"},{"buttons": [{"text":"Stop promotions","type":"QUICK_REPLY"}],"type":"BUTTONS"}],"id":"920070352646140","language":"en_US","name":"2023_april_promo","status":"APPROVED"}],"paging": {"cursors": {"after":"MjQZD","before":"MAZDZD"}}}}}
POST /{Version}/{WABA-ID}/message_templates
Request Syntax
curl--requestPOST \--url'https://graph.facebook.com/{Version}/{WABA-ID}/message_templates'\--header'Authorization: Bearer <Token>'\--header'Content-Type: application/json'\--data'{"category": "MARKETING","components": [{"text": "Check out this new offer","type": "body"},{"buttons": [{"flow_action": "navigate","flow_json": "{\"version\":\"5.0\",\"screens\":[{\"id\":\"WELCOME_SCREEN\",\"layout\":{\"type\":\"SingleColumnLayout\",\"children\":[{\"type\":\"TextHeading\",\"text\":\"Hello World\"},{\"type\":\"Footer\",\"label\":\"Complete\",\"on-click-action\":{\"name\":\"complete\",\"payload\":{}}}]},\"title\":\"Welcome\",\"terminal\":true,\"success\":true,\"data\":{}}]}","navigate_screen": "WELCOME_SCREEN","text": "Check out this offer!","type": "FLOW"}],"type": "BUTTONS"}],"language": "en_US","name": "<TEMPLATE_NAME>"}'
{"Create Flow Template Message by Flow JSON": {"value": {"category":"MARKETING","id":"template-1","status":"PENDING"}},"Create Flow Template Message by ID": {"value": {"category":"MARKETING","id":"template-1","status":"PENDING"}},"Create Flow Template Message by Name": {"value": {"category":"MARKETING","id":"template-1","status":"PENDING"}},"Example response": {"value": {"category":"UTILITY","id":"1689556908129832","status":"PENDING"}}}
curl--requestPOST \--url'https://graph.facebook.com/{Version}/{WABA-ID}/message_templates'\--header'Authorization: Bearer <Token>'\--header'Content-Type: application/json'\--data'{"category": "MARKETING","components": [{"text": "Check out this new offer","type": "body"},{"buttons": [{"flow_action": "navigate","flow_json": "{\"version\":\"5.0\",\"screens\":[{\"id\":\"WELCOME_SCREEN\",\"layout\":{\"type\":\"SingleColumnLayout\",\"children\":[{\"type\":\"TextHeading\",\"text\":\"Hello World\"},{\"type\":\"Footer\",\"label\":\"Complete\",\"on-click-action\":{\"name\":\"complete\",\"payload\":{}}}]},\"title\":\"Welcome\",\"terminal\":true,\"success\":true,\"data\":{}}]}","navigate_screen": "WELCOME_SCREEN","text": "Check out this offer!","type": "FLOW"}],"type": "BUTTONS"}],"language": "en_US","name": "<TEMPLATE_NAME>"}'
{"Create Flow Template Message by Flow JSON": {"value": {"category":"MARKETING","id":"template-1","status":"PENDING"}},"Create Flow Template Message by ID": {"value": {"category":"MARKETING","id":"template-1","status":"PENDING"}},"Create Flow Template Message by Name": {"value": {"category":"MARKETING","id":"template-1","status":"PENDING"}},"Example response": {"value": {"category":"UTILITY","id":"1689556908129832","status":"PENDING"}}}
DELETE /{Version}/{WABA-ID}/message_templates
Request Syntax
curl--requestDELETE \--url'https://graph.facebook.com/{Version}/{WABA-ID}/message_templates'\--header'Authorization: Bearer <Token>'\--header'Content-Type: application/json'\--data'{}'
{"Example response": {"value": {"success":true}}}
curl--requestDELETE \--url'https://graph.facebook.com/{Version}/{WABA-ID}/message_templates'\--header'Authorization: Bearer <Token>'\--header'Content-Type: application/json'\--data'{}'
{"Example response": {"value": {"success":true}}}
Authentication
HTTP Bearer |
Header:
AuthorizationUsage Examples
bearerAuth:
Include
Authorization: Bearer your-token-here in request headersGlobal Authentication Requirements
All endpoints require:
bearerAuth