Skip to main content

Backup API

Create, restore, and manage database backups.

Base path: /api/v1/backup

Authentication required

All backup endpoints require an authenticated user when auth is enabled.


Create Backup

POST /api/v1/backup

Creates a backup of the current database.

Response

Status: 200 OK

{
"database": "default",
"filename": "app_20260413_142530.db",
"size": 5242880,
"created_at": "2026-04-13T14:25:30.000000"
}

curl Example

curl -s -X POST http://localhost:8080/api/v1/backup

List Backups

GET /api/v1/backup

Lists all available backups for the current database.

Response

Status: 200 OK

{
"backups": [
{
"filename": "app_20260413_142530.db",
"size": 5242880,
"created_at": "2026-04-13T14:25:30.000000"
}
]
}

curl Example

curl -s http://localhost:8080/api/v1/backup

Restore Backup

POST /api/v1/backup/{filename}/restore

Restores the current database from a backup file.

Path Parameters

ParameterTypeRequiredDescription
filenamestringYesBackup filename (format: app_YYYYMMDD_HHMMSS.db)

Response

Status: 200 OK

{
"database": "default",
"restored_from": "app_20260413_142530.db"
}

curl Example

curl -s -X POST http://localhost:8080/api/v1/backup/app_20260413_142530.db/restore

Download Backup

GET /api/v1/backup/{filename}/download

Downloads a backup file as a binary SQLite database.

Path Parameters

ParameterTypeRequiredDescription
filenamestringYesBackup filename

Response

Status: 200 OK Content-Type: application/x-sqlite3

Binary file download.

curl Example

curl -s http://localhost:8080/api/v1/backup/app_20260413_142530.db/download -o backup.db

Delete Backup

DELETE /api/v1/backup/{filename}

Deletes a specific backup file.

Path Parameters

ParameterTypeRequiredDescription
filenamestringYesBackup filename

Response

Status: 200 OK

{
"status": "deleted"
}

curl Example

curl -s -X DELETE http://localhost:8080/api/v1/backup/app_20260413_142530.db

Response Models Reference

BackupResponse

FieldTypeDescription
databasestringDatabase name
filenamestringBackup filename
sizeintegerFile size in bytes
created_atstringCreation timestamp

BackupListResponse

FieldTypeDescription
backupsBackupSummaryResponse[]List of available backups

RestoreResponse

FieldTypeDescription
databasestringDatabase name
restored_fromstringBackup filename that was restored