Sign inGet Started

Get hourly Apple Messages for Business conversation statistics

GET
/v1/amb/stats/conversations/hourly
const result = await bird.amb.stats.conversations.hourly();
console.log(result);
Réponse200
{
  "period": {
    "from": "2026-05-01",
    "to": "2026-05-25",
    "grain": "day",
    "data_as_of": "2026-05-25T14:03:10Z"
  },
  "attribution": "accepted_time",
  "data": [
    {
      "bucket": "2026-05-25",
      "counts": {
        "started": 210,
        "reopened": 34,
        "closed": 198,
        "conversations": 205
      }
    }
  ]
}

Returns one row of Apple Messages for Business conversation lifecycle counts (started, reopened, closed, conversations) per hour, gap-filled so a silent hour is a zero row rather than a missing one. Every row is attributed to the hour 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 within a row, and any one of them can exceed it. Use it where the daily grain hides the shape; a window spans at most 720 hours (30 days), and for anything longer use the daily endpoint.

from and to are optional RFC 3339 instants, defaulting to the trailing 168 hours; each bound rounds down to the hour and remains inclusive. A request may span up to 30 days (720 rows). An excessive or reversed window returns 422. Set timezone for local hours instead of UTC, including zones with sub-hour offsets; when the timezone's offset is not a whole number of hours, rows are read from finer-grained internal rollups and combined into hour boundaries automatically, with no parameter to select this. Historical dates are supported within the maximum window length; the requested dates are not shifted forward.

Paramètres de requête

fromstring

Start of the window (RFC 3339 instant), rounded down to the start of its hour and included. The boundary uses the local hour when timezone is set and the UTC hour otherwise. The window may not exceed 30 days (720 hours). Defaults to 168 hours (7 days) before to when omitted.

tostring

End of the window (RFC 3339 instant), rounded down to the start of its hour and included. The boundary uses the local hour when timezone is set and the UTC hour otherwise, so both bounds are inclusive. The window may not exceed 30 days (720 hours). Defaults to the current hour 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.

Contenu de la réponse

period
object
obligatoire

The window and bucket grain the response covers, echoed from the request, plus 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

data
array of object
obligatoire

One row per day or hour in chronological order. Buckets with no activity contain zero counts.

Afficher les attributs enfants
data.bucket
string
obligatoire

The day (YYYY-MM-DD) or hour (RFC 3339, on the hour) this point covers, matching the period's grain.

data.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

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