Backup & Restore
Backup & Restore
Four cooperating groups. Auth: Authorization: Bearer wsp_…
Backups — GET /api/v1/backups/
Response 200 (verified live):
{ "success": true, "backups": [], "files": null,
"resellers": ["reseller"],
"server_ips": [ { "ip": "161.248.4.182",
"label": "161.248.4.182 - Shared - Server",
"type": "shared" } ] }
POST /api/v1/backups/ Request:
{ "items": ["domains", "databases", "email_accounts"],
"username": "john", "destination": "local" }
Response 400 (verified live — empty body):
{ "success": false, "code": "VALIDATION_ERROR",
"error": "At least one backup item is required",
"message": "…", "status": 400 }
GET /backups/:id · /:id/contents · /:id/progress ·
/:id/download; POST /backups/:id/restore; DELETE /backups/:id.
GET /api/v1/backup/items (valid items values, verified live):
{ "items": [
{ "id": "domains", "name": "Domains", "category": "web",
"description": "Website files and configurations" },
{ "id": "email_accounts", "name": "Email Accounts",
"category": "email" } ] }
Backup settings — GET /api/v1/backup/settings
Response 200 (verified live):
{ "success": true, "settings": {
"Compression": 2, "UserBackupDir": "backups",
"AdminBackupDir": "admin_backups", "NotifyEmail": "",
"RestoreLocalNS": true, "RestoreSPF": false,
"DefaultRetention": 7, "MaxConcurrentJobs": 2,
"BackupThreshold": 90 } }
PUT /backup/settings; DirectAdmin import
POST /backup/import-directadmin { "file": "/path/da.tar.gz", "username": "john" }; FTP profiles /backup/ftp-profiles/.
Restore — GET /api/v1/restore/options
Response 200 (verified live):
{ "defaults": { "restore_domains": true,
"overwrite_existing": false, "restore_databases": true,
"restore_db_users": true, "restore_email": true,
"restore_ftp": true, "restore_cron": true,
"restore_dns": true, "restore_ssl": true } }
POST /api/v1/restore/ { "backup_id": "…", "options": {…} };
GET /restore/jobs → { "jobs": null, "success": true };
/restore/jobs/:id; POST /restore/bulk.
Schedules — GET /api/v1/backup-schedules/
Response 200 (verified live): { "schedules": null, "success": true }.
POST /backup-schedules/ { "cron_expr": "0 3 * * *", "items": ["domains"] }; PUT | DELETE /backup-schedules/:id;
POST /backup-schedules/:id/run.
Conventions → Authentication, Error Handling.