Databases
Create database
Creates a new database
POST
/api/client/servers/{server}/databasesAuthorization
ClientToken AuthorizationBearer <token>
Client API key (generated at /account/api)
In: header
Path Parameters
server*string
Server identifier (short 8-character ID)
Request Body
application/json
database*string
Name of the database to create.
remote*string
Host or IP pattern allowed to connect to the database. Use % to allow any host.
Response Body
application/json
curl -X POST "https://pterodactyl.file.properties/api/client/servers/1a7ce997/databases" \ -H "Authorization: Bearer ptlc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -d '{ "database": "bans", "remote": "%"}'{
"object": "server_database",
"attributes": {
"id": "y9YVxO4V",
"host": {
"address": "127.0.0.1",
"port": 3306
},
"name": "s5_punishments",
"username": "u5_aeZqbGdCM9",
"connections_from": "%",
"max_connections": 0,
"relationships": {
"password": {
"object": "database_password",
"attributes": {
"password": "=lR2orDOcwfKkM=BXb.BVF.C"
}
}
}
}
}