Query email analytics for marketing and transactional delivery, bounces, opens, clicks, engagement rates, and latency percentiles: comparisons, combined filters, groups ranked by template, campaign tag, recipient domain, or mailbox provider, and complete time series. With a known tag name, filter on filters.tag directly; use `email_stats_by_tag` only to discover unknown tags. Select grain=quarter_hour for 15-minute activity; omit group_by for a summary. Use `email_stats_summary` for a single-filter aggregate with built-in comparison. Every selected metric must support every grouping and filter dimension: country, region, city, and device/client support engagement counts only, not delivered or open_rate. Unsupported combinations and unavailable history return 422; explain the limitation before changing the population or period. Events are selected by when they occurred, so a window includes engagement on earlier sends and cannot select a send-date cohort. Compare periods independently with the same filters and metrics. Distinct counts need not add up across buckets or groups, and engagement cannot establish a human count. Delivery describes mail-server acceptance, not inbox placement. Follow cursors by replaying the original body with new cursor fields and a new idempotency key per page; the response period has an exclusive end and must not replace the request end.
Parameters
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.
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.
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.
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.
Filter recorded event context with include/exclude predicates. Include values combine with OR; dimensions combine with AND. Exclude-only predicates retain missing values. Tag filters require one case-sensitive name; a name without values requires presence. Each predicate accepts at most 20 distinct values across include and exclude. Every selected metric must support every filter dimension, using the same compatibility rules as group_by. Resolve template and IP-pool names to IDs before filtering. Broadcast filters use IDs. Current names do not establish historical attribution.
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.
Group 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.
Client-supplied key. On operations supporting response replay, reuse it with an identical request to recover a retained response. Operations with a separate replay contract use that contract instead.
Grouped requests only. Maximum groups per page; defaults to 25. Each group retains its complete series.
Grouped requests only. Defaults to desc.
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.
Grouped requests only. Opaque next_cursor from the previous response. Mutually exclusive with ending_before.
IANA timezone for dates and bucket boundaries. Defaults to UTC.