Skip to Content
GET
/api/v1/accounts/{accountId}/traffic

Returns total aggregated email volume and bytes across all domains owned by an account. Pass mailboxId to narrow the same aggregate to one mailbox — the series a mailbox overview charts. That dimension was added to the analytics write later than the rest, so a mailbox-scoped window covers traffic recorded since; GET /domains/{domain}/events (or /accounts/{accountId}/events) with the same filter remains the authoritative log.

Authorization

bearerAuth
headerAuthorizationBearer <token>

Two credential kinds share this scheme; GET /api/v1/auth/whoami answers which one you hold and what it reaches.

oek_… API key (minted by POST /api/v1/api-keys; shown once at mint). role: account reaches the full account surface: the directory (domains, routes, patterns, api-keys, accounts, address lists) plus every mailbox the account owns. role: system additionally reaches the operator surface, which is documented separately.

oemp_… mailbox app password (minted by POST /api/v1/identities/{identityId}/credentials). Reaches ONE mailbox: its messages, labels, threads, search, sync, send, filters and PIM collections. Directory routes refuse it with 403 insufficient_scope.

Refusal vocabulary: a missing, malformed, expired, or revoked credential answers 401 unauthorized with a WWW-Authenticate: Bearer challenge; a VALID credential outside its scope answers 403 (insufficient_scope for an app password on a directory route, system_credentials_required where only the operator may call). The public routes (health, branding, token-in-path capabilities) declare security: [].

Path Parameters

accountId*string

Account ULID identifier

Query Parameters

range?string

Time window range ('1h', '6h', '24h', '7d', '30d')

Default"24h"
Value in"1h""6h""24h""7d""30d"
mailboxId?string

Narrow the aggregate to a single mailbox ULID

Lengthlength <= 64

Response Body

Counts and bytes summed across all domains owned by this account

application/json
  1. response
accountId*string

Account ID

byOutcome*

Breakdown of event counts by outcome

domains*array<string>

List of domain names included in this aggregate

domainsTruncated*boolean

True if account owns more domains than query limit

estimated*boolean

True if metrics are sampled estimates

mailboxId?string

Present when the aggregate was narrowed to one mailbox

range*string

Time range of statistics

retentionDays*integer

Analytics retention window in days

rows*array<>

Breakdown rows grouped by outcome and route kind

series?array<>

Time-series buckets for charting

totals*
Example Request
curl -X GET 'https://api.open.email/api/v1/accounts/string/traffic'
Example Response
{
  "accountId": "string",
  "byOutcome": {
    "property1": 0,
    "property2": 0
  },
  "domains": [
    "string"
  ],
  "domainsTruncated": true,
  "estimated": true,
  "mailboxId": "string",
  "range": "string",
  "retentionDays": 0,
  "rows": [
    {
      "bytes": 0,
      "events": 0,
      "outcome": "string",
      "routeKind": "string"
    }
  ],
  "series": [
    {
      "bucket": "string",
      "byOutcome": {
        "property1": 0,
        "property2": 0
      },
      "bytes": 0,
      "bytesIn": 0,
      "bytesOut": 0,
      "events": 0,
      "forwarded": 0,
      "inbound": 0,
      "outbound": 0
    }
  ],
  "totals": {
    "bytes": 0,
    "bytesIn": 0,
    "bytesOut": 0,
    "events": 0,
    "forwarded": 0
  }
}