Sites

Create a site and get its install snippet

Creates a site and returns everything needed to install tracking, so provisioning is one round-trip. Requires an ALL-SITES key: a single-site key gets 403 key_not_scoped, since the new site would be outside its own scope. A duplicate url is 409 site_exists — unlike the dashboard, which permits it: for an agent a duplicate is nearly always a retry that lost its response. The first non-hobby site starts the trial subscription exactly as the dashboard does. Send an Idempotency-Key to make retries safe.

post/sites

Request

Headers

Idempotency-Keystring

Replays the stored response for 24 hours instead of creating a second site. Reuse with a different body is 409 idempotency_conflict.

Request body

urlstring required
timezonestring

IANA zone. Omitted = the server default.

hobbyboolean

Request a hobby site. The domain must match a configured hobby suffix.

Example request

{
  "url": "https://example.com",
  "timezone": "Europe/Kyiv"
}

Response

The created site, with its script URL and snippet.

site_idinteger required
namestring required

The site url as stored.

hashstring required

Same token as in SiteSummary.hash.

timezonestring required
week_startinteger required
hobbyboolean required
script_urlstring required
snippetstring required

The ready-to-paste script tag.

Changes

No recorded changes to this operation across all 1 revision of this API.