Sign inGet Started

Get outbound Apple Messages for Business statistics by group

GET
/v1/amb/stats/groups
const result = await bird.amb.stats.byGroup({ limit: 2 });
console.log(result);
响应200
{
  "period": {
    "from": "2026-05-01",
    "to": "2026-05-25",
    "data_as_of": "2026-05-25T14:03:10Z"
  },
  "attribution": "accepted_time",
  "data": [
    {
      "group": "sales",
      "counts": {
        "accepted": 4820,
        "sent": 4790,
        "send_failed": 30,
        "rejected": 4,
        "sent_rate": 0.9938,
        "send_failure_rate": 0.0062
      },
      "latency": {
        "processing": {
          "p50_ms": 610,
          "p95_ms": 2140,
          "p99_ms": 5380
        }
      },
      "first_response": {
        "p50_ms": 610,
        "p95_ms": 2140,
        "p99_ms": 5380
      }
    }
  ],
  "total": 3
}

Returns outbound counts and latency percentiles grouped by entry-point group, for the requested period. Rows are ranked by accepted volume descending and capped at the requested limit (default 50, max 200). Groups are workspace-defined strings configured on the business's entry points and have no fixed vocabulary. Rows use accepted-time attribution: a send failure recorded during the period for a message accepted earlier counts against the earlier period. Each row also carries first_response latency percentiles, omitted when no qualifying message contributes a measurement. There is no delivery receipt on this channel, so there is no delivered count anywhere in the row. The maximum window is 365 days; a longer range returns 422. Historical dates are supported within the maximum window length; the requested dates are not shifted forward. A breakdown is already a single-dimension view and takes no dimension filter; to restrict statistics to a single group, use the summary, daily, or hourly statistics instead.

查询参数

fromstring

Inclusive start of the window, a calendar day (YYYY-MM-DD). Interpreted in timezone, or UTC when omitted. Must not be after to. Max window 365 days. Defaults to 30 days before to when omitted.

tostring

Inclusive end of the window, a calendar day (YYYY-MM-DD). Interpreted in timezone, or UTC when omitted. Max window 365 days. Defaults to today in that timezone when omitted.

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.

limitinteger

Maximum number of group rows to return, ranked by accepted volume descending.

响应载荷

period
object
必填

The window the response covers (echoed back), plus data_as_of.

显示子属性
attribution
string
必填

Always accepted_time for outbound statistics.

Possible values: accepted_time, event_time

data
array of object
必填

Group rows ranked by accepted volume descending.

显示子属性
total
integer
必填

Total distinct groups with activity in the period, regardless of limit.