Template Analytics

GET Method

The Template Analytics API allows you to get the details of the number of times a template has been sent, delivered, read, as well as the number of times URL buttons or Quick Reply buttons in the template have been clicked.

You can filter the template analytics associated with a WABA ID based on the following options:

  • WhatsApp Template IDs.
  • Date Range (Start Date and End Date) to which analytics refers to.
  • Granularity by which you would like to retrieve the analytics. Only daily is supported in this API.
  • WhatsApp Product Type for which analytics are requested. The types of messages (notification messages or customer support messages) for which you want to retrieve notifications.
  • Metric Types for which you want to retrieve. For example, sent, delivered, read, clicked, or replied.

Limitations

  • Template Analytics are available through the Kaleyra WhatsApp API V2 only if the account has not opted into Cloud API template analytics.
  • Kaleyra API template analytics are subject to aggregation and anonymization guidelines, which require that there be a minimum of 1000 events for the given template before the count is displayed.
  • Button click analytics are only available for templates categorized as MARKETING or UTILITY.
  • WABAs owned by or shared with Meta Business Accounts in the European Union, United Kingdom, or Japan, or that have a business phone number with a country calling code from any of those countries or regions, are not supported.
  • Data is returned with a daily granularity in the UTC zone with a lookback of up to 90 days.

Prerequisites

  1. Before you get started, Create an API Key. To view the API Key and the SID, see View API Key and SID.
    A prerequisite for using Kaleyra WhatsApp APIs is to have an active WhatsApp plan on Kaleyra platform.
  2. To set up a WhatsApp account on Kaleyra platform, see Manual Signup
    and Embedded Signup.
  3. An active WhatsApp for Business API plan that includes:
    • A WhatsApp business number.
    • An associated profile with the business number.
    • A WhatsApp verified and approved profile.
    • A WABA ID onboarded on Kaleyra WhatsApp API V2.

Base URL

https://<api_domain>/v2/<SID>

API Domain and Value

api_domainValue
IN podapi.in.kaleyra.io
SG Podapi.ap.kaleyra.io
EU Podapi.eu.kaleyra.io
NA podapi.na.kaleyra.io

API request to get Template Analytics

To get a list of all the WhatsApp templates analytics associated with a WABA ID, use the <api_domain>/v2/<sid>/whatsapp/<waba_id>/templates_analytics endpoint followed by query parameters as needed.

Request Format

The following is the request format to get the WhatsApp templates analytics:

curl --location --request GET 'https://<api_domain>/v2/<sid>/whatsapp/<waba_id>/templates_analytics?whatsapp_template_ids=<whatsapp_template_ids>&start_date=<start_date>&end_date=<end_date>&granularity=<granularity>&product_type=<product_type>&metric_types=<metric_types>&limit=<limit>&after=<after>' \ 
-header 'api-key: <api-key>'
-header 'Content-Type: <content-type>'

Sample Request Format

The following is the sample request format to get the WhatsApp template analytics:

curl --location --request GET 'https://api.in.kaleyra.io/v2/HXAP16XXXXXX97IN/whatsapp/1090XXXXXXXXXXXX/templates_analytics?whatsapp_template_ids=1317XXXXXXXXXX67,156XXXXXXXXXX011&start_date=2025-11-04&end_date=2025-11-05&granularity=daily&product_type=CLOUD_API&metric_types=sent&limit=1&after=MAZDZD' \ 
-header 'api-key: AXXXXXXXXXXXXXXXXXXXXX3' \
-header 'Content-Type: application/json'

URL Parameters and Headers

The following is the list of parameters and headers to send the outgoing message request:

Parameter / HeadersData TypeDescriptionExampleMandatory?
sidStringAccount SID (Security Identifier).HXAP16XXXXXX97INYes
waba_idStringWhatsApp Business Account. For more information, see step 1 to step 3 of Adding a new WABA ID.1090XXXXXXXXXXXXYes
Content-TypeStringIndicates the format of the content the API will be processing.The only allowed value is application/json.Yes
api-keyStringAPI key generated from kaleyra.io account.AXXXXXXXXXXXXXXXXXXXXX3Yes

Following is the list of query parameters available to further specify the request:

Parameter / Headers

Data Type

Description

Example

Mandatory?

whatsapp_template_ids

String

An array of template IDs for which you want to retrieve analytics details.
Note: You can have a maximum of 10 WhatsApp Templated IDs in a request.

1317XXXXXXXXXX67,156XXXXXXXXXX011

Yes

start_date

Date string

The start date range for which you want to retrieve analytics details. A date string in the format YYYY-MM-DD.

2025-08-21

Yes

end_date

Date String

The end date specifying the range up to which analytics details are retrieved. A date string in the format YYYY-MM-DD.

2025-08-21

Yes

granularity

String

The granularity at which you would like to retrieve the analytics. Value must be DAILY.

DAILY

Yes

product_type

String

The product type of the metrics you want to retrieve. If omitted, only analytics for Cloud API will be returned.
The supported value includes:

  • CLOUD_API
  • MARKETING_MESSAGES_LITE_API

CLOUD_API

Optional

metric_types

String

The types of metrics which you want to retrieve. If omitted or an empty array, analytics for all metric types will be returned.

SENT, DELIVERED, READ, CLICKED, REPLIED

Optional

limit

Integer

The number of templates analytic details shown in the GET response.

1

Optional

after

Sample Success Response

The following success message appears with the status 200 Accepted:

