<!-- No parameter syntax --> { "type": "header", "format": "text", "text": "<HEADER_TEXT>" } <!-- Named parameter syntax --> { "type": "header", "format": "text", "text": "<HEADER_TEXT>", "example": { "header_text_named_params": [ { "param_name": "<NAMED_PARAMETER_NAME>", "example": "<PARAMETER_EXAMPLE_VALUE>" } ] } } <!-- Positional parameter syntax --> { "type": "header", "format": "text", "text": "<HEADER_TEXT>", "example": { "header_text": [ "<PARAMETER_EXAMPLE_VALUE>" ] } }
| Placeholder | Description | Example Value |
|---|---|---|
<HEADER_TEXT>String | Required. Header body text string. Supports 1 parameter. If this string contains a parameter, you must include the example property and example parameter value.Maximum 60 characters. | Our new sale starts {{sale_start_date}}! |
<NAMED_PARAMETER_NAME>String | Required if using a named parameter. Named parameter name. | {{sale_start_date}} |
<PARAMETER_EXAMPLE_VALUE>String | Required if using a parameter. Parameter example value. | December 1st |
{ "type": "HEADER", "format": "TEXT", "text": "Our new sale starts {{sale_start_date}}!", "example": { "header_text_named_params": [ { "param_name": "sale_start_date", "example": "December 1st" } ] } }
{ "type": "HEADER", "format": "<FORMAT>", "example": { "header_handle": [ "<HEADER_HANDLE>" ] } }
| Placeholder | Description | Example Value |
|---|---|---|
<FORMAT> | Indicates media asset type. Set to IMAGE, VIDEO, GIF, or DOCUMENT. | IMAGE |
<HEADER_HANDLE> | Uploaded media asset handle. Use the Resumable Upload API to generate an asset handle. | 4::aW... |
{ "type": "HEADER", "format": "IMAGE", "example": { "header_handle": [ "4::aW..." ] } }
UTILITY or MARKETING. Real-time locations are not supported.{ "type": "header", "format": "location" }
{ "type": "header", "format": "location" }
{ "type": "header", "parameters": [ { "type": "location", "location": { "latitude": "<LOCATION_LATITUDE>", "longitude": "<LOCATION_LONGITUDE>", "name": "<LOCATION_NAME>", "address": "<LOCATION_ADDRESS>" } } ] }
| Placeholder | Description | Sample Value |
|---|---|---|
<LOCATION_ADDRESS> | Location address. | 101 Forest Ave, Palo Alto, CA 94301 |
<LOCATION_LATITUDE> | Location latitude in decimal degrees. | 37.44211676562361 |
<LOCATION_LONGITUDE> | Location longitude in decimal degrees. | 122.16155960083124 |
<LOCATION_NAME> | Location name. | Philz Coffee |
{ "type": "header", "parameters": [ { "type": "location", "location": { "latitude": "37.44211676562361", "longitude": "-122.16155960083124", "name": "Philz Coffee", "address": "101 Forest Ave, Palo Alto, CA 94301" } } ] }
<!-- No parameters syntax --> { "type": "body", "text": "<BODY_TEXT>" } <!-- Named parameters syntax --> { "type": "body", "text": "<BODY_TEXT>", "example": { "body_text_named_params": [ { "param_name": "<NAMED_PARAMETER_NAME>", "example": "<PARAMETER_EXAMPLE_VALUE>" } <!-- Additional named parameters go here, if using --> ] } } <!-- Positional parameters syntax --> { "type": "body", "text": "<BODY_TEXT>", "example": { "body_text": [ "<PARAMETER_EXAMPLE_VALUE>" <!-- Additional positional parameters go here, if using --> ] } }
| Placeholder | Description | Example Value |
|---|---|---|
<BODY_TEXT>String | Thank you, {{first_name}}! Your order number is {{order_number}}. | |
<NAMED_PARAMETER_NAME>String | Required if using a named parameter. Named parameter name. | {{order_number}} |
<PARAMETER_EXAMPLE_VALUE>String | Required if using a parameter. Parameter example value. | December 1st |
{ "type": "body", "text": "Thank you, {{first_name}}! Your order number is {{order_number}}.", "example": { "body_text_named_params": [ { "param_name": "first_name", "example": "Pablo" }, { "param_name": "order_number", "example": "860198-230332" } ] } }
{ "type": "FOOTER", "text": "<TEXT>" }
| Placeholder | Description | Example Value |
|---|---|---|
<TEXT> | Text to appear in template footer when sent. 60 characters maximum. | Use the buttons below to manage your marketing subscriptions |
{ "type": "FOOTER", "text": "Use the buttons below to manage your marketing subscriptions" }
buttons array. For example, this template uses a voice call button and a URL button:{ "type": "BUTTONS", "buttons": [ { "type": "VOICE_CALL", "text": "Call" }, { "type": "URL", "text": "Shop Now", "url": "https://www.luckyshrub.com/shop/" } ] }

