Sign inGet Started

Get aggregate email statistics

GET
/v1/email/stats/summary
const s = await bird.email.stats.summary({ from: "2026-05-01", to: "2026-05-31" });
console.log(s.sends_accepted, s.delivery.delivered);
Odpowiedź200
{
  "period": {
    "from": "2026-05-01",
    "to": "2026-05-25",
    "data_as_of": "2026-05-25T14:03:10Z"
  },
  "sends_accepted": 12410,
  "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
    }
  },
  "comparison": {
    "period": {
      "from": "2026-05-01",
      "to": "2026-05-25",
      "data_as_of": "2026-05-25T14:03:10Z"
    },
    "sends_accepted": 8230,
    "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
      }
    },
    "delta": {
      "sends_accepted_pct_change": 0.508,
      "delivered_pct_change": 0.122,
      "bounced_pct_change": -0.031,
      "complained_pct_change": 0.018,
      "opened_pct_change": -0.046,
      "delivery_rate_pp": 0.004,
      "open_rate_pp": 0.005,
      "click_rate_pp": 0.002,
      "bounce_rate_pp": -0.0008,
      "complaint_rate_pp": 0.0001,
      "unsubscribe_rate_pp": -0.0001
    }
  }
}

Returns a single-row aggregate across the requested period covering delivery, bounce, complaint, open, and click counts plus the derived rates, along with processing, delivery, and total latency percentiles (p50/p95/p99). Suitable for KPI tiles, campaign reports, and email digests; the daily and hourly endpoints have the same metrics per time bucket.

The aggregate is computed against event time (not send time), so engagement received during the period for messages sent earlier is included. Rate fields are null when their denominator is zero.

The window grain follows the form of from and to: calendar days (YYYY-MM-DD, up to 365 days) or RFC 3339 instants (hour grain, up to 720 hours, 30 days). A rolling window such as the last 24 hours is a single request. Mixing the two forms returns 422. Set timezone to compute day and hour boundaries in a local zone instead of UTC, and compare=previous_period to include the preceding equal-length window in the same response.

Parametry zapytania

fromstring

Inclusive start of the window: a calendar day (YYYY-MM-DD) or an RFC 3339 instant (rounded down to the hour). Interpreted in timezone (a calendar day names a local day; an instant is rounded down to the local hour), or in UTC when timezone is omitted. A numeric UTC offset (for example +05:45) 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 for day windows, or 168 hours (7 days) before to for hour windows, when omitted.

tostring

