CustomDomain™ docs
API referenceAnalytics

Edge traffic for one domain

GET
/connections/{id}/traffic

What the edge served for one connected domain: requests by status class, bytes relayed to visitors, the origin's time to first byte (p50, p95, p99 and mean over the requests that reached it) and approximate unique visitors, as a series with totals, plus when the edge last served a request for it. serving says whether the domain's visitors reach the edge at all: live and verifying are served by the edge; not_live will be once the domain is live; dns_only means its records point somewhere other than the edge (it was connected for DNS only), so its traffic never passes through CustomDomain™ and there is nothing to count. Visitors are estimated from a sketch of keyed hashes of client addresses; no address is stored, and a visitor seen on two UTC days counts once on each. A tenant API key reads a domain of any application in its tenant; a widget token minted with scope app (or a delegated agent token) reads its own application's domains; an end user's connect-scoped widget token is refused.

A delegated agent token needs domains:read.

AuthorizationBearer <token>

Long-lived tenant API key, cd_live_… (production) or cd_test_… (staging, development), stored hashed. Keys created before the switch to cd_ start with sk_live_… / sk_test_… and are still accepted. Scoped to the owning application's tenant.

In: header

Path Parameters

id*string

Query Parameters

range?string
Default"7d"

Value in

  • "24h"
  • "7d"
  • "30d"
  • "90d"

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/connections/string/traffic"
{  "connection_id": "string",  "domain": "string",  "range": "24h",  "granularity": "hour",  "from": "2019-08-24T14:15:22Z",  "to": "2019-08-24T14:15:22Z",  "serving": {    "through_edge": true,    "reason": "live"  },  "last_request_at": "2019-08-24T14:15:22Z",  "totals": {    "requests": 0,    "status": {      "1xx": 0,      "2xx": 0,      "3xx": 0,      "4xx": 0,      "5xx": 0    },    "bytes_out": 0,    "error_rate": 0,    "latency_ms": {      "p50": 0,      "p95": 0,      "p99": 0,      "mean": 0,      "samples": 0    },    "visitors": 0  },  "series": [    {      "t": "2019-08-24T14:15:22Z",      "requests": 0,      "status": {        "1xx": 0,        "2xx": 0,        "3xx": 0,        "4xx": 0,        "5xx": 0      },      "bytes_out": 0,      "error_rate": 0,      "latency_ms": {        "p50": 0,        "p95": 0,        "p99": 0,        "mean": 0,        "samples": 0      },      "visitors": 0    }  ],  "retention": {    "hourly_days": 0,    "daily_days": 0  }}
{  "code": "string",  "title": "string",  "details": "string"}
{  "code": "string",  "title": "string",  "details": "string"}
{  "code": "string",  "title": "string",  "details": "string"}
{  "code": "string",  "title": "string",  "details": "string"}
{  "code": "string",  "title": "string",  "details": "string"}