文档
APIAPI 参考

站点

列出、创建、读取、更新和删除站点。

GET/api/v1/sites

列出站点

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

权限范围site:read
查询参数
limitinteger

Maximum number of results per page.

默认 1001–200
cursorstring | 任意 | null

Opaque pagination cursor from the previous response.

响应
POST/api/v1/sites

创建站点

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

权限范围site:write
请求体application/json
namestring必填

Display name of the site.

1–120 chars
domainstring必填

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

1–255 chars
publicEnabledboolean必填

Whether the public shared dashboard is enabled.

默认 false
publicSlugstring

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

≤ 120 chars
响应
GET/api/v1/sites/{siteId}

获取站点

Returns one site.

权限范围site:read
路径参数
siteIdstring必填

ID of the site (see List sites).

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

更新站点

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

权限范围site:write
路径参数
siteIdstring必填

ID of the site (see List sites).

1–256 chars
请求体application/json
namestring
1–120 chars
domainstring
1–255 chars
publicEnabledboolean
publicSlugstring
≤ 120 chars
响应
DELETE/api/v1/sites/{siteId}

删除站点

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

权限范围site:write
路径参数
siteIdstring必填

ID of the site (see List sites).

1–256 chars
响应