Sign inGet Started

Get mailbox email statistics

GET
/v1/email/mailboxes/{mailbox_id}/stats
const stats = await bird.email.mailboxes.stats("mbx_01abc");
console.log(stats.summary?.sends_accepted);
Réponse200
{
  "period": {
    "from": "2026-05-01",
    "to": "2026-05-31",
    "grain": "day",
    "data_as_of": "2026-05-25T14:03:10Z"
  },
  "summary": {
    "sends_accepted": 231,
    "delivery": {
      "accepted": 14820,
      "processed": 14810,
      "delivered": 14720,
      "bounced": 90,
      "bounces": {
        "hard": 12410,
        "soft": 14290,
        "admin": 410,
        "block": 920,
        "undetermined": 80,
        "hard_rate": 0.454,
        "soft_rate": 0.523,
        "admin_rate": 0.015,
        "block_rate": 0.0337,
        "undetermined_rate": 0.0029
      },
      "complained": 3,
      "deferred": 14,
      "rejected": 10,
      "oob_bounces": 2,
      "effective_delivered": 14718,
      "all_bounces": 92,
      "oob_rate": 0.00014,
      "delivery_rate": 0.9939,
      "bounce_rate": 0.0061,
      "complaint_rate": 0.0002
    },
    "engagement": {
      "opens": 5420,
      "opens_non_prefetched": 3210,
      "unique_opens": 3640,
      "unique_opens_non_prefetched": 2480,
      "clicks": 924,
      "unique_clicks": 621,
      "unsubscribes": 12,
      "open_rate": 0.1683,
      "click_rate": 0.0422,
      "unsubscribe_rate": 0.0009
    },
    "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
      }
    },
    "received": 519
  },
  "data": [
    {
      "bucket": "2026-07-21",
      "sends_accepted": 12,
      "delivery": {
        "accepted": 14820,
        "processed": 14810,
        "delivered": 14720,
        "bounced": 90,
        "bounces": {
          "hard": 12410,
          "soft": 14290,
          "admin": 410,
          "block": 920,
          "undetermined": 80,
          "hard_rate": 0.454,
          "soft_rate": 0.523,
          "admin_rate": 0.015,
          "block_rate": 0.0337,
          "undetermined_rate": 0.0029
        },
        "complained": 3,
        "deferred": 14,
        "rejected": 10,
        "oob_bounces": 2,
        "effective_delivered": 14718,
        "all_bounces": 92,
        "oob_rate": 0.00014,
        "delivery_rate": 0.9939,
        "bounce_rate": 0.0061,
        "complaint_rate": 0.0002
      },
      "engagement": {
        "opens": 5420,
        "opens_non_prefetched": 3210,
        "unique_opens": 3640,
        "unique_opens_non_prefetched": 2480,
        "clicks": 924,
        "unique_clicks": 621,
        "unsubscribes": 12,
        "open_rate": 0.1683,
        "click_rate": 0.0422,
        "unsubscribe_rate": 0.0009
      },
      "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
        }
      },
      "received": 34
    }
  ]
}

Returns the mailbox's sent and received email statistics over a time window: a period-wide summary plus a bucketed series. Sent-mail metrics have the same delivery, engagement, and latency breakdowns as the email stats endpoints. received counts mail that arrived at the mailbox.

Rows are bucketed by the time the event happened rather than the time the message was sent, so engagement that arrived during the period for a message sent earlier is counted here. Statistics start when the mailbox starts sending and receiving; the mailbox's all-time message_count and thread_count live on the mailbox resource itself.

from and to accept either calendar days (YYYY-MM-DD, day granularity only) or RFC 3339 instants (hour granularity only). Both bounds must use the same form. Window caps depend on granularity: 365 days at day, 30 days at hour. Set timezone to report in a local zone instead of UTC.

Paramètres

mailbox_idstring

Mailbox identifier. Starts with mbx_.

Paramètres de requête

fromstring

Inclusive start of the window: a calendar day (YYYY-MM-DD, day granularity only) or an RFC 3339 instant rounded down to the hour (hour granularity only). Interpreted in timezone, or in UTC when timezone is omitted. A numeric UTC offset is rejected when timezone is set; use a calendar day or a Z (UTC) instant. Must use the same form as to. Defaults to 30 days before to at day granularity and 7 days before to at hour, when omitted.

tostring

Inclusive end of the window: a calendar day (YYYY-MM-DD, day granularity only) or an RFC 3339 instant rounded down to the hour (hour granularity only). Interpreted in timezone, or in UTC when timezone is omitted. A numeric UTC offset is rejected when timezone is set; use a calendar day or a Z (UTC) instant. Must use the same form as from. Defaults to today (day) or the current hour (hour) in that timezone when omitted. Window may not exceed 365 days at day or 30 days at hour granularity.

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.

granularitystring

Granularity of the series: day (default) or hour. Echoed back as period.grain.

Possible values: day, hour

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
summary
object
obligatoire

Single-row aggregate of the mailbox's email activity across the full requested period. Counts use each field's message, recipient, or event identity across the whole window. Repeat opens, clicks, and unsubscribes from the same recipient contribute as separate events; unique engagement fields count distinct recipients. Adding per-bucket distinct counts can overstate the summary. Latency percentiles are computed across the whole period. Rates are null when their denominator is zero.

Afficher les attributs enfants
data
array of object
obligatoire

One row per bucket in the period, in chronological order. Buckets with no activity are included with zero counts.

Afficher les attributs enfants
data.bucket
string
obligatoire

The day (YYYY-MM-DD) or instant (RFC 3339, on the bucket boundary) this point covers, matching the period's grain.

data.sends_accepted
integer
obligatoire

Distinct email messages the mailbox sent that were accepted in this bucket, counted at the message level (one per accepted send regardless of how many recipients it addresses). Every other sent-mail metric in delivery and engagement is recipient-level or event-level.

data.delivery
object
obligatoire
Afficher les attributs enfants
data.engagement
object
obligatoire
Afficher les attributs enfants
data.latency
object
obligatoire
Afficher les attributs enfants
data.received
integer
obligatoire

Distinct emails the mailbox received in this bucket.