Alerts
Alerts tell you when something needs your attention. They go to Slack, Discord or a webhook of your own. The service sends no e-mail.
What you can be alerted about
| Event | When it happens |
|---|---|
run.failed | A backup run failed or finished with problems. The alert names the repositories that failed and their errors. |
run.missed | A scheduled backup did not run, for example because the machine was off for days. |
billing.payment_failed | A payment for your plan failed. |
billing.subscription_ended | Your plan ended. |
billing.renewal_due | A plan that does not renew automatically ends soon: 14 days before a yearly plan ends, 3 days before a monthly one. |
How alerts are set up
Alerts have two parts:
- A channel is where alerts go: one Slack or Discord webhook, or one URL of yours. An account can have 20 channels.
- A rule sends some event types to some channels. A rule can also hold alerts during quiet hours and limit how often the same event type is repeated. An account can have 50 rules.
You set them up in the dashboard, on Settings > Alerts. The same can be done with the API.
1. Add a channel
For Slack, create an incoming webhook in your Slack workspace and copy its URL (https://hooks.slack.com/services/...). For Discord, open the channel's settings, then Integrations > Webhooks, create a webhook and copy its URL (https://discord.com/api/webhooks/...).
- In the dashboard, open Settings > Alerts.
- Under Add a channel, choose the kind (Slack, Discord or Webhook), give it a name if you like and paste the URL.
- Select Add channel. For a webhook of your own, the page now shows the signing secret once: store it (see Receive alerts on your own webhook).
- Select Test in the channel's row to send a test alert, and check that it arrives.
The Channels list shows each channel as On, Off or Failing. There you can also turn a channel off and on, rename it or delete it. The URL is stored encrypted, and the dashboard only ever shows part of it.
2. Add a rule
- On the same page, select Add a rule and give the rule a name.
- Under Events, tick the events to be alerted about.
- Under Send to, tick the channels that get them.
- Optional: tick the quiet hours box and set the start, the end and the time zone. An alert that happens during quiet hours is sent when they end.
- Optional: set how often, in minutes, the same event may be repeated to a channel.
- Select Add rule.
The Rules list lets you change a rule, turn it off and on or delete it. Recent deliveries shows each alert and each test sent in the last 30 days, with its status and any error.
A delivery that fails is retried. When many alerts happen in a short time, the extra ones are collected and sent together, so a channel is not flooded.
With the API
Scripts can set alerts up with the backup API, using a personal access token with write access (see MCP and access tokens). The API's address is the one in the link command on the dashboard's Settings > Agents page. In the examples, $API is that address and $TOKEN your token.
Create a channel:
curl -X POST "$API/api/alerts/channels" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"kind": "slack", "name": "Backups", "target": "https://hooks.slack.com/services/..."}'
kind is slack, discord or webhook. The answer holds the channel's id. The URL is stored encrypted, and the API only ever shows its host and last four characters.
Send a test alert to check the channel:
curl -X POST "$API/api/alerts/channels/<id>/test" -H "Authorization: Bearer $TOKEN"
Create a rule:
curl -X POST "$API/api/alerts/rules" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Backup problems",
"event_types": ["run.failed", "run.missed"],
"channel_ids": [<id>],
"quiet_hours": {"start": "22:00", "end": "07:00", "time_zone": "Europe/Berlin"},
"min_interval_seconds": 3600
}'
quiet_hoursis optional. An alert that happens during quiet hours is sent when they end.min_interval_secondsis optional (0 to 604800, one week). Within that time after an alert, the rule does not send the same event type to the same channel again.
The other requests:
| Request | What it does |
|---|---|
GET /api/alerts/channels | Lists your channels, with whether each one is failing and its last error. |
PATCH /api/alerts/channels/<id> | Renames a channel, or turns it off and on with {"enabled": false}. |
DELETE /api/alerts/channels/<id> | Deletes a channel. |
GET /api/alerts/rules | Lists your rules. |
PATCH /api/alerts/rules/<id> | Changes a rule; send only the fields to change. |
DELETE /api/alerts/rules/<id> | Deletes a rule. |
GET /api/alerts/deliveries | Lists the alerts sent, newest first, with their status and any error. |
Receive alerts on your own webhook
A webhook channel receives each alert as a JSON POST to your URL. Adding the channel shows its signing secret (it starts with whsec_; signing_secret in the API's answer). It is shown only once: store it.
Every request carries three headers:
| Header | Value |
|---|---|
X-GHB-Event | The event type, for example run.failed. |
X-GHB-Delivery | An id for this delivery. A retry repeats it, so you can ignore duplicates. |
X-GHB-Signature | t=<unix seconds>,v1=<signature> |
To check that a request came from us, compute the HMAC-SHA256 of the text <t>.<body> (the timestamp, a dot, then the raw request body) with the signing secret as the key, and compare its hex digest with v1. Reject requests whose timestamp is more than a few minutes old.
The URL must be https:// and must not point at a private or local network address.