This document describes how to create, manage, and measure template groups.
Template groups allow you to associate a set of templates so it's easier to track their performance as a set when querying template metrics.
Use the POST /<WABA_ID>/template_groups endpoint to create a template group.
curl 'https://graph.facebook.com/<API_VERSION>/<WABA_ID>/template_groups' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <ACCESS_TOKEN>' \
-d '
{
"name": "<TEMPLATE_GROUP_NAME>",
"description": "<TEMPLATE_GROUP_DESCRIPTION>",
"whatsapp_business_templates": [
<TEMPLATE_IDS>
]
}'| Placeholder | Description | Example value |
|---|---|---|
String | Optional. Graph API version. | v24.0 |
| Required. WhatsApp Business Account ID. |
|
String | Required. |
|
| Required. Template group name. Must be unique. Maximum 256 characters. |
|
| Optional. Template group description. Maximum 512 characters. |
|
| Required. Array of template IDs to add to the group. |
|
Upon success:
{
"id": "<TEMPLATE_GROUP_ID>"
}| Placeholder | Description | Example value |
|---|---|---|
| Template group ID. |
|
curl 'https://graph.facebook.com/v24.0/102290129340398/template_groups' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer EAAJB...' \
-d '
{
"name": "Black Friday 2024",
"description": "US-based Black Friday sale 2024 templates.",
"whatsapp_business_templates": [278077987957091,1945418102598215,1035843174854974]
}'
{
"id": "9020555671393375"
}
Use the GET /<TEMPLATE_GROUP_ID> endpoint to get data on a template group, as well as template data for each template within the group.
curl 'https://graph.facebook.com/<API_VERSION>/<TEMPLATE_GROUP_ID>' \ -H 'Authorization: Bearer <ACCESS_TOKEN>'
| Placeholder | Description | Example value |
|---|---|---|
String | Required. |
|
String | Optional. Graph API version. | v24.0 |
| Required. Template group ID. |
|
Upon success:
{
"name": "<TEMPLATE_GROUP_NAME>",
"description": "<TEMPLATE_GROUP_DESCRIPTION>",
"creation_time": "<TEMPLATE_GROUP_CREATION_TIMESTAMP>",
"update_time": "<TEMPLATE_GROUP_LAST_UPDATE_TIMESTAMP>",
"whatsapp_business_account": {
<WABA_DETAILS>
},
"whatsapp_business_templates": {
"data": [
<TEMPLATE_DETAILS>
],
"paging": {
<PAGING_CURSORS>
}
},
"id": "<TEMPLATE_GROUP_ID>"
}| Placeholder | Description | Example value |
|---|---|---|
| Template group name. |
|
| Template group description. |
|
| ISO 8601 timestamp indicating when the template group was created. |
|
| ISO 8601 timestamp indicating when the template group was last updated. |
|
| Object describing the WhatsApp Business Account that owns the template group. | See example response below. |
| Array of objects. Each object describes a template, and its components, within the template group. | See example response below. |
| An object with before-and-after paging cursors that can be used to get the next (after) or previous (before) set of objects in the result set. | See example response below. |
| Template group ID. |
|
curl 'https://graph.facebook.com/v24.0/9020555671393375' \
-H 'Authorization: Bearer EAAJB...'
Response results are truncated with ellipses (...) in the example below for brevity.
{
"name": "Black Friday 2024",
"description": "US-based Black Friday sale 2024 templates.",
"creation_time": "2025-01-06T23:05:12+0000",
"update_time": "2025-01-06T23:05:12+0000",
"whatsapp_business_account": {
"id": "102290129340398",
"name": "Lucky Shrub",
"currency": "USD",
"timezone_id": "1",
"message_template_namespace": "ba30dd89_2ebd_41e4_b805_f2c05ae04cc9"
},
"whatsapp_business_templates": {
"data": [
{
"name": "black_friday_2024_carousel_media_header_cards",
"parameter_format": "POSITIONAL",
"components": [
{
"type": "BODY",
"text": "Rare black succulents for sale! {{1}}, add...",
"example": {
"body_text": [
[
"Pablo"
]
]
}
},
{
"type": "CAROUSEL",
"cards": [
{
"components": [
{
"type": "HEADER",
"format": "IMAGE",
"example": {
"header_handle": [
"https://scontent.whatsapp.net/v/t61.29..."
]
}
},
{
"type": "BODY",
"text": "Add a touch of..."
},
{
"type": "BUTTONS",
"buttons": [
{
"type": "QUICK_REPLY",
"text": "Send me more like this!"
},
{
"type": "URL",
"text": "Shop",
"url": "https://www.luckyshrub.com/rare-succulents/{{1}}",
"example": [
"BLUE_ELF"
]
}
]
}
]
},
...
]
}
],
"language": "en_US",
"status": "APPROVED",
"category": "MARKETING",
"id": "1945418102598215"
},
...
],
"paging": {
"cursors": {
"before": "QVFIU...",
"after": "QVFIU..."
}
}
},
"id": "9020555671393375"
}
Use the POST /<TEMPLATE_GROUP_ID> endpoint to update a template group's name or description, or to add or remove templates to and from the group.
Note that removing a template from a group does not delete any metric-related data that the removed template may have already contributed to the group's overall template group metrics.
curl 'https://graph.facebook.com/<API_VERSION>/<TEMPLATE_GROUP_ID>' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <ACCESS_TOKEN>' \
-d '
{
"name": "<TEMPLATE_GROUP_NAME>",
"description": "<TEMPLATE_GROUP_DESCRIPTION>",
"add_templates": [
<TEMPLATE_IDS>
],
"remove_templates": [
<TEMPLATE_IDS>
]
}'| Placeholder | Description | Example value |
|---|---|---|
String | Optional. Graph API version. | v24.0 |
| Required. Template group ID. |
|
String | Required. |
|
| Optional. Template group name. Must be unique. Maximum 256 characters. |
|
| Optional. Template group description. Maximum 512 characters. |
|
| Optional. Array of template IDs to add to the group. |
|
Upon success:
{
"success": <SUCCESS>
}| Placeholder | Description | Example value |
|---|---|---|
| Value set to |
|
This example adds two templates to a template group while removing a third template from the group.
curl 'https://graph.facebook.com/v24.0/9020555671393375' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer EAAJB...' \
-d '
{
"add_templates": [844006344365270,1188657612184382],
"remove_templates": [1035843174854974]
}'
{
"success": true
}
Use the DELETE /<TEMPLATE_GROUP_ID> endpoint to delete a template group. Deleting a template group does not delete its associated templates.
curl -X DELETE 'https://graph.facebook.com/<API_VERSION>/<TEMPLATE_GROUP_ID>' \ -H 'Authorization: Bearer <ACCESS_TOKEN>'
| Placeholder | Description | Example value |
|---|---|---|
String | Optional. Graph API version. | v24.0 |
| Required. Template group ID. |
|
String | Required. |
|
Upon success:
{
"success": <SUCCESS>
}| Placeholder | Description | Example value |
|---|---|---|
| Value set to |
|
curl -X DELETE 'https://graph.facebook.com/v24.0/9020555671393375' \
-H 'Authorization: Bearer EAAJB...'
{
"success": true
}
See the Template group analytics document.