{ "type": "COPY_CODE", "example": "<EXAMPLE>" }
| Placeholder | Description | Example Value |
|---|---|---|
<EXAMPLE> | String to be copied to the device’s clipboard when tapped by the app user. Maximum 15 characters. | 250FF |
{ "type": "COPY_CODE", "example": "250FF" }
{ "type": "PHONE_NUMBER", "text": "<TEXT>", "phone_number": "<PHONE_NUMBER>" }
| Placeholder | Description | Example Value |
|---|---|---|
<PHONE_NUMBER> | Alphanumeric string. Business phone number to be called when the user taps the button. Note that some countries have special phone numbers that have leading zeros after the country calling code (for example, +55-0-955-585-95436). If you assign one of these numbers to the button, the leading zero will be stripped from the number. If your number will not work without the leading zero, assign an alternate number to the button, or add the number as message body text. 20 characters maximum. | 15550051310 |
<TEXT> | Button label text. 25 characters maximum. | Call |
{ "type": "PHONE_NUMBER", "text": "Call", "phone_number": "15550051310" }
{ "type": "QUICK_REPLY", "text": "<TEXT>" }
| Placeholder | Description | Example Value |
|---|---|---|
<TEXT> | Button label text. 25 characters maximum. | Unsubscribe |
{ "type": "QUICK_REPLY", "text": "Unsubscribe from Promos" }
{ "type": "URL", "text": "<TEXT>", "url": "<URL>", # Required if <URL> contains a variable "example": [ "<EXAMPLE>" ] }
| Placeholder | Description | Example Value |
|---|---|---|
<EXAMPLE> | URL of website. Supports 1 variable. If using a variable, add sample variable property to the end of the URL string. The URL loads in the device’s default mobile web browser when the customer taps the button. 2000 characters maximum. | https://www.luckyshrub.com/shop?promo=summer2023 |
<TEXT> | Button label text. 25 characters maximum. | Shop Now |
<URL> | URL of website that loads in the device’s default mobile web browser when the button is tapped by the app user. Supports 1 variable, appended to the end of the URL string. 2000 characters maximum. | https://www.luckyshrub.com/shop?promo={{1}} |
{ "type": "URL", "text": "Shop Now", "url": "https://www.luckyshrub.com/shop?promo={{1}}", "example": [ "summer2023" ] }
curl -L 'https://graph.facebook.com/v25.0/102290129340398/message_templates' \
-H 'Authorization: Bearer EAAJB...' \
-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"
}
]
}
]
}'
curl -L 'https://graph.facebook.com/v16.0/102290129340398/message_templates' \ -H 'Authorization: Bearer EAAJB...' \ -H 'Content-Type: application/json' \ -d ' { "name": "order_confirmation", "language": "en_US", "category": "UTILITY", "components": [ { "type": "HEADER", "format": "DOCUMENT", "example": { "header_handle": [ "4::YX..." ] } }, { "type": "BODY", "text": "Thank you for your order, {{1}}! Your order number is {{2}}. Tap the PDF linked above to view your receipt. If you have any questions, please use the buttons below to contact support. Thank you for being a customer!", "example": { "body_text": [ [ "Pablo","860198-230332" ] ] } }, { "type": "BUTTONS", "buttons": [ { "type": "PHONE_NUMBER", "text": "Call", "phone_number": "15550051310" }, { "type": "URL", "text": "Contact Support", "url": "https://www.luckyshrub.com/support" } ] } ] }'
curl 'https://graph.facebook.com/v25.0/102290129340398/message_templates' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer EAAJB...' \
-d '
{
"name": "order_delivery_update",
"language": "en_US",
"category": "UTILITY",
"components": [
{
"type": "HEADER",
"format": "LOCATION"
},
{
"type": "BODY",
"text": "Good news {{1}}! Your order #{{2}} is on its way to the location above. Thank you for your order!",
"example": {
"body_text": [
[
"Mark",
"566701"
]
]
}
},
{
"type": "FOOTER",
"text": "To stop receiving delivery updates, tap the button below."
},
{
"type":"BUTTONS",
"buttons": [
{
"type": "QUICK_REPLY",
"text": "Stop Delivery Updates"
}
]
}
]
}'