API Documentation
Integrate and automate your backup workflows with our straightforward REST API.
General Information
Base URL: All API endpoints are relative to the application's host and port (e.g., http://localhost:5000).
Content-Type: All POST and PUT requests with a body must have a Content-Type of application/json, unless otherwise specified (e.g., file uploads).
Responses: All responses are in JSON format, unless a file download is indicated.
State & Overview
Get Full Application State
Fetches an aggregate snapshot of volumes, backups, schedules, sync status, settings, logs, and overview.
GET/api/state
Success Response (200 OK):
... JSON Response ...Get Storage Prediction
Returns current total backup size and predicted size over 30 days based on active schedules.
GET/api/storage_prediction
Success Response (200 OK):
{"current_size_bytes": 123456789,"predicted_size_bytes_30d": 234567890}Backups & Restore
Start Backup
Starts a backup for a volume as an async task.
POST/api/backup
Request Body:
{"volume": "my_volume_name","upload_to_ftp": true // Optional}Success Response (200 OK):
{"message": "Backup started...","task_id": "unique-task-id"}Restore Backup
Restores a volume from a backup file as an async task.
POST/api/restore
Request Body:
{"volume": "target_volume","backup_path": "/backups/source/file.tar.gz"}Success Response (200 OK):
{"message": "Restore started...","task_id": "unique-task-id"}Upload Backup
Uploads a .tar.gz backup file to a volume's backup directory.
POST/api/upload_backup
Request Body (multipart/form-data):
volume: (string) The target volume name.backup_file: (file) The .tar.gz file.
Success Response (200 OK):
{"message": "Upload successful."}Prune Backups
Deletes backups for a volume older than the specified retention window.
POST/api/prune_extended
Request Body:
{"volume": "my_volume_name","days": 30,"hours": 0,"minutes": 0}Success Response (200 OK):
{"deleted_count": 5}Download Backup
Downloads a .tar.gz backup file as an attachment.
GET/api/backups/download?path=<file_path>
Success Response (200 OK):
The raw file contents with Content-Disposition: attachment.
Delete Backup
Deletes a single backup file.
DELETE/api/backups/<volume_name>/<filename.tar.gz>
Success Response (200 OK):
{"message": "Backup deleted"}Schedules
Add Schedule
Adds or overwrites a backup schedule for a volume.
POST/api/schedules
Request Body:
{"volume": "my_volume_name","interval_days": 1,// ... other optional interval/prune/notification fields}Success Response (200 OK):
{"message": "Schedule added"}Update Schedule
Updates an existing schedule for the given volume.
PUT/api/schedules/<volume>
Request Body:
Same as Add Schedule, excluding `volume`.
Success Response (200 OK):
{"message": "Schedule updated"}Remove Schedule
Removes a schedule and its job.
DELETE/api/schedules/<volume>
Success Response (200 OK):
{"message": "Schedule removed"}Toggle Schedule
Pauses or resumes a schedule.
POST/api/schedules/toggle
Request Body:
{"volume": "my_volume_name", "enabled": false}Success Response (200 OK):
{"message": "Schedule for my_volume_name updated"}Settings & Logs
Start FTP Sync Now
Starts a full FTP sync as an async task.
POST/api/sync_now
Success Response (200 OK):
{"message": "FTP sync started.","task_id": "unique-task-id"}Save FTP Settings
Saves FTP settings and reschedules the periodic sync job.
POST/api/settings/ftp
Request Body:
{"host": "ftp.example.com",// ... all FTP fields}Success Response (200 OK):
{"message": "FTP settings saved"}Save Notification Settings
Saves ntfy.sh notification settings.
POST/api/settings/notifications
Request Body:
{"base_url": "https://ntfy.sh", "topic": "my-backups"}Success Response (200 OK):
{"message": "Notification settings saved"}Save Log Settings
Saves in-memory log line cap and UI timezone preference.
POST/api/settings/logs
Request Body:
{"max_lines": 500, "timezone": "Europe/Berlin"}Success Response (200 OK):
{"message": "Log settings saved"}Get Backup Logs
Retrieves log lines associated with a specific backup file.
GET/api/backups/logs?path=<file_path>
Success Response (200 OK):
["[2025-08-30T00:19:00Z] log line...", ...]Download Logs
Downloads current in-memory logs as a text file.
GET/api/logs/download
Success Response (200 OK):
The raw text content with Content-Disposition: attachment.
Async Tasks
Get Task Status
Returns the status of an async task (backup, restore, sync).
GET/api/task_status/<task_id>
Success Response (200 OK):
// While running:{"status": "running", "message": "..."}// On completion (success or failure):{"status": "success", "message": "..."}