Sign inGet Started

Get daily outbound SMS statistics

GET
/v1/sms/stats/daily
const stats = await bird.sms.stats.daily({ from: "2026-05-01", to: "2026-05-31" });
for (const point of stats.data ?? []) {
  console.log(point.bucket, point.delivery);
}
Réponse200
{
  "period": {
    "from": "2026-05-01",
    "to": "2026-05-31",
    "grain": "day",
    "data_as_of": "2026-05-25T14:03:10Z"
  },
  "data": [
    {
      "bucket": "2026-05-25",
      "delivery": {
        "accepted": 14820,
        "sent": 14810,
        "delivered": 14720,
        "undelivered": 60,
        "failed": 25,
        "rejected": 10,
        "expired": 5
      }
    }
  ]
}

Returns one row of SMS lifecycle counts per calendar day. Rows use send-time attribution, so a delivery confirmation is counted on the day when its message was accepted. Recent rows can under-report delivered while delivery reports arrive. Days without activity contain zero counts.

Rates and latency are whole-window aggregates available from the summary endpoint. Use the message detail endpoints for individual message status.

A request may span up to 365 days; a longer window returns 422. Set timezone for local calendar days instead of UTC.

Paramètres de requête

fromstring

Start date (inclusive), 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.

tostring

End date (inclusive), 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.

timezonestring

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.

originatorstring

Restrict the statistics to a single originator (the sender address messages were sent from). Mutually exclusive with the other dimension filters (country, category, carrier); only one may be set per request. Matches the message from.

countrystring

Restrict the statistics to a single destination country, as an ISO 3166-1 alpha-2 code. Mutually exclusive with the other dimension filters (originator, category, carrier); only one may be set per request.

categorystring

Restrict the statistics to a single category. Mutually exclusive with the other dimension filters (originator, country, carrier); only one may be set per request.

carrierstring

Restrict the statistics to a single delivery carrier. Mutually exclusive with the other dimension filters (originator, country, category); only one may be set per request.

Contenu de la réponse

period
object
obligatoire

The window and bucket grain the response covers, echoed from the request, plus the freshness boundary the data is current to.

Afficher les attributs enfants
data
array of object
obligatoire

One row per day or hour in chronological order. Buckets with no activity contain zero counts.

Afficher les attributs enfants

Poursuivez avec la documentation, les guides et les exemples sur ce sujet.