Sign inGet Started

bird email stats query

Usage

Code example
bird email stats query [flags]

Description

Get selected email metrics
Select email metrics over a date or instant window, optionally grouped by one dimension with complete time series per group. Events are selected and bucketed by when they occurred, including activity on messages sent earlier. Filters match recorded event context. Unsupported combinations and unavailable history return 422. Follow cursors by replaying the original body and changing its cursor fields; the response period has an exclusive end and must not replace the request end. Use a new idempotency key for each continuation page; reuse a key only to retry the same page.
Build the request from flags, a JSON EmailStatsQueryRequest body via --body-file ("-" reads stdin), or both — a flag overrides the matching body field. Run --example to print a ready-to-edit body, or --dry-run to print the resolved request without sending it.
Returns a paginated JSON envelope; narrow with the filters below and page with --limit and --starting-after.

Examples

Code example
# print the body shape (no credentials needed)
bird email stats query --example

# the body it prints:
Code example
{
  "filters": {
    "tag": {
      "name": "campaign"
    }
  },
  "from": "2026-08-03",
  "grain": "quarter_hour",
  "group_by": "sending_domain",
  "metrics": ["sends_accepted"],
  "order": "asc",
  "sort": "sends_accepted",
  "timezone": "Europe/Amsterdam",
  "to": "2026-08-16"
}

Options

Filters

NameDescription
--fromInclusive start, as a calendar date or RFC 3339 instant. Use the same form for from and to. Instants round down to a local quarter-hour; use Z when timezone is supplied. (required; or in --body-file)
--toInclusive end. Dates include the whole local day; instants round down to a local quarter-hour and include that quarter-hour. Dates allow up to 365 local days; instants allow up to 720 hours, subject to available history. Preserve this original bound when following cursors. (required; or in --body-file)
--timezoneIANA timezone for dates and bucket boundaries. Defaults to UTC.
--metrics <v1,v2,…>Distinct metrics to return. Unselected metrics are absent. Possible values: sends_accepted, accepted, processed, delivered, bounced, hard_bounced, soft_bounced, admin_bounced, block_bounced, undetermined_bounced, complained, deferred, rejected, oob_bounces, opens, opens_non_prefetched, clicks, unsubscribes, unique_opens, unique_opens_non_prefetched, unique_clicks, confirmed_unique_opens, confirmed_unique_opens_non_prefetched, effective_delivered, all_bounces, delivery_rate, bounce_rate, complaint_rate, deferral_rate, open_rate, click_rate, unsubscribe_rate, oob_rate, processing_p50_ms, processing_p95_ms, processing_p99_ms, total_p50_ms, total_p95_ms, total_p99_ms. (required; or in --body-file)
--group-byGroup by this dimension. Omit for a single ungrouped summary with optional series. Possible values: sending_domain, category, template_id, tag, recipient_domain, mailbox_provider, mailbox_provider_region, sending_ip, ip_pool_id, broadcast_id, country, region, city, agent_family, os_family, device_family, smtp_error_code, feedback_type.
--grainTime buckets in the requested timezone. Weeks start on Monday; months start on the first day. Half days start at midnight and noon. Edge buckets count events inside the normalized period. Possible values: quarter_hour, hour, half_day, day, week, month.
--response-schemaPrint the fields this command returns, then exit

Pagination

NameDescription
--sortGrouped requests only. Rank groups by this selected metric; defaults to the first metrics entry. Undefined values sort last in either direction. Ties use the dimension value ascending, with null last. Possible values: sends_accepted, accepted, processed, delivered, bounced, hard_bounced, soft_bounced, admin_bounced, block_bounced, undetermined_bounced, complained, deferred, rejected, oob_bounces, opens, opens_non_prefetched, clicks, unsubscribes, unique_opens, unique_opens_non_prefetched, unique_clicks, confirmed_unique_opens, confirmed_unique_opens_non_prefetched, effective_delivered, all_bounces, delivery_rate, bounce_rate, complaint_rate, deferral_rate, open_rate, click_rate, unsubscribe_rate, oob_rate, processing_p50_ms, processing_p95_ms, processing_p99_ms, total_p50_ms, total_p95_ms, total_p99_ms.
--orderGrouped requests only. Defaults to desc. Possible values: asc, desc.
--limit <n>Grouped requests only. Maximum groups per page; defaults to 25. Each group retains its complete series.
--starting-afterGrouped requests only. Opaque next_cursor from the previous response. Mutually exclusive with ending_before.
--ending-beforeGrouped requests only. Opaque prev_cursor for backward navigation, or refresh_cursor to read groups before the anchor in the current sort order. Mutually exclusive with starting_after.

Request

NameDescription
--body-fileRead the JSON request body from this file; "-" reads stdin
--examplePrint a complete example request body, then exit
--dry-runPrint the resolved request without sending it, then exit
--idempotency-keyDeduplication key; a retry with the same key won't act twice
NameDescription
bird email stats by-bounce-codeGet bounces by SMTP error code
bird email stats by-broadcastGet statistics by broadcast
bird email stats by-categoryGet statistics by category
bird email stats by-clientGet engagement by email client
bird email stats by-complaint-typeGet complaints by type
bird email stats by-locationGet engagement by location
bird email stats by-mailbox-providerGet statistics by mailbox provider
bird email stats by-mailbox-provider-regionGet statistics by mailbox provider region
bird email stats by-recipient-domainGet statistics by recipient domain
bird email stats by-sending-domainGet statistics by sending domain
bird email stats by-sending-ipGet statistics by sending IP
bird email stats by-tagGet statistics by tag
bird email stats by-templateGet statistics by template
bird email stats dailyGet daily sending statistics
bird email stats hourlyGet hourly sending statistics
bird email stats summaryGet aggregate email statistics