Databases endpoints (Client API: game servers)
13 FeatherPanel Client API: game servers endpoints from user/server/databases.php: methods, paths, auth, permissions, rate limits, parameters and responses.
Last synced from FeatherPanel 15b94e9 on .
On this page
Defined in backend/app/routes/user/server/databases.php. Authentication used here: Server access. 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/user/servers/{uuidShort}/databases
Get server databases Retrieve all databases for a specific server that the user owns or has subuser access to, with pagination and search functionality.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
uuidShort | path | string | yes | Server short UUID |
page | query | integer | no | Page number for pagination |
per_page | query | integer | no | Number of records per page |
search | query | string | no | Search term to filter databases by name, username, or host |
Response data field | Type | Description |
|---|---|---|
data | ServerDatabase[] | |
pagination | DatabasePagination |
curl -X GET "$PANEL_URL/api/user/servers/$UUID_SHORT/databases" \
-H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
-H "Accept: application/json"Responses: 200 Server databases retrieved successfully · 400 Bad request - Missing or invalid UUID short · 401 Unauthorized - User not authenticated · 403 Forbidden - Access denied to server · 404 Not found - Server not found · 500 Internal server error - Failed to retrieve databases
POST/api/user/servers/{uuidShort}/databases
Create database Create a new database for a server. Checks database limits and creates database on the specified host.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
uuidShort | path | string | yes | Server short UUID |
Request body: DatabaseCreateRequest (application/json) · Response data: DatabaseCreateResponse
| Body field | Type | Required | Description |
|---|---|---|---|
database_host_id | integer | yes | Database host ID |
database_name | string | yes | Database name (without server prefix) |
remote | string | no | Remote access pattern |
max_connections | integer | no | Maximum connections |
Response data field | Type | Description |
|---|---|---|
id | integer | Created database ID |
database_name | string | Generated database name |
username | string | Generated username |
password | string | Generated password |
message | string | Success message |
curl -X POST "$PANEL_URL/api/user/servers/$UUID_SHORT/databases" \
-H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"database_host_id":0,"database_name":"","remote":"","max_connections":0}'Plugin events: featherpanel:user:server:database:created
Responses: 200 Database created successfully · 400 Bad request - Missing UUID, database limit reached, or invalid request body · 401 Unauthorized - User not authenticated · 403 Forbidden - Access denied to server · 404 Not found - Server or database host not found · 500 Internal server error - Failed to create database
DELETE/api/user/servers/{uuidShort}/databases/bulk-delete
Bulk delete server databases Delete multiple databases at once. Pass an array of database IDs, or set all=true to delete every database for the server.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
uuidShort | path | string | yes | Server short UUID |
| Body field | Type | Required | Description |
|---|---|---|---|
ids | integer[] | no | Database IDs to delete |
all | boolean | no | When true, delete all databases for the server |
Response data field | Type | Description |
|---|---|---|
deleted_count | integer | |
failed_count | integer | |
failed | object[] |
curl -X DELETE "$PANEL_URL/api/user/servers/$UUID_SHORT/databases/bulk-delete" \
-H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"ids":[],"all":false}'Plugin events: featherpanel:user:server:database:deleted
Responses: 200 Bulk delete completed · 400 Bad request - Invalid or missing parameters · 401 Unauthorized - User not authenticated · 403 Forbidden - Access denied to server · 404 Not found - Server or node not found · 500 Internal server error
GET/api/user/servers/{uuidShort}/databases/hosts
Get available database hosts Retrieve all available database hosts that can be used for creating databases.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
uuidShort | path | string | yes | Server short UUID |
curl -X GET "$PANEL_URL/api/user/servers/$UUID_SHORT/databases/hosts" \
-H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
-H "Accept: application/json"Responses: 200 Database hosts retrieved successfully · 400 Bad request - Missing or invalid UUID short · 401 Unauthorized - User not authenticated · 403 Forbidden - Access denied to server · 404 Not found - Server not found · 500 Internal server error - Failed to retrieve database hosts
GET/api/user/servers/{uuidShort}/databases/{databaseId}
Get specific database Retrieve details of a specific database for a server that the user owns or has subuser access to.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
uuidShort | path | string | yes | Server short UUID |
databaseId | path | integer | yes | Database ID |
Response data: ServerDatabase
Response data field | Type | Description |
|---|---|---|
id | integer | Database ID |
server_id | integer | Server ID |
database_host_id | integer | Database host ID |
database | string | Database name |
username | string | Database username |
password | string | Database password |
remote | string | Remote access pattern |
max_connections | integer | Maximum connections |
database_host_name | string | Database host name |
database_host | string | Database host address |
database_port | integer | Database host port |
database_type | string | Database type |
created_at | string (date-time) | Creation timestamp |
updated_at | string (date-time) | Last update timestamp |
curl -X GET "$PANEL_URL/api/user/servers/$UUID_SHORT/databases/$DATABASE_ID" \
-H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
-H "Accept: application/json"Responses: 200 Database details retrieved successfully · 400 Bad request - Missing or invalid parameters · 401 Unauthorized - User not authenticated · 403 Forbidden - Access denied to server · 404 Not found - Server or database not found · 500 Internal server error - Failed to retrieve database
PATCH/api/user/servers/{uuidShort}/databases/{databaseId}
Update database Update database settings including remote access pattern and maximum connections.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
uuidShort | path | string | yes | Server short UUID |
databaseId | path | integer | yes | Database ID |
Request body: DatabaseUpdateRequest (application/json)
| Body field | Type | Required | Description |
|---|---|---|---|
remote | string | no | Remote access pattern |
max_connections | integer | no | Maximum connections |
Response data field | Type | Description |
|---|---|---|
message | string | Success message |
curl -X PATCH "$PANEL_URL/api/user/servers/$UUID_SHORT/databases/$DATABASE_ID" \
-H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"remote":"","max_connections":0}'Plugin events: featherpanel:user:server:database:updated
Responses: 200 Database updated successfully · 400 Bad request - Missing parameters or invalid request body · 401 Unauthorized - User not authenticated · 403 Forbidden - Access denied to server · 404 Not found - Server or database not found · 500 Internal server error - Failed to update database
DELETE/api/user/servers/{uuidShort}/databases/{databaseId}
Delete database Permanently delete a database from a server. This action cannot be undone.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
uuidShort | path | string | yes | Server short UUID |
databaseId | path | integer | yes | Database ID |
Response data field | Type | Description |
|---|---|---|
message | string | Success message |
curl -X DELETE "$PANEL_URL/api/user/servers/$UUID_SHORT/databases/$DATABASE_ID" \
-H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
-H "Accept: application/json"Plugin events: featherpanel:user:server:database:deleted
Responses: 200 Database deleted successfully · 400 Bad request - Missing parameters · 401 Unauthorized - User not authenticated · 403 Forbidden - Access denied to server · 404 Not found - Server, database, or database host not found · 500 Internal server error - Failed to delete database
POST/api/user/servers/{uuidShort}/databases/hosts/{databaseHostId}/test
Test database host connection Test the connection to a specific database host to verify connectivity and performance.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
uuidShort | path | string | yes | Server short UUID |
databaseHostId | path | integer | yes | Database host ID to test |
Response data: ConnectionTestResponse
Response data field | Type | Description |
|---|---|---|
database_host_id | integer | Database host ID |
healthy | boolean | Connection health status |
message | string | Connection test message |
response_time | number | Response time in milliseconds |
curl -X POST "$PANEL_URL/api/user/servers/$UUID_SHORT/databases/hosts/$DATABASE_HOST_ID/test" \
-H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
-H "Accept: application/json"Responses: 200 Connection test completed · 400 Bad request - Missing or invalid parameters · 401 Unauthorized - User not authenticated · 404 Not found - Server or database host not found · 500 Internal server error - Failed to test connection
GET/api/user/servers/{uuidShort}/databases/{databaseId}/export
Export database as SQL dump Generate a SQL dump of the database including CREATE TABLE statements and INSERT data. Requires database.view_password permission. Only supported for MySQL/MariaDB databases.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
uuidShort | path | string | yes | Server short UUID |
databaseId | path | integer | yes | Database ID |
Response data field | Type | Description |
|---|---|---|
sql | string | SQL dump content |
filename | string | Suggested filename |
table_count | integer | Number of tables exported |
exported_at | string | Export timestamp |
curl -X GET "$PANEL_URL/api/user/servers/$UUID_SHORT/databases/$DATABASE_ID/export" \
-H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
-H "Accept: application/json"Responses: 200 SQL dump generated successfully · 400 Bad request - Unsupported database type · 401 Unauthorized · 403 Forbidden - Requires database.view_password permission · 404 Server or database not found · 500 Internal server error - Failed to generate dump
POST/api/user/servers/{uuidShort}/databases/{databaseId}/import
Import SQL dump into database Execute a SQL dump against the database. Requires database.view_password permission. Statements are executed sequentially; execution stops on the first error by default.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
uuidShort | path | string | yes | Server short UUID |
databaseId | path | integer | yes | Database ID |
| Body field | Type | Required | Description |
|---|---|---|---|
sql | string | no | SQL content to import |
ignore_errors | boolean | no | Continue on errors (default: false) |
Response data field | Type | Description |
|---|---|---|
executed_statements | integer | Number of statements executed |
errors | string[] | List of errors encountered |
success | boolean | Whether all statements succeeded |
curl -X POST "$PANEL_URL/api/user/servers/$UUID_SHORT/databases/$DATABASE_ID/import" \
-H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"sql":"","ignore_errors":false}'Responses: 200 SQL import completed · 400 Bad request - Missing SQL or unsupported database type · 401 Unauthorized · 403 Forbidden - Requires database.view_password permission · 404 Server or database not found · 500 Internal server error
POST/api/user/servers/{uuidShort}/databases/{databaseId}/query
Run a SQL query Execute a SQL query against the database and return results. Requires database.view_password permission. SELECT queries return rows (max 500); DML queries return affected row count.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
uuidShort | path | string | yes | Server short UUID |
databaseId | path | integer | yes | Database ID |
| Body field | Type | Required | Description |
|---|---|---|---|
query | string | no | SQL query to execute |
Response data field | Type | Description |
|---|---|---|
type | string | Query type |
columns | string[] | Column names (for SELECT) |
rows | mixed[][] | Result rows as arrays (for SELECT) |
row_count | integer | Number of rows returned (for SELECT) |
affected_rows | integer | Number of rows affected (for DML) |
truncated | boolean | Whether the result was truncated to 500 rows |
execution_time_ms | number | Query execution time in milliseconds |
curl -X POST "$PANEL_URL/api/user/servers/$UUID_SHORT/databases/$DATABASE_ID/query" \
-H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"query":""}'Responses: 200 Query executed successfully · 400 Bad request - Missing or empty query · 401 Unauthorized · 403 Forbidden - Requires database.view_password permission · 404 Server or database not found · 422 Query execution error · 500 Internal server error
GET/api/user/servers/{uuidShort}/databases/phpmyadmin/check
Check phpMyAdmin installation Check if phpMyAdmin module is installed and available.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
uuidShort | path | string | yes | Server short UUID |
Response data field | Type | Description |
|---|---|---|
installed | boolean | Whether phpMyAdmin is installed |
curl -X GET "$PANEL_URL/api/user/servers/$UUID_SHORT/databases/phpmyadmin/check" \
-H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
-H "Accept: application/json"Responses: 200 phpMyAdmin installation status
POST/api/user/servers/{uuidShort}/databases/{databaseId}/phpmyadmin/token
Generate phpMyAdmin signon token Mint a single-use phpMyAdmin signon token (credentials stay server-side; URL carries only the opaque token).
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
uuidShort | path | string | yes | Server short UUID |
databaseId | path | integer | yes | Database ID |
Response data field | Type | Description |
|---|---|---|
url | string | phpMyAdmin URL with single-use token query param only |
curl -X POST "$PANEL_URL/api/user/servers/$UUID_SHORT/databases/$DATABASE_ID/phpmyadmin/token" \
-H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
-H "Accept: application/json"Responses: 200 Token generated successfully · 400 Bad request - Missing parameters · 401 Unauthorized - User not authenticated · 403 Forbidden - Access denied to server · 404 Not found - Server, database, or phpMyAdmin not found