Create server database
Creates a database for a server and returns the generated password.
/api/admin/servers/{server_admin_identifier}/databasesAuthorization
default Application API requests require an application API token, or a client API token, that belongs to a root administrator. Admin API requests require a client API token that belongs to a root administrator, and reject application API tokens. Client API requests require a client API token.
In: header
Path Parameters
The server ID or UUID.
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/api/admin/servers/1/databases" \ -H "Content-Type: application/json" \ -d '{ "database": "example", "remote": "127.0.0.1", "database_host_id": 1 }'{ "object": "server_database", "attributes": { "id": "kB0dVl28", "host": { "address": "15.159.33.109", "port": 3306 }, "name": "jcPmkfpoBm", "username": "AQ4MUxEC4L", "connections_from": "%", "max_connections": 0, "relationships": { "password": { "object": "database_password", "attributes": { "password": "test123" } } } }, "meta": { "resource": "https://panel.example.com/api/admin/servers/1/databases/Lk3jx4pQ" }}