Sign inGet Started

bird email stats query

Usage

Przykład kodu
bird email stats query [flags]

Description

Query email delivery and engagement metrics

Query email analytics and stats for marketing and transactional delivery, bounces, opens, clicks, engagement rates, and latency percentiles. Use for comparisons, combined filters, ranked groups by template, campaign tag, recipient domain, or mailbox provider, and complete time series. If the tag name and requested values are supplied, call this tool directly with filters.tag; no tag lookup is needed. Use bird email stats by-tag only to discover unknown tags. Select grain=quarter_hour for 15-minute activity; omit group_by for a summary. Check group_by and filter compatibility before calling. Country, region, city, and device/client dimensions support engagement counts only: do not request delivered or open_rate for them. Explain an unsupported combination before offering a different report. Every selected metric must support every grouping and filter dimension. Campaigns may use tags or broadcasts; templates can span campaigns. Establish activity from period-scoped stats, not resource creation dates. Use category for recorded marketing/transactional classification and resolve template names to IDs. Event-time windows include engagement on earlier sends; they cannot select a send-date cohort or establish send batches. Compare periods independently with the same filters and metrics. Use bird email stats summary for a supported single-filter aggregate with built-in comparison. Use returned period metrics; distinct counts need not add up across buckets or groups. Read metric descriptions for rate denominators and eligible latency samples. Engagement cannot establish a human count; latency percentiles cannot establish maxima or exact threshold counts. Delivery describes mail-server acceptance. Inbox placement, reading time, revenue, and conversion attribution require other evidence; this limitation concerns email stats, not the whole platform. Unsupported combinations and unavailable history return 422; explain a limitation before changing the population or period. 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.

Procedure

Step 2 of 2 of "Analyze email performance". Previous: bird email stats by-tag.

Examples

Przykład kodu
# print the body shape (no credentials needed)
bird email stats query --example

# the body it prints:
Przykład kodu
{
  "from": "2026-09-23",
  "grain": "week",
  "group_by": "recipient_domain",
  "limit": 25,
  "metrics": ["delivered", "bounce_rate"],
  "to": "2026-09-24"
}

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. delivered and unique engagement counts estimate distinct message recipients. opens, opens_non_prefetched, clicks, unsubscribes, and oob_bounces estimate deduplicated events. effective_delivered and all_bounces are derived counts. Counts need not add up across buckets or groups. unique_opens and unique_clicks count message recipients, not distinct people across messages. Use returned period metrics; do not reconstruct totals from buckets or average rates or percentiles. delivered counts message recipients with a delivery event without subtracting later bounces. effective_delivered is max(delivered - oob_bounces, 0). open_rate uses unique_opens_non_prefetched divided by effective_delivered; click_rate uses unique_clicks divided by effective_delivered. bounce_rate uses min(bounced + oob_bounces, delivered + bounced) divided by (delivered + bounced). complaint_rate and unsubscribe_rate use complained and unsubscribes, respectively, divided by effective_delivered. Undefined rates are null. Engagement rates can exceed 1 across event-time windows. An unknown prefetch flag is treated as false. confirmed_unique_opens is the union of message recipients with opens or clicks; confirmed_unique_opens_non_prefetched excludes prefetched opens from that union. Differences between estimated distinct counts cannot establish exact audience overlaps or explain missing opens. Neither confirmation nor prefetch exclusion establishes a count or range of real people who engaged. Latency percentiles describe eligible measured logical events, excluding missing latency values and including zero. A percentile is null when no eligible samples exist. delivered is not the latency sample count. Report percentile values without inferring the unmeasured population or the distribution between them. They do not establish maxima or exact threshold counts; multiplying delivered by percentile fractions or subtracting processing and delivery percentiles cannot determine slow-message counts or a stage's latency. 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 one recorded event dimension. Omit for a single ungrouped summary with optional series. Grouping by tag requires filters.tag.name. Missing values form a null group when the metric supports that dimension. A null value means the event lacks that attribution; it does not explain how the message was created or establish membership in another dimension such as a campaign. Every selected metric must support the grouping dimension and every filter dimension. Unsupported combinations return validation error E04074, even when the workspace has no events. - sending_domain, category, template_id, tag: all metrics. - recipient_domain, ip_pool_id, broadcast_id: all metrics except sends_accepted. - mailbox_provider, mailbox_provider_region: all metrics except sends_accepted, accepted, and rejected. - sending_ip: delivered, bounced, hard_bounced, soft_bounced, admin_bounced, block_bounced, undetermined_bounced, deferred, oob_bounces, effective_delivered, all_bounces, delivery_rate, bounce_rate, deferral_rate, oob_rate, total_p50_ms, total_p95_ms, and total_p99_ms. - country, region, city, agent_family, os_family, device_family: opens, opens_non_prefetched, clicks, unique_opens, unique_opens_non_prefetched, unique_clicks, confirmed_unique_opens, and confirmed_unique_opens_non_prefetched. - smtp_error_code: bounced, hard_bounced, soft_bounced, admin_bounced, block_bounced, and undetermined_bounced. - feedback_type: complained. 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

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