# Get account API call counts

Returns the API calls attributed to an account per time bucket, successes and failures alike: one per HTTP request plus one per JMAP method call, made with the account's keys or for its mailboxes. Buckets are labelled, sized and aligned exactly as `GET /accounts/{accountId}/traffic`'s for the same range. A sampled estimate; `GET /accounts/{accountId}/usage` carries the exact daily counts.

## `GET /api/v1/accounts/{accountId}/requests`

### Path parameters

- `accountId` (string, required) — Account ULID identifier

### Query parameters

- `range` ("1h" | "6h" | "24h" | "7d" | "30d", default `"24h"`) — Time window ('1h', '6h', '24h', '7d', '30d')

### Responses

**200** — The account's API calls per bucket over the window, oldest first, and their total

`application/json` → AccountRequests

- `accountId` (string, required) — Account ULID identifier
- `estimated` (boolean, required) — True if metrics are sampled estimates
- `range` (string, required) — Time range queried
- `retentionDays` (integer, required) — Analytics retention window in days
- `series` (RequestsSeriesPoint[], required) — One point per bucket that holds a call, oldest first. A bucket with no call is absent
  - `bucket` (string, required) — Time bucket start, UTC `YYYY-MM-DD HH:MM:SS`: the same label, width and alignment the traffic aggregate gives the bucket for the same range
  - `calls` (integer <int64>, required) — Estimated API calls in this bucket: one per HTTP request (refusals, 401s and unmatched paths included) plus one per JMAP method call, successes and failures alike
- `total` (integer <int64>, required) — Calls across the window: the series summed

**400** — validation_failed — unknown range

`application/json` → ErrorOrValidation

**401** — unauthorized: the bearer credential is missing, malformed, expired, or revoked. Carries a `WWW-Authenticate: Bearer` challenge

`application/json` → ErrorBody

**404** — Account not found or not accessible to this principal

`application/json` → ErrorBody

**502** — analytics_query_failed

`application/json` → ErrorBody

**503** — analytics_unavailable: no analytics token or account id configured, or this deployment writes no API-call dataset. Or temporary_failure: the platform's storage could not answer just now; retry after the Retry-After window. Any operation can answer this. A write that got it may have been applied, so retry it with the same idempotency key where it takes one, or read the state back first (see Transient failures in the API description)

`application/json` → ErrorBody

### Example request

```bash
curl -X GET 'https://api.open.email/api/v1/accounts/{accountId}/requests' \
  -H 'Authorization: Bearer oek_…'
```
