# Get hourly outbound WhatsApp statistics

`GET /v1/whatsapp/stats/hourly`

Returns one row of WhatsApp lifecycle counts per hour. Rows use send-time attribution, so a delivery confirmation is counted in the hour when its message was accepted. Recent rows can under-report `delivered` while delivery reports arrive. Set `timezone` for local hours instead of UTC, including zones with sub-hour offsets.

Each row includes its own latency percentiles; delivery, failure, and read rates are whole-window aggregates available from the summary endpoint instead. `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 one dimension filter at most; more than one returns `422`.

## Code samples

### TypeScript

```ts
const stats = await bird.whatsapp.stats.hourly({
  from: "2026-08-30T00:00:00Z",
  to: "2026-08-31T00:00:00Z",
});
for (const point of stats.data ?? []) {
  console.log(point.bucket, point.delivery);
}
```

### Python

```py
stats = client.whatsapp.stats.hourly(from_="2026-08-30T00:00:00Z", to="2026-08-31T00:00:00Z")
for point in stats.data or []:
    print(point.bucket, point.delivery)
```

### Go

```go
series, err := client.Whatsapp.Stats.Hourly(context.Background(), bird.WhatsappStatsHourlyParams{
	From: time.Now().Add(-24 * time.Hour),
	To:   time.Now(),
})
if err != nil {
	log.Fatal(err)
}
for _, point := range *series.Data {
	fmt.Println(*point.Bucket, *point.Delivery.Accepted)
}
```

### PHP

```php
$hourly = $bird->whatsapp->stats->hourly(['from' => '2026-08-30T00:00:00Z', 'to' => '2026-08-31T00:00:00Z']);
foreach ($hourly->getData() ?? [] as $point) {
    echo $point->getBucket(), ' ', $point->getDelivery()?->getAccepted(), PHP_EOL;
}
```

### CLI

```sh
bird whatsapp stats hourly
```

### cURL

```sh
curl -X GET "https://us1.platform.bird.com/v1/whatsapp/stats/hourly" \
  -H "Authorization: Bearer $TOKEN"
