This API endpoint retrieves analytics data for WhatsApp message templates. It provides insights into template performance including messages sent, delivered, read, and button clicks with flexible time ranges and granularity options.
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
NoteYou will get the results in IST
Rate Limiting
⚠️ IMPORTANT: Rate limiting applied
Limit: 5 requests per 60 seconds
Purpose: Prevents excessive analytics queries
Exceeded: Returns 429 Too Many Requests
Important Notes
⚠️ Key Considerations
Required Parameter: template_ids is mandatory
Format: Use comma-separated values for multiple templates
Timestamps: Unix epoch milliseconds or YYYY-MM-DD for start/end
Granularity: Choose based on analysis needs (AGGREGATED/DAILY)
Data Freshness: May have a slight delay from real-time
Time Zones: All timestamps in UTC
To retrieve offsite conversion metrics, the same Template Analytics API must be invoked with additional parameters and constraints.
Mandatory Changes for MM Lite
| Aspect | Non–MM Lite | MM Lite |
|---|---|---|
| product_type | CLOUD_API (default) | MARKETING_MESSAGES_LITE_API |
| use_waba_timezone | Optional / false | Must be true |
| start, end format | UNIX timestamp | YYYY-MM-DD |
| Additional metrics | Not supported | Supported |
Request Parameters
| Key | Description | Value | Type | Required/Optional | Constraints |
|---|---|---|---|---|---|
Authorization |
Access Token for the application |
{{PARTNER_APP_TOKEN}} |
String |
Required |
Should be a valid Partner App Access Token |
start |
start time of the query |
{{START}} |
Long |
Optional |
Epoch (If both start and end are not provided, default time corresponding to the last 30 days is populated in-code) |
end |
end time of the query |
{{END}} |
Long |
Optional |
Epoch (If both start and end are not provided, default time corresponding to the last 30 days is populated in-code) |
granularity |
granularity of template analytics |
{{GRANULARITY}} |
String |
Optional |
DAILY or AGGREGATED |
metric_types |
comma-separated string for metrics to fetch template analytics |
{{METRIC_TYPES}} |
String |
Optional |
COST CLICKED DELIVERED READ SENT APP_ACTIVATIONS (MM Lite only) APP_ADD_TO_CART (MM Lite only) APP_CHECKOUTS_INITIATED (MM Lite only) APP_PURCHASES (MM Lite only) APP_PURCHASES_CONVERSION_VALUE (MM Lite only) WEBSITE_ADD_TO_CART (MM Lite only) WEBSITE_CHECKOUTS_INITIATED (MM Lite only) WEBSITE_PURCHASES (MM Lite only) WEBSITE_PURCHASES_CONVERSION_VALUE (MM Lite only) Optional, if not provided, all the above-mentioned metrics are considered |
template_ids |
comma-separated string for gs template ids |
{{TEMPLATE_IDS}} |
String |
Required |
Currently supports only 1 template at a time |
product_type |
The product type of the metrics you want to retrieve. If omitted, only analytics for Cloud API will be returned. |
CLOUD_API, MARKETING_MESSAGES_LITE_API |
Enum |
Optional |
Accepted values are: CLOUD_API, MARKETING_MESSAGES_LITE_API |
limit |
no. of permitted entries in response per page; submitted during Meta call |
{{LIMIT}} |
Integer |
Optional |
Optional, if not provided, default is set to 30 Currently, the limit is supported up to 30 Impacts response only if granularity is DAILY |
use_waba_timezone |
Optional. Whether to show metrics in the WABA’s configured timezone. If false or omitted, metrics will be shown in UTC. If true, params start and end must be in the format YYYY-MM-DD. |
{{USE_WABA_TIMEZONE}} |
Boolean |
Optional |
|
appId |
appId of the app to enable template analytics |
{{APP_ID}} |
String |
Required |
Should be a valid appId |
Sample Request
curl --location --request GET '{{BASE_URL}}/partner/app/{{APP_ID}}/template/analytics?start=1711935412&end=1712021812&granularity=DAILY&metric_types=SENT,DELIVERED,READ,CLICKED&template_ids={{TEMPLATE_ID}}&limit=30&product_type=MARKETING_MESSAGES_LITE_API' \
--header 'Authorization: {{PARTNER_APP_TOKEN}}'Sample Response
{
"product_type": "MARKETING_MESSAGES_LITE_API",
"status": "success",
"template_analytics": [
{
"clicked": [
{
"button_content": "Shop Now",
"count": 1,
"type": "unique_url_button"
},
{
"button_content": "Website",
"count": 1,
"type": "unique_url_button"
},
{
"button_content": "Shop Now",
"count": 1,
"type": "url_button"
},
{
"button_content": "Website",
"count": 1,
"type": "url_button"
}
],
"delivered": 3,
"end": 1764633600,
"read": 0,
"sent": 3,
"start": 1764547200,
"template_id": "fb3ccce2-62a8-43b5-abff-824c33d160ec"
}
]
}
Status Codes
| Status Code | Response | Comments |
|---|---|---|
| Success | ||
| 200 | { "status": "success", "template_analytics": \[ { "clicked": [ { "button_content": "imgurl1", "count": 8, "type": "url_button" }, { "button_content": "imgurl2", "count": 6, "type": "url_button" } ], "delivered": 2, "end": 1706572800, "read": 1, "sent": 2, "start": 1706400000, "template_id": "2c679517-6450-4556-abff-a64d1355ee7e" } ] } | Successful response |
| 200 | { "status": "success", "template_analytics": \[] } | When Meta’s API returns no data_points (this is found to occur when template has no buttons, or template is authentication type, and button clicks are disabled and we query for only CLICKED as metric type) |
| Error | ||
| 401 | { "status": "error", "message": "Unauthorised access to the resource. Please review request parameters and headers and retry" } | Bad request |
| 400 | { "message": "Start time can't be older than 90 days", "status": "error" } | |
| 404 | { "message": "Template Analytics settings for app f3bf7a6b-d694-412e-a5dd-6925c8bb2d15 does not exist", "status": "error" } |