Skip to main content
GET
Retention

Authorizations

Authorization
string
header
required

An API key that starts with cs_sk_, created in your workspace settings, under API keys.

Path Parameters

siteId
string
required

The site's id, from GET /sites. demo is a public demo site that needs no key.

Query Parameters

range
enum<string>

Preset period: today (today), yesterday (yesterday), 24h (last 24 hours), 7d (last 7 days), 30d (last 30 days), 90d (last 90 days), mtd (month to date), last_month (last month), ytd (year to date), 12m (last 12 months), all (all time). Defaults to 30d. Use either this or from and to.

Available options:
today,
yesterday,
24h,
7d,
30d,
90d,
mtd,
last_month,
ytd,
12m,
all
from
string<date>

Start day of a custom period, YYYY-MM-DD, inclusive, UTC. Requires to.

Pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
to
string<date>

End day of a custom period, YYYY-MM-DD, inclusive, UTC. Requires from.

Pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
compare
enum<string>

Also return the comparison period: "previous" (the period just before, same length) or "year" (same period a year earlier). Defaults to none.

Available options:
previous,
year,
none
filter
string[]

Narrow the data. Repeat the parameter to add filters; all must match. Format: dimension:op:value, for example country:is:DE. Dimensions: page, entry_page, exit_page, hostname, channel, source, referrer, utm_source, utm_medium, utm_campaign, utm_term, utm_content, country, region, city, browser, os, device, language, event, ai_assistant. Operators: is, is_not, contains.

interval
enum<string>
default:week

Cohort size and the step between columns.

Available options:
day,
week,
month

Response

The report. Every report states the period it covers and carries a one-sentence summary.

A report. The fields depend on the endpoint and are described in its description.

range
object
summary
string

The headline figures in one sentence, already formatted.