Get outbound WhatsApp statistics by template
GET
/v1/whatsapp/stats/templates
const stats = await bird.whatsapp.stats.byTemplate({ from: "2026-08-01", to: "2026-08-31" });
for (const row of stats.data ?? []) {
console.log(row.template_id, row.delivery);
}stats = client.whatsapp.stats.by_template(from_="2026-08-01", to="2026-08-31")
for row in stats.data or []:
print(row.template_id, row.delivery)stats, err := client.Whatsapp.Stats.ByTemplate(context.Background(), bird.WhatsappStatsByTemplateParams{
From: time.Now().AddDate(0, -1, 0),
To: time.Now(),
})
if err != nil {
log.Fatal(err)
}
for _, row := range *stats.Data {
fmt.Println(*row.TemplateId, *row.Delivery.Accepted)
}$byTemplate = $bird->whatsapp->stats->byTemplate(['from' => '2026-08-01', 'to' => '2026-08-31']);
foreach ($byTemplate->getData() ?? [] as $row) {
echo $row->getTemplateId(), ' ', $row->getDelivery()?->getAccepted(), PHP_EOL;
}bird whatsapp stats by-templatecurl -X GET "https://us1.platform.bird.com/v1/whatsapp/stats/templates" \
-H "Authorization: Bearer $TOKEN" \
--url-query "limit=50"Respons200
{
"period": {
"from": "2026-05-01",
"to": "2026-05-25",
"data_as_of": "2026-05-25T14:03:10Z"
},
"data": [
{
"template_id": "wat_01krdgeqcxet5s7t44vh8rt9mg",
"delivery": {
"accepted": 4820,
"sent": 4810,
"delivered": 4720,
"failed": 25,
"rejected": 412,
"delivery_rate": 0.9793,
"failure_rate": 0.0052
},
"engagement": {
"read": 3105,
"read_rate": 0.6578
},
"latency": {
"processing": {
"p50_ms": 610,
"p95_ms": 2140,
"p99_ms": 5380
},
"delivery": {
"p50_ms": 1530,
"p95_ms": 6820,
"p99_ms": 18400
},
"total": {
"p50_ms": 2180,
"p95_ms": 9060,
"p99_ms": 24300
}
}
}
],
"total": 7
}
Returns lifecycle counts and delivery rates for WhatsApp messages grouped by the template they were sent from, for the requested period. Rows are keyed by template_id, matching the email template breakdown, so a renamed template stays one row. Rows are ranked by accepted volume descending and capped at the requested limit (default 50, max 200). Rows use send-time attribution. A delivery confirmed during the period for a message accepted earlier counts against the earlier period. A recent period therefore under-reports delivered while delivery reports are still arriving, and its counts grow as reports arrive. The maximum window is 365 days; a longer range returns 422. A breakdown is already a single-dimension view and takes no dimension filter; to restrict statistics to a single template, category, phone number or tag, use the summary, daily or hourly statistics instead. For the coarser split across Meta's marketing, utility, and authentication categories, use the template-categories breakdown instead. Each row also carries the same three latency families as the summary: processing, delivery and total. delivery is measured from a best-effort handoff timestamp that a fast delivery callback can beat, so it can be absent for a row whose other two families are present.
Parameter Kueri
from
string
Inclusive start of the window, a calendar day (YYYY-MM-DD). Interpreted in timezone, or UTC when omitted. Must not be after to. Max window 365 days. Defaults to 30 days before to when omitted.
to
string
Inclusive end of the window, a calendar day (YYYY-MM-DD). Interpreted in timezone, or UTC when omitted. Max window 365 days. Defaults to today in that timezone when omitted.
timezone
string
IANA timezone identifier used to group statistics, for example Asia/Kathmandu. The default is UTC. Day and hour boundaries, including the default window when from and to are omitted, follow this timezone. When this parameter is set, pass from and to as calendar days or Z instants instead of timestamps with explicit UTC offsets.
limit
integer
Maximum number of template rows to return, ranked by accepted volume descending.
Payload Respons
period
object
wajib
The window the response covers (echoed back), plus data_as_of.
Tampilkan atribut turunan
period.from
string
wajib
Inclusive start of the window, as a calendar day (YYYY-MM-DD) or an RFC 3339 hour boundary.
period.to
string
wajib
Inclusive end of the window, as a calendar day (YYYY-MM-DD) or an RFC 3339 hour boundary.
period.data_as_of
nullable string
Latest time reflected in the statistics. More recent events might not be included yet. Null when the freshness boundary is unavailable.
data
array of object
wajib
Template rows ranked by accepted volume descending.
Tampilkan atribut turunan
data.template_id
string
wajib
The template these messages were sent from, using the same id the WhatsApp template endpoints return. A send that resolved no template does not appear in this breakdown. A template renamed after it was used to send still reports under this one id, and a template deleted after sending keeps its row rather than dropping the messages.
data.delivery
object
wajib
Tampilkan atribut turunan
data.delivery.accepted
integer
wajib
Distinct messages accepted for sending after admission checks. This is the denominator for delivery_rate and failure_rate.
data.delivery.sent
integer
wajib
Distinct messages handed off for delivery.
data.delivery.delivered
integer
wajib
Distinct messages confirmed delivered to the recipient's device.
data.delivery.failed
integer
wajib
Distinct messages that failed during sending or delivery.
data.delivery.rejected
integer
wajib
Distinct messages rejected before any send attempt, because the recipient is on the workspace's suppression list, no reachable recipient was given, the destination has no price, or the wallet could not fund the send. Rejected messages are never charged and are not counted in accepted, so the total addressed is accepted + rejected. Excluded from failure_rate, which covers send failures only.
data.delivery.delivery_rate
nullable number
wajib
Share of accepted messages that were delivered, computed as delivered / accepted. Null when no messages were accepted in scope.
data.delivery.failure_rate
nullable number
wajib
Share of accepted messages that ultimately failed, computed as failed / accepted. Null when no messages were accepted in scope.
data.engagement
object
wajib
Tampilkan atribut turunan
data.engagement.read
integer
wajib
Distinct messages confirmed read by the recipient.
data.engagement.read_rate
nullable number
wajib
Distinct messages read relative to messages delivered in the same scope, computed as read / delivery.delivered. Both counts are attributed by send time, so a read is counted alongside its own message's delivery. The rate can exceed 1 where a read receipt arrived for a message whose delivery receipt did not, or, at high volume, because the counts are close estimates. Null when delivery.delivered is zero.
data.latency
object
wajib
Tampilkan atribut turunan
data.latency.processing
object
Approximate p50, p95, and p99 latency percentiles in milliseconds for one latency family. All three are null when no qualifying event contributed a measurement.
Tampilkan atribut turunan
data.latency.processing.p50_ms
nullable integer
wajib
Median (50th percentile) latency in milliseconds. Null when no qualifying event contributed a measurement.
data.latency.processing.p95_ms
nullable integer
wajib
95th percentile latency in milliseconds. Null when no qualifying event contributed a measurement.
data.latency.processing.p99_ms
nullable integer
wajib
99th percentile latency in milliseconds. Null when no qualifying event contributed a measurement.
data.latency.delivery
object
Approximate p50, p95, and p99 latency percentiles in milliseconds for one latency family. All three are null when no qualifying event contributed a measurement.
Tampilkan atribut turunan
data.latency.delivery.p50_ms
nullable integer
wajib
Median (50th percentile) latency in milliseconds. Null when no qualifying event contributed a measurement.
data.latency.delivery.p95_ms
nullable integer
wajib
95th percentile latency in milliseconds. Null when no qualifying event contributed a measurement.
data.latency.delivery.p99_ms
nullable integer
wajib
99th percentile latency in milliseconds. Null when no qualifying event contributed a measurement.
data.latency.total
object
Approximate p50, p95, and p99 latency percentiles in milliseconds for one latency family. All three are null when no qualifying event contributed a measurement.
Tampilkan atribut turunan
data.latency.total.p50_ms
nullable integer
wajib
Median (50th percentile) latency in milliseconds. Null when no qualifying event contributed a measurement.
data.latency.total.p95_ms
nullable integer
wajib
95th percentile latency in milliseconds. Null when no qualifying event contributed a measurement.
data.latency.total.p99_ms
nullable integer
wajib
99th percentile latency in milliseconds. Null when no qualifying event contributed a measurement.
total
integer
wajib
Total distinct templates with activity in the period, regardless of limit.
Sumber daya terkait
Lanjutkan dengan dokumentasi, panduan, dan contoh untuk topik ini. Sumber daya tersedia dalam bahasa Inggris.
Pahami konsepnyaShould I use a Bird SDK or call the API directly?Ikuti jalur pembelajaranBuild your first integrationPanduan implementasiSend your first email
Dapatkan ringkasan implementasi