{
    "code": "WA200",
    "message": "Request successfully executed!",
    "data": [
              {
                  "granularity": "DAILY",
                  "product_type": "cloud_api",
                  "data_points": [
                      {
                          "template_id": "1317XXXXXXXXXX67",
                          "start": 1751328000,
                          "end": 1751414400,
                          "sent": 6,
                          "delivered": 6,
                          "read": 6,
                          "replied": 0,
                          "clicked": [
                              {
                                "type": "quick_reply_button",
                                "button_content": "Contact Support",
                                "count": 6
                              },
                              {
                                "type": "unique_url_button",
                                "button_content": "Tell me more",
                                "count": 5
                              }
                            ]
                      },
                      {
                          "template_id": "156XXXXXXXXXX011",
                          "start": 1751414400,
                          "end": 1751500800,
                          "sent": 0,
                          "delivered": 0,
                          "read": 0,
                          "replied": 0
                      }
                    ],
    "paging": {
        "cursors": {
            "before": "",
            "after": ""
        }
    }
    "error": {}
}

Response Parameters

The following is the list of parameters shown in the API response:

ParameterData TypeDescriptionExample
codeStringThe response code for the request was sent.WA200
messageStringThe response message corresponds to the response code.Request Processed Successfully.
dataObjectArray of the objects returned by the API response with details of the WhatsApp template analytics for data.See the specific table below for details.
pagingObjectArray of the objects returned by the API response with details of the WhatsApp template analytics for paging.See the specific table below for details.
errorArrayThe error list associated with the response.

Data object Parameters

The following is the list of parameters for Data object in the API response:

ParameterData TypeDescriptionExample
granularityStringThe granularity at which you have retrieve the analytics.DAILY
product_typeStringThe product type of the metrics you have retrieve.CLOUD_AP
data_pointsObjectArray of the objects returned by the API response with details of the WhatsApp template analytics for the data_points.See the specific table below for details.

The following is the list of parameters for data_points object in the API response:

ParameterData TypeDescriptionExample
template_idStringAn array of template ID for which you have requested to retrieve analytics details.1317XXXXXXXXXX67
startDate stringThe start date range from which you have requested to retrieve analytics details in UNIX timestamp.1751328000
endDate StringThe end date specifying the range up to which analytics details are retrieved in UNIX timestamp.1751414400
sentStringThe number of WhatsApp messages sent using the specific template ID.6
deliveredStringThe number of WhatsApp messages delivered using the specific template ID.6
readStringThe number of WhatsApp messages read by recipients using the specific template ID.6
repliedStringThe number of WhatsApp messages read by recipients using the specific template ID.0
clickedObjectArray of the objects returned by the API response with details of the WhatsApp template analytics for the clicked object.See the specific table below for details.

The following is the list of parameters for clicked object in the API response:

ParameterData TypeDescriptionExample
typeStringButton type used in the WhatsApp template.quick_reply_button
button_contentStringButton connect in the WhatsApp template.Contact Support
countStringButton count clicked used in the WhatsApp template.6

The following is the list of parameters for paging object in the API response:

ParameterData TypeDescriptionExample
cursorsObjectArray of the objects returned by the API response with details of the WhatsApp template analytics for the cursors.See the specific table below for details.

The following is the list of parameters for cursors object in the API response:

ParameterData TypeDescriptionExample
beforeIntegerView the WhatsApp template analytics details from the previous page. Only function from or after the second page.
afterIntegerView the WhatsApp template analytics details from the next pages.

Sample Failure Response

The following are the failure responses:

400 Bad request

{
    "code": "WA400",
    "message": "error returned from meta",
    "data": {},
    "error": {
        "error": "Template Insights are not available yet for this WhatsApp Business account.",
    }
}
401 Unauthorized
{
    "code": "RBC001",
    "message": "Incorrect SID or API key.",
    "data": [],
    "error": {
        "error": "Incorrect SID or API key."
    }
}
401 Wrong account
{
    "code": "WA-401",
    "message": "API is not available for given customer.Please contact support for more info",
    "data": {},
    "error": "API is not available for given customer.Please contact support for more info"
}
 
401 Unauthorized WABA
{
    "code": "WA401",
    "message": "Waba_Id is not present or does not belong to the account.",
    "data": {},
    "error": {
        "waba_id": "Waba_Id is not present or does not belong to the account."
    }
}
401 Unauthorized WABA version
{
    "code": "WA401",
    "message": "The waba_id you're using is associated with different Version of our WA API. Please use the appropriate endpoint.",
    "data": {},
    "error": {
        "waba_id": "The waba_id you're using is associated with different Version of our WA API. Please use the appropriate endpoint."
    }
}
400 Invalid Status
{
    "code": "WA400",
    "message": "invalid status given. valid values are : accepted, pending, rejected, paused, disabled",
    "data": [],
    "error": {
        "status": "invalid status given. valid values are : accepted, pending, rejected, paused, disabled"
    }
}
400 Invalid Status
{
    "code": "WA400",
    "message": "invalid status given. valid values are : accepted, pending, rejected, paused, disabled",
    "data": [],
    "error": {
        "status": "invalid status given. valid values are : accepted, pending, rejected, paused, disabled"
    }
}
500 Internal Server Error
{
    "code": "WA-500",
    "message": "Please try again later",
    "data": {},
    "error": {
        "error": "Internal server error"
    }
}





© 2026 Kaleyra Inc. All rights reserved.
Trademarks, logos and service marks displayed on this site are registered and unregistered trademarks of Kaleyra Inc.