View .md

Database Snapshots endpoints (Admin API)

7 FeatherPanel Admin API endpoints from admin/database-snapshots.php: methods, paths, auth, permissions, rate limits, parameters and responses.

Last synced from FeatherPanel 15b94e9 on .

On this page

Defined in backend/app/routes/admin/database-snapshots.php. Authentication used here: Admin. Read Authentication for how to send credentials and Rate limits and errors for the response envelope.

Paths, methods, permissions and rate limits come from the route file. Summaries, parameters and response codes come from the OpenAPI annotations on the controllers; endpoints without annotations show only what the route file declares.

Endpoints

GET/api/admin/database-snapshots

Auth: AdminPermission: admin.backups.viewRoute name: admin-database-snapshots-listController: DatabaseSnapshotsController::indexroute source

List all database snapshots Retrieve a list of all available database snapshots with metadata.

Response data fieldTypeDescription
snapshotsobject[]
curl -X GET "$PANEL_URL/api/admin/database-snapshots" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json"

Responses: 200 Snapshots retrieved successfully · 401 Unauthorized · 403 Forbidden - Insufficient permissions

POST/api/admin/database-snapshots

Auth: AdminPermission: admin.backups.createRoute name: admin-database-snapshots-createController: DatabaseSnapshotsController::createroute source

Create a new database snapshot Create a complete SQL dump of the entire database and save it as a FeatherPanel Backup (.fpb) file.

Body fieldTypeRequiredDescription
passwordstringyesCurrent user password for security verification
Response data fieldTypeDescription
filenamestring
sizeintegerFile size in bytes
size_formattedstring
curl -X POST "$PANEL_URL/api/admin/database-snapshots" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{"password":""}'

Plugin events: featherpanel:database:snapshot:created

Responses: 200 Snapshot created successfully · 400 Bad request - Missing password · 401 Unauthorized - Invalid password or not authenticated · 403 Forbidden - Insufficient permissions or developer mode not enabled · 500 Internal server error - Failed to create snapshot

GET/api/admin/database-snapshots/{filename}/download

Auth: AdminPermission: admin.backups.downloadRoute name: admin-database-snapshots-downloadController: DatabaseSnapshotsController::downloadroute source

Download a database snapshot Download a specific database snapshot file. Password verification required.

ParameterInTypeRequiredDescription
filenamepathstringyesThe filename of the snapshot to download
passwordquerystringyesCurrent user password for security verification
curl -X GET "$PANEL_URL/api/admin/database-snapshots/$FILENAME/download?password=$PASSWORD" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json"

Plugin events: featherpanel:database:snapshot:downloaded

Responses: 200 Snapshot file downloaded · 400 Bad request - Missing password or invalid snapshot · 401 Unauthorized - Invalid password or not authenticated · 403 Forbidden - Insufficient permissions or developer mode not enabled · 404 Snapshot not found

POST/api/admin/database-snapshots/{filename}/restore

Auth: AdminPermission: admin.backups.restoreRoute name: admin-database-snapshots-restoreController: DatabaseSnapshotsController::restoreroute source

Restore database from snapshot Wipe the current database and restore it from a snapshot file. WARNING: This will delete all current data!

ParameterInTypeRequiredDescription
filenamepathstringyesThe filename of the snapshot to restore
Body fieldTypeRequiredDescription
confirmbooleanyesMust be true to confirm restoration
passwordstringyesCurrent user password for security verification
Response data fieldTypeDescription
messagestring
curl -X POST "$PANEL_URL/api/admin/database-snapshots/$FILENAME/restore" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{"confirm":false,"password":""}'

Plugin events: featherpanel:database:snapshot:restored

Responses: 200 Database restored successfully · 400 Bad request - Missing confirmation, password, or invalid snapshot · 401 Unauthorized - Invalid password or not authenticated · 403 Forbidden - Insufficient permissions or developer mode not enabled · 404 Snapshot not found · 500 Internal server error - Failed to restore database

POST/api/admin/database-snapshots/restore-upload

Auth: AdminPermission: admin.backups.restoreRoute name: admin-database-snapshots-restore-uploadController: DatabaseSnapshotsController::restoreUploadroute source

Restore database from uploaded snapshot file Upload and restore a FeatherPanel Backup (.fpb) file. WARNING: This will wipe all tables and delete all current data!

Body fieldTypeRequiredDescription
filestring (binary)yesFeatherPanel Backup (.fpb) file to restore
confirmbooleanyesMust be true to confirm restoration
passwordstringyesCurrent user password for security verification
Response data fieldTypeDescription
messagestring
curl -X POST "$PANEL_URL/api/admin/database-snapshots/restore-upload" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json" \
  -F "file=@./file" \
  -F "confirm=" \
  -F "password="

Responses: 200 Database restored successfully · 400 Bad request - Missing confirmation, password, or invalid file · 401 Unauthorized - Invalid password or not authenticated · 403 Forbidden - Insufficient permissions or developer mode not enabled · 500 Internal server error - Failed to restore database

DELETE/api/admin/database-snapshots/{filename}

Auth: AdminPermission: admin.backups.deleteRoute name: admin-database-snapshots-deleteController: DatabaseSnapshotsController::deleteroute source

Delete a database snapshot Delete a specific database snapshot file.

ParameterInTypeRequiredDescription
filenamepathstringyesThe filename of the snapshot to delete
Body fieldTypeRequiredDescription
passwordstringyesCurrent user password for security verification
Response data fieldTypeDescription
messagestring
curl -X DELETE "$PANEL_URL/api/admin/database-snapshots/$FILENAME" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{"password":""}'

Plugin events: featherpanel:database:snapshot:deleted

Responses: 200 Snapshot deleted successfully · 400 Bad request - Missing password or invalid snapshot · 401 Unauthorized - Invalid password or not authenticated · 403 Forbidden - Insufficient permissions or developer mode not enabled · 404 Snapshot not found · 500 Internal server error - Failed to delete snapshot

POST/api/admin/database-snapshots/fresh-restore

Auth: AdminPermission: admin.backups.restoreRoute name: admin-database-snapshots-fresh-restoreController: DatabaseSnapshotsController::freshRestoreroute source

Restore database to fresh state Wipe the entire database clean, run migrations, and recreate the current user with the same session token. WARNING: This will delete ALL data including users, servers, and all other records!

Body fieldTypeRequiredDescription
confirmbooleanyesMust be true to confirm fresh restore
passwordstringyesCurrent user password for security verification
Response data fieldTypeDescription
messagestring
curl -X POST "$PANEL_URL/api/admin/database-snapshots/fresh-restore" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{"confirm":false,"password":""}'

Responses: 200 Database restored to fresh state successfully · 400 Bad request - Missing confirmation or password · 401 Unauthorized - Invalid password or not authenticated · 403 Forbidden - Insufficient permissions or developer mode not enabled · 500 Internal server error - Failed to restore database