# Databases endpoints (Client API: web hosting)

> 11 FeatherPanel Client API: web hosting endpoints from user/webspaces/databases.php: methods, paths, auth, permissions, rate limits, parameters and responses.

Source: https://featherpanel.com/docs/api/reference/user/webspaces/databases/

Defined in [`backend/app/routes/user/webspaces/databases.php`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/user/webspaces/databases.php). Authentication used here: **Signed-in user**. 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/user/webspaces/{uuidShort}/databases`

- Auth: Signed-in user
- Default rate limit: 30 / minute (`user-webspaces`)
- Route name: `user-webspaces-databases`
- Controller: [`WebSpaceDatabaseController::index`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/User/WebSpaces/WebSpaceDatabaseController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/user/webspaces/databases.php#L26)

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `uuidShort` | path | \- | yes |  |

```bash
curl -X GET "$PANEL_URL/api/user/webspaces/$UUID_SHORT/databases" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json"
```

### GET `/api/user/webspaces/{uuidShort}/databases/hosts`

- Auth: Signed-in user
- Default rate limit: 30 / minute (`user-webspaces`)
- Route name: `user-webspaces-databases-hosts`
- Controller: [`WebSpaceDatabaseController::hosts`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/User/WebSpaces/WebSpaceDatabaseController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/user/webspaces/databases.php#L43)

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `uuidShort` | path | \- | yes |  |

```bash
curl -X GET "$PANEL_URL/api/user/webspaces/$UUID_SHORT/databases/hosts" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json"
```

### POST `/api/user/webspaces/{uuidShort}/databases`

- Auth: Signed-in user
- Default rate limit: 10 / minute (`user-webspaces`)
- Route name: `user-webspaces-databases-create`
- Controller: [`WebSpaceDatabaseController::create`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/User/WebSpaces/WebSpaceDatabaseController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/user/webspaces/databases.php#L60)

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `uuidShort` | path | \- | yes |  |

```bash
curl -X POST "$PANEL_URL/api/user/webspaces/$UUID_SHORT/databases" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json"
```

Plugin events: [`featherpanel:webspace:database:create`](https://featherpanel.com/docs/plugins/events/web-space/#web-space-database-created)

### DELETE `/api/user/webspaces/{uuidShort}/databases/{databaseId}`

- Auth: Signed-in user
- Default rate limit: 10 / minute (`user-webspaces`)
- Route name: `user-webspaces-databases-delete`
- Controller: [`WebSpaceDatabaseController::delete`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/User/WebSpaces/WebSpaceDatabaseController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/user/webspaces/databases.php#L77)

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `uuidShort` | path | \- | yes |  |
| `databaseId` | path | \- | yes |  |

```bash
curl -X DELETE "$PANEL_URL/api/user/webspaces/$UUID_SHORT/databases/$DATABASE_ID" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json"
```

Plugin events: [`featherpanel:webspace:database:delete`](https://featherpanel.com/docs/plugins/events/web-space/#web-space-database-deleted)

### POST `/api/user/webspaces/{uuidShort}/databases/{databaseId}/reset-password`

- Auth: Signed-in user
- Default rate limit: 10 / minute (`user-webspaces`)
- Route name: `user-webspaces-databases-reset-password`
- Controller: [`WebSpaceDatabaseController::resetPassword`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/User/WebSpaces/WebSpaceDatabaseController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/user/webspaces/databases.php#L95)

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `uuidShort` | path | \- | yes |  |
| `databaseId` | path | \- | yes |  |

```bash
curl -X POST "$PANEL_URL/api/user/webspaces/$UUID_SHORT/databases/$DATABASE_ID/reset-password" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json"
```

### POST `/api/user/webspaces/{uuidShort}/databases/{databaseId}/dump`

- Auth: Signed-in user
- Default rate limit: 5 / minute (`user-webspaces`)
- Route name: `user-webspaces-databases-dump`
- Controller: [`WebSpaceDatabaseController::dump`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/User/WebSpaces/WebSpaceDatabaseController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/user/webspaces/databases.php#L113)

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `uuidShort` | path | \- | yes |  |
| `databaseId` | path | \- | yes |  |

```bash
curl -X POST "$PANEL_URL/api/user/webspaces/$UUID_SHORT/databases/$DATABASE_ID/dump" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json"
```

### POST `/api/user/webspaces/{uuidShort}/databases/{databaseId}/restore`

- Auth: Signed-in user
- Default rate limit: 5 / minute (`user-webspaces`)
- Route name: `user-webspaces-databases-restore`
- Controller: [`WebSpaceDatabaseController::restoreDump`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/User/WebSpaces/WebSpaceDatabaseController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/user/webspaces/databases.php#L131)

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `uuidShort` | path | \- | yes |  |
| `databaseId` | path | \- | yes |  |

```bash
curl -X POST "$PANEL_URL/api/user/webspaces/$UUID_SHORT/databases/$DATABASE_ID/restore" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json"
```

### GET `/api/user/webspaces/{uuidShort}/databases/phpmyadmin/check`

- Auth: Signed-in user
- Default rate limit: 30 / minute (`user-webspaces`)
- Route name: `user-webspaces-databases-phpmyadmin-check`
- Controller: [`WebSpaceDatabaseController::checkPhpMyAdminInstalled`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/User/WebSpaces/WebSpaceDatabaseController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/user/webspaces/databases.php#L149)

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `uuidShort` | path | \- | yes |  |

```bash
curl -X GET "$PANEL_URL/api/user/webspaces/$UUID_SHORT/databases/phpmyadmin/check" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json"
```

### POST `/api/user/webspaces/{uuidShort}/databases/{databaseId}/phpmyadmin/token`

- Auth: Signed-in user
- Default rate limit: 10 / minute (`user-webspaces`)
- Route name: `user-webspaces-databases-phpmyadmin-token`
- Controller: [`WebSpaceDatabaseController::generatePhpMyAdminToken`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/User/WebSpaces/WebSpaceDatabaseController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/user/webspaces/databases.php#L166)

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `uuidShort` | path | \- | yes |  |
| `databaseId` | path | \- | yes |  |

```bash
curl -X POST "$PANEL_URL/api/user/webspaces/$UUID_SHORT/databases/$DATABASE_ID/phpmyadmin/token" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json"
```

### GET `/api/user/webspaces/{uuidShort}/databases/phppgadmin/check`

- Auth: Signed-in user
- Default rate limit: 30 / minute (`user-webspaces`)
- Route name: `user-webspaces-databases-phppgadmin-check`
- Controller: [`WebSpaceDatabaseController::checkPhpPgAdminInstalled`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/User/WebSpaces/WebSpaceDatabaseController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/user/webspaces/databases.php#L184)

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `uuidShort` | path | \- | yes |  |

```bash
curl -X GET "$PANEL_URL/api/user/webspaces/$UUID_SHORT/databases/phppgadmin/check" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json"
```

### POST `/api/user/webspaces/{uuidShort}/databases/{databaseId}/phppgadmin/token`

- Auth: Signed-in user
- Default rate limit: 10 / minute (`user-webspaces`)
- Route name: `user-webspaces-databases-phppgadmin-token`
- Controller: [`WebSpaceDatabaseController::generatePhpPgAdminToken`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/User/WebSpaces/WebSpaceDatabaseController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/user/webspaces/databases.php#L201)

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `uuidShort` | path | \- | yes |  |
| `databaseId` | path | \- | yes |  |

```bash
curl -X POST "$PANEL_URL/api/user/webspaces/$UUID_SHORT/databases/$DATABASE_ID/phppgadmin/token" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json"
```
