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
| Name | Description |
|---|---|
| --from | Inclusive 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) |
| --to | Inclusive 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) |
| --timezone | IANA 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-by | Group 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. |
| --grain | Time 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-schema | Print the fields this command returns, then exit |
Pagination
| Name | Description |
|---|---|
| --sort | Grouped 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. |
| --order | Grouped 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-after | Grouped requests only. Opaque next_cursor from the previous response. Mutually exclusive with ending_before. |
| --ending-before | Grouped 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
| Name | Description |
|---|---|
| --body-file | Read the JSON request body from this file; "-" reads stdin |
| --example | Print a complete example request body, then exit |
| --dry-run | Print the resolved request without sending it, then exit |
| --idempotency-key | Deduplication key; a retry with the same key won't act twice |
Related
| Name | Description |
|---|---|
| bird email stats by-bounce-code | Get bounces by SMTP error code |
| bird email stats by-broadcast | Get statistics by broadcast |
| bird email stats by-category | Get statistics by category |
| bird email stats by-client | Get engagement by email client |
| bird email stats by-complaint-type | Get complaints by type |
| bird email stats by-location | Get engagement by location |
| bird email stats by-mailbox-provider | Get statistics by mailbox provider |
| bird email stats by-mailbox-provider-region | Get statistics by mailbox provider region |
| bird email stats by-recipient-domain | Get statistics by recipient domain |
| bird email stats by-sending-domain | Get statistics by sending domain |
| bird email stats by-sending-ip | Get statistics by sending IP |
| bird email stats by-tag | Get statistics by tag |
| bird email stats by-template | Get statistics by template |
| bird email stats daily | Get daily sending statistics |
| bird email stats hourly | Get hourly sending statistics |
| bird email stats summary | Get aggregate email statistics |
Related resources
Continue with the documentation, guides and examples for this topic. Resources are in English.
Understand the conceptShould I use a Bird SDK or call the API directly?Follow the learning pathBuild your first integrationImplementation guideSend your first email
Get an implementation brief