Skip to main content
The Server Databases API allows administrators to create and manage MySQL databases for individual game servers. Each server can have multiple databases up to its configured limit.

List Server Databases

curl "https://panel.example.com/api/application/servers/{server_id}/databases" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Accept: application/json"
Retrieves all databases for a specific server.

Path Parameters

server_id
integer
required
The internal ID of the server

Response

{
  "object": "list",
  "data": [
    {
      "object": "server_database",
      "attributes": {
        "id": 5,
        "server": 2,
        "host": 3,
        "database": "s2_minecraft",
        "username": "u2_QsIAw4lh",
        "remote": "%",
        "max_connections": 0,
        "created_at": "2024-01-15T10:30:00+00:00",
        "updated_at": "2024-01-15T10:30:00+00:00"
      }
    }
  ]
}
object
string
Always list
data
array
Array of database objects

Get Database Details

curl "https://panel.example.com/api/application/servers/{server_id}/databases/{database_id}" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Accept: application/json"
Retrieves details for a specific database.

Path Parameters

server_id
integer
required
The internal ID of the server
database_id
integer
required
The internal ID of the database

Response

Returns a single database object with the same structure as shown in the list endpoint.

Create Database

curl -X POST "https://panel.example.com/api/application/servers/{server_id}/databases" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "database": "minecraft",
    "remote": "%",
    "host": 1
  }'
Creates a new database for the server.

Path Parameters

server_id
integer
required
The internal ID of the server

Request Body

database
string
required
Database name (will be prefixed with s{server_id}_). Max 48 characters, alphanumeric and underscores only.
remote
string
required
Remote connection string. Use % to allow connections from any IP, or specify specific IPs/CIDR ranges.
host
integer
required
Database host ID to create the database on

Response

{
  "object": "server_database",
  "attributes": {
    "id": 6,
    "server": 2,
    "host": 1,
    "database": "s2_minecraft",
    "username": "u2_a8Qw9kLp",
    "remote": "%",
    "max_connections": 0,
    "created_at": "2024-01-15T11:00:00+00:00",
    "updated_at": "2024-01-15T11:00:00+00:00"
  },
  "meta": {
    "resource": "https://panel.example.com/api/application/servers/2/databases/6"
  }
}
Returns the created database object. The password is auto-generated and shown only in the response meta (not in subsequent requests).
The database password is only returned once during creation. Store it securely as it cannot be retrieved later, only reset.

Reset Database Password

curl -X POST "https://panel.example.com/api/application/servers/{server_id}/databases/{database_id}/reset-password" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Accept: application/json"
Resets the password for a database. Returns a 204 No Content response on success.

Path Parameters

server_id
integer
required
The internal ID of the server
database_id
integer
required
The internal ID of the database

Response

Returns HTTP 204 (No Content) on success. The new password is generated automatically and must be retrieved from the Panel UI or via the Client API.
After resetting a password, the server owner should retrieve the new password from the Panel UI at /server/{identifier}/databases.

Delete Database

curl -X DELETE "https://panel.example.com/api/application/servers/{server_id}/databases/{database_id}" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Accept: application/json"
Permanently deletes a database and all its data.

Path Parameters

server_id
integer
required
The internal ID of the server
database_id
integer
required
The internal ID of the database

Response

Returns HTTP 204 (No Content) on successful deletion.
This action is irreversible. All data in the database will be permanently deleted. Ensure you have backups before deleting.

Database Limits

Servers have a database_limit field that restricts how many databases can be created:
  • Set to 0 for unlimited databases
  • Set to a positive integer for a specific limit
  • Attempts to create databases beyond the limit will return a 400 error
Check the server’s database_limit field via the Servers API before creating databases.

Connection Information

To connect to a database from the game server:
Connection Details
Host: {database_host.host}:{database_host.port}
Database: s{server_id}_{name}
Username: u{server_id}_{random}
Password: (auto-generated, see Panel UI)
The actual host and port are determined by the database host configuration. Retrieve these via the Panel admin interface or by checking the database host settings.

Best Practices

Name databases according to their purpose (e.g., minecraft, plugins, stats) rather than generic names.
Instead of %, use specific IP addresses or CIDR ranges for the remote field to improve security.
Check server database limits before attempting to create new databases to avoid errors.
When resetting passwords via the Application API, notify server owners to retrieve the new password from the Panel UI.

Build docs developers (and LLMs) love