Get outbound SMS statistics by message type
/v1/sms/stats/content-typesconst stats = await bird.sms.stats.byContentType({
from: "2026-05-01",
to: "2026-05-31",
});
for (const row of stats.data ?? []) {
console.log(row.content_type, row.delivery);
}stats = client.sms.stats.by_content_type(from_="2026-05-01", to="2026-05-31")
for row in stats.data or []:
print(row.content_type, row.delivery)stats, err := client.Sms.Stats.ByContentType(context.Background(), bird.SmsStatsByContentTypeParams{
From: time.Now().AddDate(0, -1, 0),
To: time.Now(),
})
if err != nil {
log.Fatal(err)
}
for _, row := range *stats.Data {
fmt.Println(*row.ContentType, *row.Delivery.Accepted)
}$byContentType = $bird->sms->stats->byContentType(['from' => '2026-05-01', 'to' => '2026-05-31']);
foreach ($byContentType->getData() ?? [] as $row) {
echo $row->getContentType(), ' ', $row->getDelivery()?->getAccepted(), PHP_EOL;
}bird sms stats by-content-typecurl -X GET "https://us1.platform.bird.com/v1/sms/stats/content-types" \
-H "Authorization: Bearer $TOKEN" \
--url-query "sort=accepted" \
--url-query "limit=50" \
--url-query "include_trend=false" \
--url-query "trend_grain=daily"{
"period": {
"from": "2026-05-01",
"to": "2026-05-25",
"data_as_of": "2026-05-25T14:03:10Z"
},
"data": [
{
"content_type": "sms",
"delivery": {
"accepted": 14820,
"sent": 14810,
"delivered": 14720,
"undelivered": 60,
"failed": 25,
"rejected": 10,
"expired": 5,
"delivery_rate": 0.9932,
"failure_rate": 0.0061
},
"latency": {
"processing": {
"p50_ms": 420,
"p95_ms": 1820,
"p99_ms": 4920
},
"delivery": {
"p50_ms": 420,
"p95_ms": 1820,
"p99_ms": 4920
},
"total": {
"p50_ms": 420,
"p95_ms": 1820,
"p99_ms": 4920
}
},
"trend": [
{
"bucket": "2026-05-25",
"delivery": {
"accepted": 14820,
"sent": 14810,
"delivered": 14720,
"undelivered": 60,
"failed": 25,
"rejected": 10,
"expired": 5
}
}
]
}
],
"total": 2
}
Returns delivery counts, rates and latency grouped by SMS or MMS over the requested period. Previously recorded statistics remain attributed to SMS. New activity uses the message type, so a late MMS delivery can appear under MMS while its earlier send remains under SMS. A type-filtered delivery rate is null when that type has no accepted messages. Delivery reports belong to the period when the message was accepted, including reports received later.
Query Parameters
content_typestringRestrict statistics to SMS or MMS. Omit to include both. This filter can be combined with an existing dimension filter where the operation supports one. Previously recorded statistics remain attributed to SMS. New activity uses the message type, so a late MMS delivery can appear under MMS while its earlier send remains under SMS.
Possible values: sms, mms
fromstringStart 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.
tostringEnd 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.
timezonestringIANA 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.
sortstringMetric 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
limitintegerMaximum number of message-type rows to return, ranked by the sort field descending.
include_trendbooleanWhen 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_grainstringBucket grain for the trend series. Has no effect unless include_trend=true.
Possible values: daily, hourly
Response Payload
periodThe date range the response covers (echoed back from the request), plus data_as_of, the freshness boundary the data is current to.
dataMessage-type breakdown rows, ranked by the sort metric (default accepted) descending. Empty when no messages were sent in the period.
Show child attributes
data.content_typeMessage type used for reporting. Previously recorded statistics remain attributed to SMS. New activity uses the message type.
Possible values: sms, mms
data.deliverySMS lifecycle counts and rates for a whole period or breakdown. Counts use the message send time, so a later delivery stays attributed to the bucket in which the message was sent. Rates are null when their denominator is zero.
Show child attributes
data.delivery.acceptedDistinct messages accepted for sending after admission checks. This is the denominator for delivery_rate and failure_rate.
data.delivery.sentDistinct messages handed off to the carrier for delivery.
data.delivery.deliveredDistinct messages the carrier confirmed as delivered to the handset.
data.delivery.undeliveredDistinct messages the carrier reported as not delivered.
data.delivery.failedDistinct messages that failed during sending.
data.delivery.rejectedDistinct messages rejected before any send attempt, for example by sending policy or a message-generation failure.
data.delivery.expiredDistinct messages that could not be delivered within their validity window and expired.
data.delivery.delivery_rateShare of accepted messages that were delivered, computed as delivered / accepted. Null when no messages were accepted in scope.
data.delivery.failure_rateShare of accepted messages that ultimately failed, computed as (undelivered + failed + expired) / accepted. Null when no messages were accepted in scope.
data.latencyLatency percentiles in milliseconds for the requested scope:
processing: From acceptance to carrier handoff.delivery: From carrier handoff to delivery confirmation.total: From acceptance to delivery confirmation.
Each family is omitted when no qualifying event contributes a measurement. Individual percentiles can also be null.
data.trendPer-bucket lifecycle counts for this message type, using trend_grain. Includes only buckets with activity. Present when include_trend=true.
totalTotal number of distinct message types 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.
Related resources
Continue with the documentation, guides and examples for this topic.