Documentation · API reference
PATCH/api/v1/sites/{site}

Change a site's settings

Change a site's settings: only what is sent changes, and each change is kept in the site's history.

Parameters

sitein the address
neededA site's id or name

What to send

SiteUpdate Change a site. Whatever is left out stays as it is.

hostnames
list of string or null
paused
boolean or null
resume
string or nullWith `paused: true`: when counting starts again by itself. `hour` is in an hour, `tomorrow` is 09:00 the next day in the site's own time. Left out, it stays paused until someone says otherwise.
settings
object or null
time_zone
string or null

The answer

Status 200

SiteView

created_at
stringneeded
declared
booleanneededDeclared in the instance's configuration: read-only here, pausable.
hostnames
list of stringneededHostnames allowed to send hits for this site.
id
stringneeded
mode
stringneeded`easy` or `hard`.
name
stringneededThe name the tag carries (`data-site`).
paused
booleanneeded
reading
stringneeded`strict` or `cnil`.
settings
objectneeded
time_zone
stringneeded

Asking

With your token from Settings
curl -X PATCH https://tidekeeper.eu/api/v1/sites/example.org \
    -H "Authorization: Bearer $TIDEKEEPER_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{}'
With your token from Settings
const answer = await fetch("https://tidekeeper.eu/api/v1/sites/example.org", {
  method: "PATCH",
  headers: {
    Authorization: `Bearer ${process.env.TIDEKEEPER_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({}),
}).then((r) => r.json());