Add a channel for alerts.

What to send

ChannelCreate

config
objectneededThe kind's own settings: `{"to": ["me@example.org"]}` for email, `{"url": "…", "secret": "…"}` for a webhook, `{"topic": "…"}` for ntfy.
kind
stringneeded
kinds
list of string or nullLeft out, the kinds a new channel is told about by default.
name
stringneeded

The answer

Status 201

ChannelView Somewhere alerts go. Its secrets are never sent back: `target` says where it points with them left out.

created_at
stringneeded
declared
booleanneededFrom the instance's configuration: not edited here.
disabled
booleanneeded
id
stringneeded
kind
stringneeded`alertmanager`, `email`, `webhook`, `ntfy`, `discord`, `slack`, `telegram`.
kinds
list of stringneededThe alerts this channel is told about: its row of the matrix.
name
stringneeded
target
stringneeded

Asking

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