Backup Chief webhooks
Backup Chief sends a webhook when backups of a job start failing or recover, a scheduled backup does not start, a run finishes, a server goes offline, an agent update fails, or a download is ready. Use them to page someone when backups break, feed run results into a monitoring tool, or keep another system's list of servers and jobs current without polling the API.
Deliveries are signed, retried, and logged the same way in every Chief Tools product. Read Receive webhooks first for verification, responses, retries, and duplicates. This page covers what is specific to Backup Chief.
Set up an endpoint
Add endpoints under Settings › Webhooks in Backup Chief, then send a test event from the endpoint's page. Deliveries come with the User-Agent BackupChief-Webhooks/1.0.
To set up endpoints from code, use the webhooks API with a token that has the backupchief:webhooks:write scope:
Code
The response includes the endpoint's secret. Store it right away. Backup Chief only returns it when the endpoint is created and when you rotate its secret. Then send a test event to check your receiver. The same API lists event types, events, and deliveries with each attempt's request and response, and resends them.
When an endpoint keeps failing, team members who want webhook notifications get an email. After 5 days of failures Backup Chief disables the endpoint and emails them again.
Events
Each event's data.object is a Server, BackupJob, BackupRun, or Download, as the API returns it when the event happens. Some events add fields next to object in data.
Each event type below links to its page in the API reference, with the request headers and every field of the payload. The OpenAPI document also lists the events under webhooks, so you can generate types for your receiver from it.
Backup alerts
These events follow the same rules as Backup Chief's alert emails. A job that keeps failing sends backup.failing once, not once per run.
| Type | Sent when | Extra data fields |
|---|---|---|
backup.failing | The latest backup of a job failed, finished partially, or was skipped, and the job was not already failing. | run_id: the run that failed |
backup.recovered | A backup of a failing job completes. | run_id: the run that completed, failing_since: when the first failed backup finished |
backup.missed | A scheduled backup has not started 30 minutes after its time. | |
backup.resumed | Scheduled backups start on time again after one was missed. | missed_since: when Backup Chief noticed the missed backup |
A cancelled backup does not change whether a job is failing. A job on an offline server sends no backup.missed, because server.offline already covers it. Pausing a job ends its missed backup alert without backup.resumed, and revoking a server ends its offline alert without server.online.
Maintenance alerts
Backup Chief tracks each kind of maintenance on its own. A failing full integrity check does not stop the cleanup of old recovery points from counting as healthy.
| Type | Sent when | Extra data fields |
|---|---|---|
maintenance.failing | The latest run of one kind of maintenance failed or finished partially, and that kind was not already failing. | run_id, run_kind |
maintenance.recovered | A run of that kind completes again. | run_id, run_kind, failing_since |
run_kind is a BackupRunKind, such as check_data for the full integrity check or prune for freeing up storage space.
Runs
| Type | Sent when |
|---|---|
run.finished | The agent reports the result of a backup or maintenance run. |
run.finished comes for every run, whatever its result. Read status and result_code on the run to decide what to do, and kind to tell backups from maintenance. A run with the status unresolved can report again once its outcome is known, so you may receive a second run.finished for the same run. Keep the latest.
A run that never reports a result sends no run.finished, for example when someone revokes its server while it runs. List runs to find those.
Availability
| Type | Sent when | Extra data fields |
|---|---|---|
server.offline | An enrolled server's agent has not checked in for 15 minutes. | |
server.online | An offline server's agent checks in again. | offline_since: when Backup Chief noticed the server went offline |
Servers
| Type | Sent when |
|---|---|
server.created | A server is added. It waits for its agent, with status set to pending. |
server.enrolled | A server's agent enrolls, also when the agent enrolls again with a new enrollment token. |
server.updated | A server is renamed, or its automatic agent updates are turned on or off. |
server.revoked | A server's agent is revoked. Its backup jobs, runs, and recovery points stay. |
server.deleted | A server that never enrolled is deleted. object is the server as it was right before. |
enrollment never appears in webhooks, so enrollment tokens do not leave Backup Chief this way.
Agent updates
| Type | Sent when | Extra data fields |
|---|---|---|
server.agent_update_started | A person, the API, or the automatic rollout requests an agent update, also when someone retries a failed one. | command_id: the update |
server.agent_update_succeeded | The agent reports the version it was updated to. | command_id |
server.agent_update_failed | The agent reports that it could not install the update, or did not pick it up within 3 hours. Sent once per attempt. | command_id, result: why it failed |
agent_rollout.paused | The automatic rollout of an agent release paused for your team after too many failed updates. | failures: the failed updates since the rollout was last resumed |
Every update that starts ends with server.agent_update_succeeded or server.agent_update_failed. object.agent.update on the server shows the latest update with its target_version and status. Use command_id to match the events of one update.
result is an AgentUpdateResult:
preflight_failed: the package repository lacks the target or the current version. The rollout tries again after 6 hours, and this does not count towards pausing it.installation_failed: the package manager could not install the target version.readiness_failed_rolled_back: the new agent did not start correctly, and the previous version is back.rollback_failed: the new agent did not start correctly, and restoring the previous version failed too. The server needs attention.target_not_newer: the installed agent was already as new as the target.expired: the agent did not pick the update up within 3 hours, usually because the server was offline. This does not count towards pausing the rollout, so one offline server cannot pause it for your team. The rollout tries the server again once it is back.cancelled: the server was revoked or re-enrolled before the update finished. This does not count towards pausing the rollout either.
Handle unknown results like a failed update. A server that installs the target version after its update failed, for example by hand, still sends server.agent_update_succeeded once the agent reports it.
agent_rollout.paused has the release as data.object, with its version, url, and published_at. Servers that already updated keep the new version. Resuming the rollout in Backup Chief sends no event.
Backup jobs
| Type | Sent when | Extra data fields |
|---|---|---|
job.created | A backup job is created. It stays pending until its storage is set up and someone saves its recovery document. | |
job.updated | A job's settings change, such as its name, source, schedule, or retention. | |
job.paused | A job is paused. It runs no backups or maintenance until it is resumed. | |
job.resumed | A paused job is resumed. | |
job.deleted | A job and its history are deleted. object is the job as it was right before. | backups_deleted |
When backups_deleted is false, the backups stay in your storage, and restic can still restore them with the job's recovery document. When it is true, Backup Chief deleted them from storage first. The event then arrives after that deletion finished, which can take a while after the delete request.
Downloads
| Type | Sent when |
|---|---|
download.ready | A download is prepared. Create a download URL to fetch it before expires_at. |
download.failed | A download could not be prepared. failure_code and failure_message on the download say why. |
A cancelled or expired download sends no event.
Examples
Backups started failing
Code
Get the run with run_id to show why it failed. summary describes the result, and the run log has the agent's output.
A run finished
Code
The full object has every field of the BackupRun schema. status, kind, and result_code can gain new values. Treat a value you do not recognize as unknown instead of failing.
Common integrations
- Paging. Subscribe to
backup.failing,backup.missed,maintenance.failing,server.offline, andagent_rollout.paused. Close the page onbackup.recovered,backup.resumed,maintenance.recovered, andserver.online. - Backup monitoring. Subscribe to
run.finishedand record each backup'sstatusandfinished_atper job. Alert in your own system when a job has no complete backup for longer than you accept. - Inventory sync. Subscribe to the server and backup job events, and store the object from
data.object. Use List servers and List backup jobs once to load what exists, and again to catch up after your receiver was down for longer than the retries last.
Events are kept for 30 days. For anything older, read the current state from the API.