On this page

2.6 REST API

Everything the web interface can do goes through the server's REST API. You can use it from scripts and monitoring tools as well. This page describes sign-in, conventions and the endpoint groups and shows a few calls with curl. The complete list of every endpoint is served by the server itself as an OpenAPI document.

Base and description

What

Where

Base URL

https://<server>:8443/api/v1

OpenAPI 3.1 (machine-readable)

GET /api/v1/openapi.json (role readonly)

Readable list of all endpoints

GET /api/v1/docs (plain HTML without scripts)

Authentication

Three ways:

  • Session: POST /auth/login with user name and password sets the cookie __Host-pdc_session and returns a csrf_token. Every request except GET, HEAD and OPTIONS must send the token in the header X-CSRF-Token. With TOTP, sign-in takes two steps (/auth/login, then /auth/login/totp). The session is valid for session_hours (default 12).

  • API token: POST /auth/tokens (name, role, validity in days) returns a token of the form pdc_… once. It is sent as Authorization: Bearer pdc_…; no CSRF header is needed. A token never has more rights than its owner; actions that require an interactive session (for example certificates or approvals) are refused with session_required. With four-eyes approval, tokens never decide.

  • OIDC: GET /auth/oidc/start starts sign-in through an identity provider (chapter 11 Users and Security).

Conventions

Topic

Rule

Roles

readonly < restore < operator < admin; each endpoint names its minimum role

Lists

page (from 1) and per_page (default 20, at most 100); answer { "items": [...], "total": n, "page": p, "per_page": n }

Times

Unix seconds (UTC)

Sizes

Bytes

IDs

UUIDs for repositories, jobs, runs, agents; snapshot IDs are 64 hex characters, a unique prefix of at least 8 characters is enough

Snapshot paths

/-separated; Linux /home/anna/docs, Windows /C/Users/anna for C:\Users\anna

Errors

Non-2xx answers carry { "error": "<code>", "message": "<text>" }

Important error codes: bad_request (400), unauthorized (401), forbidden and csrf (403), not_found (404), conflict (409), repository (502, storage or repository problem), internal (500), timeout (504, the agent did not answer), locked and too_many_requests (429), session_required (403), approval_required (202, a four-eyes request was created).

Endpoint groups

Group

Paths (examples)

Content

Setup and session

/setup, /session, /auth/login, /auth/logout, /auth/me, /auth/password

First admin account, sign-in, password change

Two-factor, tokens, OIDC

/auth/totp/*, /auth/tokens, /auth/oidc/*

TOTP, API tokens, single sign-on

Users

/users, /users/{id}/totp, /users/{id}/machines

Accounts, roles, machine restriction

Agents

/agents, /agents/{id}, /agents/{id}/settings, /agents/{id}/wake, /agents/{id}/disks, /enrollment-tokens

Manage machines, settings, Wake-on-LAN, disks, enrollment tokens

Repositories

/repositories, /repositories/{id}/stats, /repositories/{id}/isolation, /repositories/{id}/hardened, /repositories/{id}/forecast, /rotation-sets, /quotas

Storage, statistics, isolation, hardening, forecast, rotated drives, quotas

Jobs

/jobs, /jobs/{id}/run, /schedules, /exclude-templates

Create, change and start jobs; schedules and exclude templates

Plans and automation

/plans, /automation, /blackouts

Protection plans, system-wide rules, blackout windows

Runs

/runs, /runs/{id}, /runs/{id}/log, /history, /stats, /events

Runs and logs, history, statistics, live events (Server-Sent Events)

Snapshots

/snapshots, /snapshots/{id}/browse, /snapshots/{id}/tables

Browse restore points

Restore

/restore, /restore/zip, /mounts, /scan, /instant, /recovery

Restore, ZIP download, mounting, scan, instant recovery, recovery medium

Deployment

/push, /push-credentials, /discovery/scans, /packages, /packages/update

Installation from the server, network discovery, agent packages, updates

Monitoring

/dashboard, /protection, /alerts, /verify-results, /holds

Dashboard, protection status, alerts, test results, retention holds

Notifications and reports

/notifications/channels, /notifications/rules, /reports

Channels, rules, reports

Security

/four-eyes, /approvals, /audit, /metrics

Four-eyes approvals, audit log, metrics tokens

System

/system, /system/certificate, /system/dr, /system/dr-passphrase, /system/config-backup, /openapi.json, /docs

Certificates, disaster recovery, configuration backup, API description

The agent endpoint on port 8444 is not part of the REST API for the interface; it is described in section 2.3 Agent communication and PKI.

Example calls

Sign in and helper function

S=https://backup-pc:8443/api/v1
CSRF=$(curl -sk -c jar -H 'content-type: application/json' \
  -d '{"username":"admin","password":"..."}' $S/auth/login | jq -r .csrf_token)
api() { curl -sk -b jar -H "x-csrf-token: $CSRF" -H 'content-type: application/json' "$@"; }

-k skips certificate verification because the server uses a certificate from its own CA. It is better to download the CA (/install/ca.crt on port 8444, or under Settings β†’ Certificate) and verify with --cacert.

List agents and start a job

api $S/agents | jq '.items[] | {id, hostname}'
api -X POST $S/jobs/<job ID>/run
api $S/runs/<run ID>

Create a repository

api -X POST $S/repositories -d '{"name":"USB disk","kind":"local",
  "location":"/mnt/usb/pdc","password":"a long passphrase"}'
api -X POST $S/repositories/test -d '{"kind":"local","location":"/mnt/usb/pdc"}'

POST /repositories/test checks a location before saving.

Backup job with schedule and retention

api -X POST $S/jobs -d '{"name":"Anna laptop","kind":"backup",
  "agent_id":"<agent>","repository_id":"<repo>","workload":"files",
  "spec":{"paths":["C:\\Users\\anna"],"exclude_templates":["windows-profiles-no-caches"]},
  "schedule":{"type":"daily","time":"12:30","window":{"start":"08:00","end":"22:00"}},
  "retention":{"keep_daily":7,"keep_weekly":4,"keep_monthly":12,"keep_yearly":3}}'

Token for monitoring without a session

api -X POST $S/auth/tokens -d '{"name":"zabbix","role":"readonly","expires_days":365}'
curl -sk -H 'Authorization: Bearer pdc_…' $S/dashboard

The token appears only in the answer of the first call. The fields of the job specifications (spec) and the options of each workload are in chapter 06 Jobs, schedule fields in chapter 07 Schedules and Plans, restore fields in chapter 09 Restore.

Last updated Nov 16, 2026