Documentation
APIAPI reference

Sites

List, create, update, and delete the sites of the team.

GET/api/v1/sites

List sites

Lists the team's sites that the API key can access, in pages of up to 200.

Scopessite:read
Query parameters
limitinteger

Maximum number of results per page.

Default 1001–200
cursorstring | any | null

Opaque pagination cursor from the previous response.

Responses
POST/api/v1/sites

Create site

Creates a site in the team and returns it. Install the tracking script from Get tracking script to start collecting data.

Scopessite:write
Request bodyapplication/json
namestringrequired

Display name of the site.

1–120 chars
domainstringrequired

Domain of the website, without protocol, e.g. example.com.

1–255 chars
publicEnabledbooleanrequired

Whether the public shared dashboard is enabled.

Default false
publicSlugstring

Slug of the public dashboard URL. Omit it to have one generated.

≤ 120 chars
Responses
GET/api/v1/sites/{siteId}

Get site

Returns one site.

Scopessite:read
Path parameters
siteIdstringrequired

ID of the site (see List sites).

1–256 chars
Responses
PATCH/api/v1/sites/{siteId}

Update site

Updates a site's name, domain, or public sharing. Send only the fields to change; at least one is required.

Scopessite:write
Path parameters
siteIdstringrequired

ID of the site (see List sites).

1–256 chars
Request bodyapplication/json
namestring
1–120 chars
domainstring
1–255 chars
publicEnabledboolean
publicSlugstring
≤ 120 chars
Responses
DELETE/api/v1/sites/{siteId}

Delete site

Deletes the site and all of its analytics data. This cannot be undone.

Scopessite:write
Path parameters
siteIdstringrequired

ID of the site (see List sites).

1–256 chars
Responses