---
title: "Edge traffic for the workspace or one application, with its busiest domains"
method: GET
path: "/traffic"
tags: ["Analytics"]
---

# Edge traffic for the workspace or one application, with its busiest domains

`GET /traffic`

## Request

- Base URL: `https://api.customdomain.ai/v1`
- URL: `https://api.customdomain.ai/v1/traffic`
- Auth: HTTP bearer

Requests the CustomDomain™ edge served for the tenant's domains, by status class, and the bytes it relayed to visitors, as a series (one point per hour for `24h` and `7d`, per UTC day for `30d` and `90d`, every bucket present) with totals and the busiest domains. Only traffic that passes through the edge is counted: a domain whose records point at the integrator's own servers (connected for DNS only) never appears. Counts arrive from the edge once a minute. Hourly figures are kept 14 days, daily figures 400 days. API key; any member role; `app_id` narrows to one application of the key's tenant (another tenant's application is a 404).

## Query parameters

- `range` '24h' | '7d' | '30d' | '90d'
- `app_id` string
- `limit` integer

## Response `200`

Traffic summary

- TrafficSummary
  - `application_id` string, required: The application the summary is narrowed to; empty for the whole workspace.
  - `range` '24h' | '7d' | '30d' | '90d', required
  - `granularity` 'hour' | 'day', required
  - `from` string, date-time, required
  - `to` string, date-time, required
  - `totals` object, required
    - `requests` integer, required
    - `status` TrafficStatusCounts, required: Requests by the status class of the answer the visitor got.
      - `1xx` integer, required: Mostly 101 Switching Protocols (websockets).
      - `2xx` integer, required
      - `3xx` integer, required: Includes the edge's own redirects (redirect_to and the www redirect).
      - `4xx` integer, required: Includes 421 answered by the edge when the domain has no origin set.
      - `5xx` integer, required: Includes 502 answered by the edge when the origin could not be reached.
    - `bytes_out` integer, required
    - `error_rate` number, required
    - `domains_with_traffic` integer, required: How many domains the edge served at least once in the range.
  - `series` object[], required
    - `t` string, date-time, required
    - `requests` integer, required
    - `status` TrafficStatusCounts, required: Requests by the status class of the answer the visitor got.
      - `1xx` integer, required: Mostly 101 Switching Protocols (websockets).
      - `2xx` integer, required
      - `3xx` integer, required: Includes the edge's own redirects (redirect_to and the www redirect).
      - `4xx` integer, required: Includes 421 answered by the edge when the domain has no origin set.
      - `5xx` integer, required: Includes 502 answered by the edge when the origin could not be reached.
    - `bytes_out` integer, required
    - `error_rate` number, required
  - `top_domains` object[], required: The busiest domains, most requests first.
    - `connection_id` string, required
    - `domain` string, required
    - `application_id` string, required
    - `requests` integer, required
    - `status` TrafficStatusCounts, required: Requests by the status class of the answer the visitor got.
      - `1xx` integer, required: Mostly 101 Switching Protocols (websockets).
      - `2xx` integer, required
      - `3xx` integer, required: Includes the edge's own redirects (redirect_to and the www redirect).
      - `4xx` integer, required: Includes 421 answered by the edge when the domain has no origin set.
      - `5xx` integer, required: Includes 502 answered by the edge when the origin could not be reached.
    - `bytes_out` integer, required
    - `error_rate` number, required
    - `share` number, required: This domain's part of the scope's requests, 0 to 1.
    - `last_request_at` string, date-time, nullable, required
  - `retention` TrafficRetention, required
    - `hourly_days` integer, required: How long hourly figures are kept.
    - `daily_days` integer, required: How long daily figures are kept.

## Other responses

- `400`: Error envelope: {code, title, details}.
- `401`: Error envelope: {code, title, details}.
- `404`: Error envelope: {code, title, details}.
- `503`: Error envelope: {code, title, details}.

---

[API](https://skmtc.dev/customdomain/apis/customdomain-control-plane-api.md) · [All operations](https://skmtc.dev/customdomain/apis/customdomain-control-plane-api/llms.txt) · [OpenAPI document](https://skmtc.dev/customdomain/apis/customdomain-control-plane-api/revisions/34d89cb7a7cd?raw)
