SMS stats by category
GET
/v1/sms/stats/categories
const stats = await bird.sms.stats.byCategory({ from: "2026-05-01", to: "2026-05-31" });
for (const row of stats.data ?? []) {
console.log(row.category, row.delivery);
}stats = client.sms.stats.by_category(from_="2026-05-01", to="2026-05-31")
for row in stats.data or []:
print(row.category, row.delivery)stats, err := client.Sms.Stats.ByCategory(context.Background(), bird.SmsStatsByCategoryParams{
From: time.Now().AddDate(0, -1, 0),
To: time.Now(),
})
if err != nil {
log.Fatal(err)
}
for _, row := range *stats.Data {
fmt.Println(*row.Category, *row.Delivery.Accepted)
}$byCategory = $bird->sms->stats->byCategory(['from' => '2026-05-01', 'to' => '2026-05-31']);
foreach ($byCategory->getData() ?? [] as $row) {
echo $row->getCategory(), ' ', $row->getDelivery()?->getAccepted(), PHP_EOL;
}bird sms stats by-categorycurl -X GET "https://us1.platform.bird.com/v1/sms/stats/categories" \
-H "Authorization: Bearer $TOKEN" \
--url-query "sort=accepted" \
--url-query "limit=50" \
--url-query "include_trend=false" \
--url-query "trend_grain=daily"Returns aggregate delivery and latency stats grouped by message category for the requested period. Rows are ranked by the sort metric (default accepted) descending and capped at the requested limit (default 50, hard maximum 200). Use this to compare sending performance across the categories you send under.
Rows are attributed to send time, not event time: a delivery confirmed during the period for a message accepted earlier counts against the earlier period, not this one. A recent period therefore under-reports delivered while its delivery reports are still arriving, and its counts only ever grow toward the truth.
The maximum window is 365 days; requesting a longer range returns 422.
Query Parameters
from
string
Start date (inclusive) in YYYY-MM-DD, interpreted as a calendar day in timezone (a UTC day when timezone is omitted). Defaults to 30 days before to when omitted; with include_trend=true and trend_grain=hourly the default tightens to keep the window within the 720-hour trend cap.
to
string
End date (inclusive) in YYYY-MM-DD, interpreted as a calendar day in timezone (a UTC day when timezone is omitted). Defaults to today in that timezone when omitted. Window may not exceed 365 days.
timezone
string
IANA timezone identifier (for example Asia/Kathmandu) to report in; defaults to UTC. Day and hour boundaries and the default window when from and to are omitted both follow it, so a calendar-day from or to names a local day. A from or to carrying its own UTC offset is rejected while this is set: pass a calendar day or a Z instant.
sort
string
Metric to rank rows by, applied descending. Any lifecycle count or derived rate in the response may be used; rows whose rate is undefined (zero denominator) sort last. Defaults to accepted.
Possible values: accepted, sent, delivered, undelivered, failed, rejected, expired, delivery_rate, failure_rate
limit
integer
Maximum number of category rows to return, ranked by the sort field descending.
include_trend
boolean
When true, each row also carries a trend array: a short per-bucket lifecycle-count series for that row over the window. Returned only when limit is 50 or fewer and the window is at most 90 days (trend_grain=daily) or 720 hours (trend_grain=hourly); a larger request returns 422.
trend_grain
string
Bucket grain for the trend series. Has no effect unless include_trend=true.
Possible values: daily, hourly
Response Payload
period
object
required
The date range the response covers (echoed back from the request), plus data_as_of, the freshness boundary the data is current to.
Show child attributes
period.from
string
required
Inclusive start of the window the response covers -- a calendar day (YYYY-MM-DD) for day windows, or an hour boundary (RFC 3339) for hour windows.
period.to
string
required
Inclusive end of the window the response covers -- a calendar day (YYYY-MM-DD) for day windows, or an hour boundary (RFC 3339) for hour windows.
period.data_as_of
nullable string
The instant the statistics in this response are current to: events recorded up to roughly this time are reflected, while more recent events may not be yet. Statistics are served from a rolling aggregation that refreshes every few seconds, so a response is near-real-time but not live; use this field to label data freshness (for example "as of 14:03") rather than assuming the numbers are to-the-second. Null when the freshness boundary is not being reported.
data
array of object
required
Category breakdown rows, ranked by the sort metric (default accepted) descending. Empty when no messages were sent in the period.
Show child attributes
data.category
string
required
The category this row aggregates, as set at send time. transactional is one-to-one messaging triggered by a user action; marketing is bulk sending. New categories may be added over time.
data.delivery
object
required
Show child attributes
data.delivery.accepted
integer
required
Distinct messages accepted for sending after admission checks. This is the denominator for delivery_rate and failure_rate.
data.delivery.sent
integer
required
Distinct messages handed off to the carrier for delivery.
data.delivery.delivered
integer
required
Distinct messages the carrier confirmed as delivered to the handset.
data.delivery.undelivered
integer
required
Distinct messages the carrier reported as not delivered.
data.delivery.failed
integer
required
Distinct messages that failed during sending.
data.delivery.rejected
integer
required
Distinct messages rejected before any send attempt, for example by sending policy or a message-generation failure.
data.delivery.expired
integer
required
Distinct messages that could not be delivered within their validity window and expired.
data.delivery.delivery_rate
nullable number
required
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
required
Share of accepted messages that ultimately failed, computed as (undelivered + failed + expired) / accepted. Null when no messages were accepted in scope.
data.latency
object
required
Show child attributes
data.latency.processing
object
p50, p95, and p99 latency percentiles in milliseconds for one latency family over the scope. Percentiles are approximate (computed from a high-volume aggregation pipeline). All three are null together when no qualifying event contributed a latency measurement in scope.
Show child attributes
data.latency.processing.p50_ms
nullable integer
required
Median (50th percentile) latency in milliseconds. Null when no qualifying event contributed a measurement.
data.latency.processing.p95_ms
nullable integer
required
95th percentile latency in milliseconds. Null when no qualifying event contributed a measurement.
data.latency.processing.p99_ms
nullable integer
required
99th percentile latency in milliseconds. Null when no qualifying event contributed a measurement.
data.latency.delivery
object
p50, p95, and p99 latency percentiles in milliseconds for one latency family over the scope. Percentiles are approximate (computed from a high-volume aggregation pipeline). All three are null together when no qualifying event contributed a latency measurement in scope.
Show child attributes
data.latency.delivery.p50_ms
nullable integer
required
Median (50th percentile) latency in milliseconds. Null when no qualifying event contributed a measurement.
data.latency.delivery.p95_ms
nullable integer
required
95th percentile latency in milliseconds. Null when no qualifying event contributed a measurement.
data.latency.delivery.p99_ms
nullable integer
required
99th percentile latency in milliseconds. Null when no qualifying event contributed a measurement.
data.latency.total
object
p50, p95, and p99 latency percentiles in milliseconds for one latency family over the scope. Percentiles are approximate (computed from a high-volume aggregation pipeline). All three are null together when no qualifying event contributed a latency measurement in scope.
Show child attributes
data.latency.total.p50_ms
nullable integer
required
Median (50th percentile) latency in milliseconds. Null when no qualifying event contributed a measurement.
data.latency.total.p95_ms
nullable integer
required
95th percentile latency in milliseconds. Null when no qualifying event contributed a measurement.
data.latency.total.p99_ms
nullable integer
required
99th percentile latency in milliseconds. Null when no qualifying event contributed a measurement.
data.trend
array of object
Per-bucket lifecycle-count series for this category over the window, bucketed by trend_grain. Sparse -- only buckets with activity are present, not zero-filled, unlike the daily/hourly series. Present only when include_trend=true.
Show child attributes
data.trend.bucket
string
required
The day (YYYY-MM-DD) or hour (RFC 3339, on the hour) this point covers, matching the period's grain.
data.trend.delivery
object
required
Show child attributes
data.trend.delivery.accepted
integer
required
Distinct messages accepted for sending after admission checks.
data.trend.delivery.sent
integer
required
Distinct messages handed off to the carrier for delivery.
data.trend.delivery.delivered
integer
required
Distinct messages the carrier confirmed as delivered to the handset.
data.trend.delivery.undelivered
integer
required
Distinct messages the carrier reported as not delivered.
data.trend.delivery.failed
integer
required
Distinct messages that failed during sending.
data.trend.delivery.rejected
integer
required
Distinct messages rejected before any send attempt, for example by sending policy or a message-generation failure.
data.trend.delivery.expired
integer
required
Distinct messages that could not be delivered within their validity window and expired.
total
integer
required
Total number of distinct categories with activity in the period, regardless of limit. When it exceeds the number of rows returned, the ranking was capped; raise limit (up to 200) or narrow the window to see more.