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 URL
https://graph.facebook.com |
Endpoints
GET | |
POST | |
GET | |
POST | |
DELETE |
GET /{Version}/{TEMPLATE_ID}
Guide: Message Templates
Endpoint reference: WhatsApp Message Template
Request Syntax
GET /{Version}/{TEMPLATE_ID}
Try it
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"
}
}
}
Header Parameters
User-Agentstring
The user agent string identifying the client software making the request.
Authorizationstring·required
Bearer token for API authentication. This should be a valid access token obtained through the appropriate OAuth flow or system user token.
Path Parameters
Versionstring·required
TEMPLATE_IDstring·required
Responses
Guide: Message Templates
Endpoint reference: WhatsApp Message Template
200
Example response
Content Type: application/json
Schema: object
Show child attributes
categorystring
componentsarray of object
Show child attributes
components[]object
Show child attributes
idstring
languagestring
namestring
statusstring
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"
}
}
}
POST /{Version}/{TEMPLATE_ID}
Guide: Message Templates
Endpoint reference: WhatsApp Message Template
Request Syntax
POST /{Version}/{TEMPLATE_ID}
Try it
Select language
curl--request POST \
--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! 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"
}
],
"language": "en_US",
"name": "2023_april_promo"
}'
Select status code
{
"Example response": {
"value": {
"success": true
}
}
}
Header Parameters
User-Agentstring
The user agent string identifying the client software making the request.
Authorizationstring·required
Bearer token for API authentication. This should be a valid access token obtained through the appropriate OAuth flow or system user token.
Path Parameters
Versionstring·required
TEMPLATE_IDstring·required
Request BodyOptional
Content Type: application/json
Schema: object
Show child attributes
categorystring
componentsarray of object
Show child attributes
components[]object
Show child attributes
languagestring
namestring
Responses
Guide: Message Templates
Endpoint reference: WhatsApp Message Template
200
Example response
Content Type: application/json
Schema: object
Show child attributes
successboolean
Select language
curl--request POST \
--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! 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"
}
],
"language": "en_US",
"name": "2023_april_promo"
}'
Select status code
{
"Example response": {
"value": {
"success": true
}
}
}
GET /{Version}/{WABA-ID}/message_templates
Guide: Message Templates
Endpoint reference: WhatsApp Business Account > Message Templates
Request Syntax
GET /{Version}/{WABA-ID}/message_templates
Try it
Select language
curl--requestGET \
--url'https://graph.facebook.com/{Version}/{WABA-ID}/message_templates' \
--header'Authorization: Bearer <Token>' \
--header'Content-Type: application/json' \
--data'{}'
Select status code
{
"Example response": {
"value": {
"data": [
{
"category": "MARKETING",
"components": [
{
"format": "TEXT",
"text": "Hello World",
"type": "HEADER"
},
{
"text": "Welcome and congratulations!! This message demonstrates your ability to send a message notification from WhatsApp Business Platform’s Cloud API. Thank you for taking the time to test with 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"
}
}
}
}
}
Header Parameters
User-Agentstring
The user agent string identifying the client software making the request.
Authorizationstring·required
Bearer token for API authentication. This should be a valid access token obtained through the appropriate OAuth flow or system user token.
Path Parameters
Versionstring·required
WABA-IDstring·required
Query Parameters
namestring
Responses
Guide: Message Templates
Endpoint reference: WhatsApp Business Account > Message Templates
200
Example response / Example response
Content Type: application/json
Schema: object
Show child attributes
dataarray of object
Show child attributes
data[]object
Show child attributes
categorystring
componentsarray of object
Show child attributes
components[]object
Show child attributes
idstring
languagestring
namestring
statusstring
pagingobject
Show child attributes
cursorsobject
Show child attributes
afterstring
beforestring
Select language
curl--requestGET \
--url'https://graph.facebook.com/{Version}/{WABA-ID}/message_templates' \
--header'Authorization: Bearer <Token>' \
--header'Content-Type: application/json' \
--data'{}'
Select status code
{
"Example response": {
"value": {
"data": [
{
"category": "MARKETING",
"components": [
{
"format": "TEXT",
"text": "Hello World",
"type": "HEADER"
},
{
"text": "Welcome and congratulations!! This message demonstrates your ability to send a message notification from WhatsApp Business Platform’s Cloud API. Thank you for taking the time to test with 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
Guide: Message Templates
Endpoint reference: WhatsApp Business Account > Message Templates
Request Syntax
POST /{Version}/{WABA-ID}/message_templates
Try it
Select language
curl--request POST \
--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>"
}'
Select status code
{
"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"
}
}
}
Header Parameters
User-Agentstring
The user agent string identifying the client software making the request.
Authorizationstring·required
Bearer token for API authentication. This should be a valid access token obtained through the appropriate OAuth flow or system user token.
Path Parameters
Versionstring·required
WABA-IDstring·required
Request BodyOptional
Content Type: application/json
Schema: object
Show child attributes
categorystring
componentsarray of object
Show child attributes
components[]object
Show child attributes
languagestring
namestring
Responses
Guide: Message Templates
Endpoint reference: WhatsApp Business Account > Message Templates
200
Example response / Example response / Example response / Example response / Example response / Example response / Example response / Example response / Create Flow Template Message by Name / Create Flow Template Message by Flow JSON / Create Flow Template Message by ID
Content Type: application/json
Schema: object
Show child attributes
categorystring
idstring
statusstring
Select language
curl--request POST \
--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>"
}'
Select status code
{
"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
Guide: Message Templates
Endpoint reference: WhatsApp Business Account > Message Templates
Request Syntax
DELETE /{Version}/{WABA-ID}/message_templates
Try it
Select language
curl--request DELETE \
--url'https://graph.facebook.com/{Version}/{WABA-ID}/message_templates' \
--header'Authorization: Bearer <Token>' \
--header'Content-Type: application/json' \
--data'{}'
Select status code
{
"Example response": {
"value": {
"success": true
}
}
}
Header Parameters
User-Agentstring
The user agent string identifying the client software making the request.
Authorizationstring·required
Bearer token for API authentication. This should be a valid access token obtained through the appropriate OAuth flow or system user token.
Path Parameters
Versionstring·required
WABA-IDstring·required
Query Parameters
namestring
hsm_idstring
Template ID
Responses
Guide: Message Templates
Endpoint reference: WhatsApp Business Account > Message Templates
200
Example response / Example response
Content Type: application/json
Schema: object
Show child attributes
successboolean
Select language
curl--request DELETE \
--url'https://graph.facebook.com/{Version}/{WABA-ID}/message_templates' \
--header'Authorization: Bearer <Token>' \
--header'Content-Type: application/json' \
--data'{}'
Select status code
{
"Example response": {
"value": {
"success": true
}
}
}
Authentication
Scheme | Type | Location |
bearerAuth | HTTP Bearer | Header: Authorization |
Usage Examples
bearerAuth:
Include
Authorization: Bearer your-token-here in request headersGlobal Authentication Requirements
All endpoints require:
bearerAuth
No comments to display
No comments to display