# Database Snapshots endpoints (Admin API)

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

Source: https://featherpanel.com/docs/api/reference/admin/database-snapshots/

Defined in [`backend/app/routes/admin/database-snapshots.php`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/admin/database-snapshots.php). Authentication used here: **Admin**. Read [Authentication](https://featherpanel.com/docs/api/authentication/) for how to send credentials and [Rate limits and errors](https://featherpanel.com/docs/api/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: Admin
- Permission: `admin.backups.view`
- Route name: `admin-database-snapshots-list`
- Controller: [`DatabaseSnapshotsController::index`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/Admin/DatabaseSnapshotsController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/admin/database-snapshots.php#L25)

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

| Response `data` field | Type | Description |
| --- | --- | --- |
| `snapshots` | object\[\] |  |

```bash
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: Admin
- Permission: `admin.backups.create`
- Route name: `admin-database-snapshots-create`
- Controller: [`DatabaseSnapshotsController::create`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/Admin/DatabaseSnapshotsController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/admin/database-snapshots.php#L35)

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

| Body field | Type | Required | Description |
| --- | --- | --- | --- |
| `password` | string | yes | Current user password for security verification |

| Response `data` field | Type | Description |
| --- | --- | --- |
| `filename` | string |  |
| `size` | integer | File size in bytes |
| `size_formatted` | string |  |

```bash
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`](https://featherpanel.com/docs/plugins/events/database-snapshots/#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: Admin
- Permission: `admin.backups.download`
- Route name: `admin-database-snapshots-download`
- Controller: [`DatabaseSnapshotsController::download`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/Admin/DatabaseSnapshotsController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/admin/database-snapshots.php#L46)

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

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `filename` | path | string | yes | The filename of the snapshot to download |
| `password` | query | string | yes | Current user password for security verification |

```bash
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`](https://featherpanel.com/docs/plugins/events/database-snapshots/#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: Admin
- Permission: `admin.backups.restore`
- Route name: `admin-database-snapshots-restore`
- Controller: [`DatabaseSnapshotsController::restore`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/Admin/DatabaseSnapshotsController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/admin/database-snapshots.php#L61)

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

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `filename` | path | string | yes | The filename of the snapshot to restore |

| Body field | Type | Required | Description |
| --- | --- | --- | --- |
| `confirm` | boolean | yes | Must be true to confirm restoration |
| `password` | string | yes | Current user password for security verification |

| Response `data` field | Type | Description |
| --- | --- | --- |
| `message` | string |  |

```bash
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`](https://featherpanel.com/docs/plugins/events/database-snapshots/#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: Admin
- Permission: `admin.backups.restore`
- Route name: `admin-database-snapshots-restore-upload`
- Controller: [`DatabaseSnapshotsController::restoreUpload`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/Admin/DatabaseSnapshotsController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/admin/database-snapshots.php#L77)

**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 field | Type | Required | Description |
| --- | --- | --- | --- |
| `file` | string (binary) | yes | FeatherPanel Backup (.fpb) file to restore |
| `confirm` | boolean | yes | Must be true to confirm restoration |
| `password` | string | yes | Current user password for security verification |

| Response `data` field | Type | Description |
| --- | --- | --- |
| `message` | string |  |

```bash
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: Admin
- Permission: `admin.backups.delete`
- Route name: `admin-database-snapshots-delete`
- Controller: [`DatabaseSnapshotsController::delete`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/Admin/DatabaseSnapshotsController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/admin/database-snapshots.php#L88)

**Delete a database snapshot** Delete a specific database snapshot file.

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `filename` | path | string | yes | The filename of the snapshot to delete |

| Body field | Type | Required | Description |
| --- | --- | --- | --- |
| `password` | string | yes | Current user password for security verification |

| Response `data` field | Type | Description |
| --- | --- | --- |
| `message` | string |  |

```bash
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`](https://featherpanel.com/docs/plugins/events/database-snapshots/#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: Admin
- Permission: `admin.backups.restore`
- Route name: `admin-database-snapshots-fresh-restore`
- Controller: [`DatabaseSnapshotsController::freshRestore`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/Admin/DatabaseSnapshotsController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/admin/database-snapshots.php#L104)

**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 field | Type | Required | Description |
| --- | --- | --- | --- |
| `confirm` | boolean | yes | Must be true to confirm fresh restore |
| `password` | string | yes | Current user password for security verification |

| Response `data` field | Type | Description |
| --- | --- | --- |
| `message` | string |  |

```bash
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
