Skip to main content

API Reference

All endpoints are prefixed with /api and authenticated with a JWT Bearer token, obtained via POST /api/auth/login. Agent endpoints use X-Agent-Token instead.

Authentication

MethodEndpointDescription
GET/api/auth/setup/statusCheck whether admin initialization is needed
POST/api/auth/setupInitialize the first admin (only when no user exists)
POST/api/auth/loginLog in and receive a JWT
POST/api/auth/logoutLog out (invalidate current token)
GET/api/auth/profileCurrent user profile
PUT/api/auth/passwordChange password

Backup Tasks

MethodEndpointDescription
GET/api/backup/tasksList tasks
POST/api/backup/tasksCreate
GET/api/backup/tasks/:idDetail
PUT/api/backup/tasks/:idUpdate
DELETE/api/backup/tasks/:idDelete
PUT/api/backup/tasks/:id/toggleEnable / disable
POST/api/backup/tasks/:id/runTrigger a manual run

Backup Records

MethodEndpointDescription
GET/api/backup/recordsList records with filters
GET/api/backup/records/:idRecord detail
GET/api/backup/records/:id/logs/streamLive logs (SSE)
GET/api/backup/records/:id/downloadDownload the artifact
POST/api/backup/records/:id/restoreRestore to the original source
DELETE/api/backup/records/:idDelete a record
POST/api/backup/records/batch-deleteBulk delete

Storage Targets

MethodEndpointDescription
GET/api/storage-targetsList
POST/api/storage-targetsCreate
GET/api/storage-targets/:idDetail
PUT/api/storage-targets/:idUpdate
DELETE/api/storage-targets/:idDelete
POST/api/storage-targets/testTest connection with pending config
POST/api/storage-targets/:id/testRe-test a saved target
PUT/api/storage-targets/:id/starToggle favourite
GET/api/storage-targets/:id/usageQuery remote usage (where supported)
GET/api/storage-targets/rclone/backendsList all available rclone backends
POST/api/storage-targets/google-drive/auth-urlStart Google Drive OAuth
POST/api/storage-targets/google-drive/completeComplete OAuth flow

Nodes (Cluster)

MethodEndpointDescription
GET/api/nodesList nodes
POST/api/nodesCreate a node and return its token
GET/api/nodes/:idNode detail
PUT/api/nodes/:idRename
DELETE/api/nodes/:idDelete (rejected if tasks are still attached)
GET/api/nodes/:id/fs/listBrowse a directory (remote nodes use an async RPC via Agent)

Agent Protocol (X-Agent-Token)

Dedicated endpoints for the Agent CLI. Authenticated via the X-Agent-Token header instead of JWT.

MethodEndpointDescription
POST/api/agent/heartbeatReport liveness; returns the node ID
POST/api/agent/commands/pollClaim one pending command
POST/api/agent/commands/:id/resultReport command result
GET/api/agent/tasks/:idFetch task spec with decrypted storage configs
POST/api/agent/records/:idAppend logs / update record status

Notifications

MethodEndpointDescription
GET/api/notificationsList
POST/api/notificationsCreate
GET/api/notifications/:idDetail
PUT/api/notifications/:idUpdate
DELETE/api/notifications/:idDelete
POST/api/notifications/testTest with pending config
POST/api/notifications/:id/testRe-test a saved notifier

Dashboard

MethodEndpointDescription
GET/api/dashboard/statsOverview statistics
GET/api/dashboard/timelineRecent activity timeline

Audit / System / Settings

MethodEndpointDescription
GET/api/audit-logsAudit log list
GET/api/system/infoSystem information
GET/api/system/update-checkCheck for a newer release
GET/api/settingsSystem-level settings
PUT/api/settingsUpdate system settings

Response Envelope

All successful responses follow the shape:

{
"code": "OK",
"message": "",
"data": { /* actual payload */ }
}

Errors return an HTTP 4xx/5xx plus:

{
"code": "BACKUP_TASK_NOT_FOUND",
"message": "备份任务不存在",
"data": null
}