View .md

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

Auth: Server accessDefault rate limit: 30 / minute (user-server-databases)Route name: session-server-databasesController: ServerDatabaseController::getServerDatabasesroute source

Get server databases Retrieve all databases for a specific server that the user owns or has subuser access to, with pagination and search functionality.

ParameterInTypeRequiredDescription
uuidShortpathstringyesServer short UUID
pagequeryintegernoPage number for pagination
per_pagequeryintegernoNumber of records per page
searchquerystringnoSearch term to filter databases by name, username, or host
Response data fieldTypeDescription
dataServerDatabase[]
paginationDatabasePagination
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

Auth: Server accessDefault rate limit: 5 / minute (user-server-databases)Route name: session-server-databases-createController: ServerDatabaseController::createServerDatabaseroute source

Create database Create a new database for a server. Checks database limits and creates database on the specified host.

ParameterInTypeRequiredDescription
uuidShortpathstringyesServer short UUID

Request body: DatabaseCreateRequest (application/json) · Response data: DatabaseCreateResponse

Body fieldTypeRequiredDescription
database_host_idintegeryesDatabase host ID
database_namestringyesDatabase name (without server prefix)
remotestringnoRemote access pattern
max_connectionsintegernoMaximum connections
Response data fieldTypeDescription
idintegerCreated database ID
database_namestringGenerated database name
usernamestringGenerated username
passwordstringGenerated password
messagestringSuccess 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

Auth: Server accessDefault rate limit: 5 / minute (user-server-databases)Route name: session-server-databases-bulk-deleteController: ServerDatabaseController::bulkDeleteServerDatabasesroute source

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.

ParameterInTypeRequiredDescription
uuidShortpathstringyesServer short UUID
Body fieldTypeRequiredDescription
idsinteger[]noDatabase IDs to delete
allbooleannoWhen true, delete all databases for the server
Response data fieldTypeDescription
deleted_countinteger
failed_countinteger
failedobject[]
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

Auth: Server accessDefault rate limit: 30 / minute (user-server-databases)Route name: session-server-databases-hostsController: ServerDatabaseController::getAvailableDatabaseHostsroute source

Get available database hosts Retrieve all available database hosts that can be used for creating databases.

ParameterInTypeRequiredDescription
uuidShortpathstringyesServer 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}

Auth: Server accessDefault rate limit: 30 / minute (user-server-databases)Route name: session-server-databases-showController: ServerDatabaseController::getServerDatabaseroute source

Get specific database Retrieve details of a specific database for a server that the user owns or has subuser access to.

ParameterInTypeRequiredDescription
uuidShortpathstringyesServer short UUID
databaseIdpathintegeryesDatabase ID

Response data: ServerDatabase

Response data fieldTypeDescription
idintegerDatabase ID
server_idintegerServer ID
database_host_idintegerDatabase host ID
databasestringDatabase name
usernamestringDatabase username
passwordstringDatabase password
remotestringRemote access pattern
max_connectionsintegerMaximum connections
database_host_namestringDatabase host name
database_hoststringDatabase host address
database_portintegerDatabase host port
database_typestringDatabase type
created_atstring (date-time)Creation timestamp
updated_atstring (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}

Auth: Server accessDefault rate limit: 10 / minute (user-server-databases)Route name: session-server-databases-updateController: ServerDatabaseController::updateServerDatabaseroute source

Update database Update database settings including remote access pattern and maximum connections.

ParameterInTypeRequiredDescription
uuidShortpathstringyesServer short UUID
databaseIdpathintegeryesDatabase ID

Request body: DatabaseUpdateRequest (application/json)

Body fieldTypeRequiredDescription
remotestringnoRemote access pattern
max_connectionsintegernoMaximum connections
Response data fieldTypeDescription
messagestringSuccess 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}

Auth: Server accessRoute name: session-server-databases-deleteController: ServerDatabaseController::deleteServerDatabaseroute source

Delete database Permanently delete a database from a server. This action cannot be undone.

ParameterInTypeRequiredDescription
uuidShortpathstringyesServer short UUID
databaseIdpathintegeryesDatabase ID
Response data fieldTypeDescription
messagestringSuccess 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

Auth: Server accessDefault rate limit: 5 / minute (user-server-databases)Route name: session-server-databases-test-hostController: ServerDatabaseController::testDatabaseHostConnectionroute source

Test database host connection Test the connection to a specific database host to verify connectivity and performance.

ParameterInTypeRequiredDescription
uuidShortpathstringyesServer short UUID
databaseHostIdpathintegeryesDatabase host ID to test

Response data: ConnectionTestResponse

Response data fieldTypeDescription
database_host_idintegerDatabase host ID
healthybooleanConnection health status
messagestringConnection test message
response_timenumberResponse 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

Auth: Server accessDefault rate limit: 5 / minute (user-server-databases)Route name: session-server-databases-exportController: ServerDatabaseController::exportDatabaseroute source

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.

ParameterInTypeRequiredDescription
uuidShortpathstringyesServer short UUID
databaseIdpathintegeryesDatabase ID
Response data fieldTypeDescription
sqlstringSQL dump content
filenamestringSuggested filename
table_countintegerNumber of tables exported
exported_atstringExport 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

Auth: Server accessDefault rate limit: 5 / minute (user-server-databases)Route name: session-server-databases-importController: ServerDatabaseController::importDatabaseroute source

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.

ParameterInTypeRequiredDescription
uuidShortpathstringyesServer short UUID
databaseIdpathintegeryesDatabase ID
Body fieldTypeRequiredDescription
sqlstringnoSQL content to import
ignore_errorsbooleannoContinue on errors (default: false)
Response data fieldTypeDescription
executed_statementsintegerNumber of statements executed
errorsstring[]List of errors encountered
successbooleanWhether 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

Auth: Server accessDefault rate limit: 30 / minute (user-server-databases)Route name: session-server-databases-queryController: ServerDatabaseController::runQueryroute source

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.

ParameterInTypeRequiredDescription
uuidShortpathstringyesServer short UUID
databaseIdpathintegeryesDatabase ID
Body fieldTypeRequiredDescription
querystringnoSQL query to execute
Response data fieldTypeDescription
typestringQuery type
columnsstring[]Column names (for SELECT)
rowsmixed[][]Result rows as arrays (for SELECT)
row_countintegerNumber of rows returned (for SELECT)
affected_rowsintegerNumber of rows affected (for DML)
truncatedbooleanWhether the result was truncated to 500 rows
execution_time_msnumberQuery 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

Auth: Server accessDefault rate limit: 30 / minute (user-server-databases)Route name: session-server-databases-phpmyadmin-checkController: ServerDatabaseController::checkPhpMyAdminInstalledroute source

Check phpMyAdmin installation Check if phpMyAdmin module is installed and available.

ParameterInTypeRequiredDescription
uuidShortpathstringyesServer short UUID
Response data fieldTypeDescription
installedbooleanWhether 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

Auth: Server accessDefault rate limit: 10 / minute (user-server-databases)Route name: session-server-databases-phpmyadmin-tokenController: ServerDatabaseController::generatePhpMyAdminTokenroute source

Generate phpMyAdmin signon token Mint a single-use phpMyAdmin signon token (credentials stay server-side; URL carries only the opaque token).

ParameterInTypeRequiredDescription
uuidShortpathstringyesServer short UUID
databaseIdpathintegeryesDatabase ID
Response data fieldTypeDescription
urlstringphpMyAdmin 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