Documentation Index
Fetch the complete documentation index at: https://mintlify.com/iFamishedX/HungerLib/llms.txt
Use this file to discover all available pages before exploring further.
DatabasesAPI wraps the Pterodactyl database management endpoints. It is available as panel.databases on every Panel instance and is also called internally by GenericServer methods. All methods accept server_id as their first argument and return a raw requests.Response.
Pterodactyl creates MySQL databases scoped to a server. Each database gets its own username, password, and remote access rule. Use rotate_password() to cycle credentials without recreating the database, or delete() to remove it entirely.
list
Returns all databases attached to a server.
Endpoint: GET /api/client/servers/{server_id}/databases
The short identifier of the target server (e.g.
"abc123").requests.Response — JSON body contains a data array of database objects. Each entry includes id, host (with address and port), name, username, password, connections_from, and max_connections.
create
Creates a new database for the server. Pterodactyl automatically generates a username and password.
Endpoint: POST /api/client/servers/{server_id}/databases
The short identifier of the target server.
The name to give the new database. Sent as the
"database" key in the JSON request body. Pterodactyl may prefix it with the server identifier automatically.The remote host from which connections are permitted. Defaults to
"%", which allows connections from any host. Pass a specific IP or hostname to restrict access.The database host ID to use when multiple database hosts are configured on the panel. Only included in the request payload when truthy — if
None or falsy (the default), the host key is omitted entirely and Pterodactyl uses the panel’s default database host.requests.Response — JSON body describes the newly created database, including its auto-generated username, password, and connection details.
rotate_password
Generates a new random password for an existing database without altering the database or its permissions.
Endpoint: POST /api/client/servers/{server_id}/databases/{db_id}/rotate-password
The short identifier of the target server.
The identifier of the database whose password should be rotated. Obtain this from
list() via db["attributes"]["id"].requests.Response — JSON body contains the updated database object with the new password field.
delete
Permanently deletes a database and all data it contains.
Endpoint: DELETE /api/client/servers/{server_id}/databases/{db_id}
The short identifier of the target server.
The identifier of the database to delete.
requests.Response — A 204 No Content response on success.