Add a site to the account. Its name is its domain; the answer is the site as it now is.

What to send

SiteCreate

hostnames
list of string or nullLeft out, the name is the one hostname.
name
stringneededUsually the domain: `eza.rocks`.
settings
object or null
time_zone
string or nullAn IANA name. Left out, `UTC`.

The answer

Status 201

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