```

## Example response `200`

```json
{
  "period": {
    "from": "2026-05-01",
    "to": "2026-05-25",
    "grain": "day",
    "data_as_of": "2026-05-25T14:03:10Z"
  },
  "data": [
    {
      "bucket": "2026-05-25",
      "delivery": {
        "accepted": 4820,
        "sent": 4810,
        "delivered": 4720,
        "failed": 25,
        "rejected": 412
      },
      "engagement": {
        "read": 3105
      },
      "latency": {
        "processing": {
          "p50_ms": 610,
          "p95_ms": 2140,
          "p99_ms": 5380
        },
        "delivery": {
          "p50_ms": 1530,
          "p95_ms": 6820,
          "p99_ms": 18400
        },
        "total": {
          "p50_ms": 2180,
          "p95_ms": 9060,
          "p99_ms": 24300
        }
      }
    }
  ]
}
```

## Query parameters

- `from` (string): 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.
- `to` (string): 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.
- `timezone` (string): 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.
- `template` (string): Restricts the statistics to one template, identified by its ID (`wat_…`) or slug. Mutually exclusive with the other dimension filters (`category`, `phone_number`, `tag`); only one may be set per request. An ID matches the `template_id` key on a row of the per-template breakdown; a slug is accepted for callers that predate that key and resolves to the same messages.
- `category` (string)

  Restrict the statistics to a single template category. Mutually exclusive with the other dimension filters (`template`, `phone_number`, `tag`); only one may be set per request. Matches the `category` key on a row of the per-category breakdown.

  Possible values (may grow over time): `authentication`, `utility`, `marketing`
- `phone_number` (string): Restrict the statistics to a single business sender phone number, in E.164 form. Mutually exclusive with the other dimension filters (`template`, `category`, `tag`); only one may be set per request. Matches the `phone_number` key on a row of the per-phone-number breakdown.
- `tag` (string): Restrict the statistics to a single tag. Use `name` to match any value of a tag, or `name:value` for a specific pair (for example `campaign:spring_launch`). Mutually exclusive with the other dimension filters (`template`, `category`, `phone_number`); only one may be set per request. A row of the per-tag breakdown carries the same pair in its single `tag` key.

## Response body

- `period` (object, required): The window and bucket grain the response covers, echoed from the request, plus the freshness boundary the data is current to.
- `period.from` (string, required): Inclusive start of the window. A calendar day (YYYY-MM-DD) on the day grain, an RFC 3339 instant on the hour grain.
- `period.to` (string, required): Inclusive end of the window. A calendar day (YYYY-MM-DD) on the day grain, an RFC 3339 instant on the hour grain.
- `period.grain` (string, required)

  The bucket grain of the series, either `day` or `hour`.

  Possible values: `day`, `hour`
- `period.data_as_of` (nullable string): Latest time reflected in the statistics. More recent events might not be included yet. Null when the freshness boundary is unavailable.
- `data` (array of object, required): One row per day or hour in chronological order. Buckets with no activity contain zero counts.
- `data.bucket` (string, required): The day (YYYY-MM-DD) or hour (RFC 3339, on the hour) this point covers, matching the period's grain.
- `data.delivery` (object, required)
- `data.delivery.accepted` (integer, required): Distinct messages accepted for sending after admission checks.
- `data.delivery.sent` (integer, required): Distinct messages handed off for delivery.
- `data.delivery.delivered` (integer, required): Distinct messages confirmed delivered to the recipient's device.
- `data.delivery.failed` (integer, required): Distinct messages that failed during sending or delivery.
- `data.delivery.rejected` (integer, required): Distinct messages rejected before any send attempt, because the recipient is on the workspace's suppression list, no reachable recipient was given, the destination has no price, or the wallet could not fund the send. Rejected messages are never charged and are not counted in `accepted`, so the total addressed is `accepted + rejected`. Excluded from `failure_rate`, which covers send failures only.
- `data.engagement` (object, required)
- `data.engagement.read` (integer, required): Distinct messages confirmed read by the recipient.
- `data.latency` (object, required)
- `data.latency.processing` (object): Approximate p50, p95, and p99 latency percentiles in milliseconds for one latency family. All three are null when no qualifying event contributed a measurement.
- `data.latency.processing.p50_ms` (nullable integer, required): Median (50th percentile) latency in milliseconds. Null when no qualifying event contributed a measurement.
- `data.latency.processing.p95_ms` (nullable integer, required): 95th percentile latency in milliseconds. Null when no qualifying event contributed a measurement.
- `data.latency.processing.p99_ms` (nullable integer, required): 99th percentile latency in milliseconds. Null when no qualifying event contributed a measurement.
- `data.latency.delivery` (object): Approximate p50, p95, and p99 latency percentiles in milliseconds for one latency family. All three are null when no qualifying event contributed a measurement.
- `data.latency.delivery.p50_ms` (nullable integer, required): Median (50th percentile) latency in milliseconds. Null when no qualifying event contributed a measurement.
- `data.latency.delivery.p95_ms` (nullable integer, required): 95th percentile latency in milliseconds. Null when no qualifying event contributed a measurement.
- `data.latency.delivery.p99_ms` (nullable integer, required): 99th percentile latency in milliseconds. Null when no qualifying event contributed a measurement.
- `data.latency.total` (object): Approximate p50, p95, and p99 latency percentiles in milliseconds for one latency family. All three are null when no qualifying event contributed a measurement.
- `data.latency.total.p50_ms` (nullable integer, required): Median (50th percentile) latency in milliseconds. Null when no qualifying event contributed a measurement.
- `data.latency.total.p95_ms` (nullable integer, required): 95th percentile latency in milliseconds. Null when no qualifying event contributed a measurement.
- `data.latency.total.p99_ms` (nullable integer, required): 99th percentile latency in milliseconds. Null when no qualifying event contributed a measurement.

## Related resources

- [Should I use a Bird SDK or call the API directly?](/explained/platform/should-i-use-an-sdk-or-call-the-api-directly) (answer)
- [Build your first integration](/learn/paths/integration) (course)
- [Send your first email](/docs/get-started/send-your-first-email) (docs)

[Get an implementation brief](/learn/workspace?topic=api-basics)
