Sign inGet Started

Get aggregate Apple Messages for Business conversation statistics

GET
/v1/amb/stats/conversations/summary
const result = await bird.amb.stats.conversations.summary();
console.log(result);
Réponse200
{
  "period": {
    "from": "2026-05-01",
    "to": "2026-05-25",
    "data_as_of": "2026-05-25T14:03:10Z"
  },
  "attribution": "accepted_time",
  "counts": {
    "started": 210,
    "reopened": 34,
    "closed": 198,
    "conversations": 205
  },
  "comparison": {
    "period": {
      "from": "2026-05-01",
      "to": "2026-05-25",
      "data_as_of": "2026-05-25T14:03:10Z"
    },
    "counts": {
      "started": 210,
      "reopened": 34,
      "closed": 198,
      "conversations": 205
    },
    "delta": {
      "started_pct_change": 0.22,
      "reopened_pct_change": -0.05,
      "closed_pct_change": 0.19,
      "conversations_pct_change": 0.21
    }
  }
}

Returns one aggregate row of Apple Messages for Business conversation lifecycle counts (started, reopened, closed, conversations) for the requested period. Rows are attributed to when the lifecycle event occurred, not to any earlier outbound message. A conversation can be reopened and closed more than once, so started, reopened, and closed need not sum to conversations, and any one of them can exceed it. period.data_as_of is the freshness boundary the rollups have reached.

from and to must both be calendar days or RFC 3339 instants. Day windows cover up to 365 whole days. Instant bounds round down to the hour, remain inclusive, and may span up to 720 hours. Mixing the forms returns 422. Set timezone for local boundaries. Historical dates are supported within the maximum window length; the requested dates are not shifted forward.

Use compare=previous_period to include the preceding equal-length window and the change between the two.

Paramètres de requête

fromstring

Inclusive start of the window: a calendar day (YYYY-MM-DD) or an RFC 3339 instant rounded down to the hour. The timezone parameter makes a calendar day local and rounds an instant down to the local hour. Omit timezone to use UTC. When timezone is set, a numeric UTC offset such as +05:45 is rejected; use a calendar day or a Z (UTC) instant. This value must use the same form as to. When omitted, it defaults to 30 days before to for day windows or 168 hours (7 days) before to for hour windows.

tostring

Inclusive end of the window: a calendar day (YYYY-MM-DD) or an RFC 3339 instant rounded down to the hour. The timezone parameter makes a calendar day local and rounds an instant down to the local hour. Omit timezone to use UTC. When timezone is set, a numeric UTC offset is rejected; use a calendar day or a Z (UTC) instant. This value must use the same form as from. When omitted, it defaults to today for day windows or the current hour for hour windows in that timezone. Day windows may not exceed 365 days; hour windows may not exceed 720 hours (30 days).

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.

comparestring

Set to previous_period to also include the same statistics for the immediately preceding window of equal length, plus the change between the two, so you can show "+X% vs last period" without a second request.

Possible values: previous_period

Contenu de la réponse

period
object
obligatoire

The window the response covers (echoed back from the request), plus data_as_of, the freshness boundary the data is current to.

Afficher les attributs enfants
attribution
string
obligatoire

Always event_time for conversation statistics.

Possible values: accepted_time, event_time

counts
object
obligatoire

Conversation lifecycle counts for the requested scope, attributed to when each event occurred. A conversation can start, reopen, and close more than once over its life, so started, reopened, and closed can each exceed conversations, the number of distinct conversations touched in scope. Very large counts are close estimates rather than exact tallies.

Afficher les attributs enfants
comparison
object

The same statistics for the equal-length, inclusive period ending immediately before the requested start, together with the change between the two periods. Present only when compare=previous_period is requested. The change is already computed, so a percentage difference needs no second request.

Afficher les attributs enfants
comparison.period
object
obligatoire

The preceding window these comparison figures cover, the equal-length window ending immediately before the requested start (the prior day for day windows, the prior hour for hour windows).

Afficher les attributs enfants
comparison.counts
object
obligatoire

Conversation lifecycle counts for the requested scope, attributed to when each event occurred. A conversation can start, reopen, and close more than once over its life, so started, reopened, and closed can each exceed conversations, the number of distinct conversations touched in scope. Very large counts are close estimates rather than exact tallies.

Afficher les attributs enfants
comparison.delta
object
obligatoire

Changes from the previous period. Each value is the signed relative change (current - previous) / previous and is null when the previous count is zero.

Afficher les attributs enfants

Poursuivez avec la documentation, les guides et les exemples sur ce sujet.