View .md

Databases endpoints (Admin API)

8 FeatherPanel Admin API endpoints from admin/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/admin/databases.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/databases

Auth: AdminPermission: admin.databases.viewRoute name: admin-databasesController: DatabasesController::indexroute source

Get all databases Retrieve a paginated list of all database instances with optional filtering by node and search query.

ParameterInTypeRequiredDescription
pagequeryintegernoPage number for pagination
limitqueryintegernoNumber of records per page
searchquerystringnoSearch term to filter databases by name
node_idqueryintegernoFilter databases by node ID
Response data fieldTypeDescription
databasesDatabase[]
paginationobject
searchobject
curl -X GET "$PANEL_URL/api/admin/databases" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json"

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

GET/api/admin/databases/{id}

Auth: AdminPermission: admin.databases.viewRoute name: admin-databases-showController: DatabasesController::showroute source

Get database by ID Retrieve a specific database instance by its ID with associated node information. Password is excluded from response.

ParameterInTypeRequiredDescription
idpathintegeryesDatabase ID
Response data fieldTypeDescription
databaseDatabase
curl -X GET "$PANEL_URL/api/admin/databases/$ID" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json"

Responses: 200 Database retrieved successfully · 400 Invalid ID format · 401 Unauthorized · 403 Forbidden - Insufficient permissions · 404 Database not found

PATCH/api/admin/databases/{id}

Auth: AdminPermission: admin.databases.editRoute name: admin-databases-updateController: DatabasesController::updateroute source

Update database Update an existing database instance. Only provided fields will be updated.

ParameterInTypeRequiredDescription
idpathintegeryesDatabase ID

Request body: DatabaseUpdate (application/json)

Body fieldTypeRequiredDescription
namestringnoDatabase name
node_idintegernoNode ID
database_typestringnoDatabase type
database_portintegernoDatabase port
database_usernamestringnoDatabase username
database_passwordstringnoDatabase password
database_hoststringnoDatabase host
database_subdomainstringnoOptional custom hostname shown to users for database access
Response data fieldTypeDescription
messagestringSuccess message
curl -X PATCH "$PANEL_URL/api/admin/databases/$ID" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{"name":"","node_id":0,"database_type":"","database_port":0,"database_username":"","database_password":"","database_host":"","database_subdomain":""}'

Plugin events: featherpanel:admin:databases:database:updated

Responses: 200 Database updated successfully · 400 Bad request - Invalid data · 401 Unauthorized · 403 Forbidden - Insufficient permissions · 404 Database or node not found · 500 Internal server error - Failed to update database

DELETE/api/admin/databases/{id}

Auth: AdminPermission: admin.databases.deleteRoute name: admin-databases-deleteController: DatabasesController::deleteroute source

Delete database Permanently delete a database instance. This action cannot be undone.

ParameterInTypeRequiredDescription
idpathintegeryesDatabase ID
Response data fieldTypeDescription
messagestringSuccess message
curl -X DELETE "$PANEL_URL/api/admin/databases/$ID" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json"

Plugin events: featherpanel:admin:databases:database:deleted

Responses: 200 Database deleted successfully · 401 Unauthorized · 403 Forbidden - Insufficient permissions · 404 Database not found · 500 Internal server error - Failed to delete database

PUT/api/admin/databases

Auth: AdminPermission: admin.databases.createRoute name: admin-databases-createController: DatabasesController::createroute source

Create new database Create a new database instance. Health checks are skipped by default. Use /api/admin/databases/test-connection endpoint to test the connection before creating if needed. Node ID is optional for migration purposes.

Request body: DatabaseCreate (application/json)

Body fieldTypeRequiredDescription
namestringyesDatabase name
node_idintegernoNode ID (optional)
database_typestringyesDatabase type
database_portintegeryesDatabase port
database_usernamestringyesDatabase username
database_passwordstringyesDatabase password
database_hoststringyesDatabase host
database_subdomainstringnoOptional custom hostname shown to users for database access
idintegernoOptional database ID (useful for migrations from other platforms)
Response data fieldTypeDescription
database_idintegerID of the created database
curl -X PUT "$PANEL_URL/api/admin/databases" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{"name":"","node_id":0,"database_type":"","database_port":0,"database_username":"","database_password":"","database_host":"","database_subdomain":"","id":0}'

Plugin events: featherpanel:admin:databases:database:created

Responses: 201 Database created successfully · 400 Bad request - Invalid data · 401 Unauthorized · 403 Forbidden - Insufficient permissions · 404 Node not found (only if node_id is provided) · 500 Internal server error - Failed to create database

GET/api/admin/databases/node/{nodeId}

Auth: AdminPermission: admin.databases.viewRoute name: admin-databases-by-nodeController: DatabasesController::getByNoderoute source

Get databases by node Retrieve all database instances for a specific node with pagination and search capabilities.

ParameterInTypeRequiredDescription
nodeIdpathintegeryesNode ID
pagequeryintegernoPage number for pagination
limitqueryintegernoNumber of records per page
searchquerystringnoSearch term to filter databases by name
Response data fieldTypeDescription
databasesDatabase[]
paginationobject
searchobject
curl -X GET "$PANEL_URL/api/admin/databases/node/$NODE_ID" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json"

Responses: 200 Databases for node retrieved successfully · 400 Invalid node ID format · 401 Unauthorized · 403 Forbidden - Insufficient permissions · 404 Node not found

GET/api/admin/databases/{id}/health

Auth: AdminPermission: admin.databases.viewRoute name: admin-databases-health-checkController: DatabasesController::healthCheckroute source

Check database health Perform a health check on a specific database instance by testing the connection.

ParameterInTypeRequiredDescription
idpathintegeryesDatabase ID
Response data fieldTypeDescription
database_idintegerDatabase ID
healthybooleanWhether the database is healthy
messagestringHealth check message
response_timenumberConnection response time in milliseconds
curl -X GET "$PANEL_URL/api/admin/databases/$ID/health" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json"

Responses: 200 Health check completed · 400 Invalid ID format · 401 Unauthorized · 403 Forbidden - Insufficient permissions · 404 Database not found

POST/api/admin/databases/test-connection

Auth: AdminPermission: admin.databases.createRoute name: admin-databases-test-connectionController: DatabasesController::testConnectionroute source

Test database connection Test a database connection without creating a database record. Useful for validating connection parameters.

Request body: ConnectionTest (application/json)

Body fieldTypeRequiredDescription
database_typestringyesDatabase type
database_portintegeryesDatabase port
database_usernamestringyesDatabase username
database_passwordstringyesDatabase password
database_hoststringyesDatabase host
Response data fieldTypeDescription
successbooleanWhether the connection was successful
messagestringConnection test message
response_timenumberConnection response time in milliseconds
curl -X POST "$PANEL_URL/api/admin/databases/test-connection" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{"database_type":"","database_port":0,"database_username":"","database_password":"","database_host":""}'

Responses: 200 Connection test completed · 400 Bad request - Missing required fields · 401 Unauthorized · 403 Forbidden - Insufficient permissions