Get template analytics

Returns time-series delivery, read, and click counts for one or more templates on an app across the requested date range and granularity.

Request parameters

Path parameters

KeyDescriptionValuesData TypeRequired/Optional
appIdIdentifier of the WhatsApp app the call acts on.6f414190-d45c-4671-bca1-fb6c3018cb13StringRequired

Query parameters

KeyDescriptionValuesData TypeRequired/Optional
startStart of the reporting window, as a Unix timestamp in seconds.1720203204StringOptional
endEnd of the reporting window, as a Unix timestamp in seconds.1721088316StringOptional
granularityBucket size for the returned metrics.DAILYStringOptional
metric_typesComma-separated metric types to return.SENT,DELIVEREDStringOptional
template_idsComma-separated template identifiers to report on.—StringRequired
limitMaximum number of records to return in one page.20IntegerOptional
product_typeProduct the metrics are reported for.CLOUD_APIStringOptional
use_waba_timezoneWhether the window is interpreted in the WABA's timezone.trueBooleanOptional

Sample cURL — Get template analytics.

curl --request GET \
  --url 'https://partner.gupshup.io/partner/bizgate/app/6f414190-d45c-4671-bca1-fb6c3018cb13/template-analytics/metrics?start=1720203204&end=1721088316&granularity=DAILY&metric_types=SENT,DELIVERED&template_ids=<template_ids>&limit=20&product_type=CLOUD_API&use_waba_timezone=true' \
  --header 'Authorization: Bearer <UT>' \
  --header 'Accept: application/json'

Sample success response (200)

{
  "status": "success",
  "data": {
    "data": [
      {
        "granularity": "DAILY",
        "product_type": "cloud_api",
        "data_points": [
          {
            "template_id": "1421988012088524",
            "start": 1718064000,
            "end": 1718150400,
            "sent": 1,
            "delivered": 1,
            "read": 1,
            "cost": [
              {
                "type": "amount_spent",
                "value": 0.01
              },
              {
                "type": "cost_per_delivered",
                "value": 0.01
              }
            ]
          },
          {
            "template_id": "2632273056924580",
            "start": 1718064000,
            "end": 1718150400,
            "sent": 1,
            "delivered": 1,
            "read": 1,
            "clicked": [
              {
                "type": "quick_reply_button",
                "button_content": "Contact Support",
                "count": 108
              },
              {
                "type": "unique_url_button",
                "button_content": "Tell me more",
                "count": 16
              }
            ],
            "cost": [
              {
                "type": "amount_spent",
                "value": 0.03
              },
              {
                "type": "cost_per_delivered",
                "value": 0.03
              },
              {
                "type": "cost_per_url_button_click",
                "value": 0.03
              }
            ]
          }
        ]
      }
    ],
    "paging": {
      "cursors": {
        "before": "MAZDZD",
        "after": "MjQZD"
      }
    }
  }
}
Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Path Params
string
required

Identifier of the WhatsApp app the call acts on.

Query Params
string

Start of the reporting window, as a Unix timestamp in seconds.

string

End of the reporting window, as a Unix timestamp in seconds.

string
Defaults to AGGREGATED

Bucket size for the returned metrics.

string
Defaults to SENT,DELIVERED,READ,CLICKED

Comma-separated metric types to return.

string
required

Comma-separated template identifiers to report on.

int32
Defaults to 30

Maximum number of records to return in one page.

string

Product the metrics are reported for.

boolean
Defaults to false

Whether the window is interpreted in the WABA's timezone.

Responses

Language
Credentials
Bearer
Universal Token (UT)
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json