Inclusive end of the window: a calendar day (YYYY-MM-DD) or an RFC 3339 instant (rounded down to the hour). Interpreted in timezone (a calendar day names a local day; an instant is rounded down to the local hour), 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 for day windows, or the current hour for hour windows, in that timezone, when omitted. Day windows may not exceed 365 days; hour windows may not exceed 720 hours (30 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.

categorystring

Restrict the statistics to a category or a comma-separated union of categories: transactional or marketing. Mutually exclusive with the other dimension filters; only one may be set per request.

sending_domainstring

Restrict the statistics to a sending domain or a comma-separated union of sending domains (the part of the From address after @). Mutually exclusive with the other dimension filters; only one may be set per request.

tagstring

Restrict the statistics to a tag. Use name to match any value of a tag, or name:value for a specific pair (for example campaign:spring_launch). To combine values of one tag name, separate complete pairs with commas, such as campaign:spring,campaign:summer. Different tag names cannot be combined. Mutually exclusive with the other dimension filters; only one may be set per request.

sending_ipstring

Restrict the statistics to a sending IP or a comma-separated union of IPs. Mutually exclusive with the other dimension filters; only one may be set per request. A sending IP is assigned only after a message reaches delivery, so this filter reports delivery-side metrics only. Accepted, processed, rejected, complaint, and engagement counts are 0, and processing latency is null. Complaint, open, and click rates are 0 when deliveries exist and null otherwise.

recipient_domainstring

Restrict the statistics to a recipient mailbox domain or a comma-separated union of domains (the part of the recipient address after the @, for example gmail.com). Mutually exclusive with the other dimension filters; only one may be set per request.

templatestring

Restricts the statistics to a template or a comma-separated union of templates, identified by ID (emt_…) or name. This parameter is mutually exclusive with other dimension filters.

comparestring

Set to previous_period to also include the same statistics for the immediately preceding window of equal length, plus the change between the two, so you can show "+X% vs last period" without a second request.

Possible values: previous_period

Treść odpowiedzi

period
object
wymagane

The window the response covers (echoed back from the request, day or hour grain), plus data_as_of, the freshness boundary the data is current to.

Pokaż atrybuty podrzędne
sends_accepted
integer
wymagane

Distinct email messages accepted, counted at the message level (one per accepted send regardless of recipient count) across the whole requested period. This field counts messages. delivery.accepted counts recipients, so the two values are not comparable (a single message to 500 recipients is 1 here and up to 500 there).

delivery
object
wymagane
Pokaż atrybuty podrzędne
delivery.accepted
integer

Distinct recipients accepted for delivery after suppression filtering. Reported on time buckets and the period summary. Breakdown rows leave it out, because their rollups do not have it.

delivery.processed
integer
wymagane

Distinct recipients whose message was processed and handed off for delivery.

delivery.delivered
integer
wymagane

Distinct recipients whose message the receiving mail server accepted.

delivery.bounced
integer
wymagane

Distinct recipients whose delivery failed. This is approximately the sum of the five bounces.* sub-counts (hard, soft, admin, block, undetermined). The two totals are worked out independently, so they can differ slightly.

delivery.bounces
object
wymagane
Pokaż atrybuty podrzędne
delivery.complained
integer
wymagane

Distinct recipients who reported the message as spam via a feedback loop.

delivery.deferred
integer
wymagane

Distinct recipients whose delivery the receiving server temporarily delayed and is still being retried.

delivery.rejected
integer
wymagane

Distinct recipients rejected before any delivery attempt. Includes recipients on the workspace suppression list, transmissions that could not be completed, message-generation failures, and recipients refused by sending policy. The per-recipient rejection_reason field on GET /v1/email/messages/{message_id}/recipients surfaces the specific cause.

delivery.oob_bounces
integer
wymagane

Out-of-band bounce events: distinct failure notifications received after the receiving server had initially confirmed delivery. The count represents deduplicated events rather than unique recipients.

delivery.effective_delivered
integer
wymagane

Recipients who remain delivered after all bounce signals resolve, computed as delivered - oob_bounces. Use this as the base for engagement-rate denominators. Clamped to 0 when oob_bounces exceeds delivered.

delivery.all_bounces
integer
wymagane

Total recipients in this scope who did not receive the message, computed as bounced + oob_bounces.

delivery.oob_rate
nullable number
wymagane

Share of this scope's delivery attempts that resulted in an out-of-band bounce, computed as oob_bounces / (delivered + bounced). Null when there were no attempts.

delivery.delivery_rate
nullable number
wymagane

Share of this scope's delivery attempts that remained delivered after all bounce signals, computed as effective_delivered / (delivered + bounced). Null when there were no attempts.

delivery.bounce_rate
nullable number
wymagane

Share of this scope's delivery attempts that ultimately failed (inband or out-of-band), computed as all_bounces / (delivered + bounced). Because oob_bounces counts events rather than recipients, all_bounces can exceed the attempt count. The rate is clamped to 1. Null when there were no attempts.

delivery.complaint_rate
nullable number
wymagane

Spam complaints in this scope relative to effectively delivered recipients, computed as complained / effective_delivered. Complaints are attributed by event time, so a scope can record more of them than it effectively delivered, pushing the rate above 1. Null when effective_delivered is zero.

engagement
object
wymagane
Pokaż atrybuty podrzędne
latency
object
wymagane
Pokaż atrybuty podrzędne

Przejdź do dokumentacji, przewodników i przykładów dotyczących tego tematu.