Make a token: what it may do, and on which sites. It is in this answer once; only its hash is kept.

What to send

TokenCreate

expires_days
integer or nullDays until it stops working. Left out, it does not.
name
stringneeded
scopes
list of string`read`, `events`, `manage`, `visitors`.
sites
list of stringSite ids or names it is held to. Empty is every site its maker may open.

The answer

Status 201

TokenCreated The only time a token's secret is shown.

secret
stringneeded
token
TokenViewneeded

Asking

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