Create database host
Creates a database host after validating that the panel can connect to it.
/api/admin/database-hostsAuthorization
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
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/database-hosts" \ -H "Content-Type: application/json" \ -d '{ "name": "Example Resource", "host": "127.0.0.1", "port": 1.5, "username": "example" }'{ "object": "database_host", "attributes": { "id": 1554, "name": "LightPink", "host": "33.150.237.51", "port": 3306, "username": "Gold", "max_databases": 50, "databases_count": 0, "node_id": 1, "created_at": "2026-09-22T14:45:26+00:00", "updated_at": "2026-09-22T14:45:26+00:00", "relationships": { "node": { "object": "node", "attributes": { "id": 13380, "uuid": "0c8baf15-4a20-49b5-b738-109796b553e1", "public": true, "name": "FactoryNode_K98YXFAsPq", "description": "string", "location_id": 16046, "fqdn": "74.174.140.253", "scheme": "http", "behind_proxy": false, "maintenance_mode": false, "memory": 1024, "memory_overallocate": 0, "disk": 10240, "disk_overallocate": 0, "upload_size": 100, "daemon_listen": 8080, "daemon_sftp": 2022, "daemon_base": "/var/lib/pterodactyl/volumes", "created_at": "2026-09-22T14:45:25+00:00", "updated_at": "2026-09-22T14:45:25+00:00", "servers_count": 0, "allocated_resources": { "memory": 0, "disk": 0 }, "relationships": { "location": { "object": "location", "attributes": { "id": 16053, "short": "yXYh3ig7", "long": "DtTf5dbTXXUq1fV3VBHWMKFch7pKkxN4", "nodes_count": 0, "servers_count": 0, "created_at": "2026-09-22T14:45:26+00:00", "updated_at": "2026-09-22T14:45:26+00:00", "relationships": { "nodes": { "object": "list", "data": [ {} ] } } }, "meta": { "resource": "https://panel.example.com/api/admin/locations/1" } } } }, "meta": { "resource": "https://panel.example.com/api/admin/nodes/1" } }, "databases": { "object": "list", "data": [ { "object": "database", "attributes": { "server": { "id": 1, "name": "Survival" }, "name": "s1_database", "username": "u1_database", "connections_from": "%", "max_connections": 0 } } ] } } }, "meta": { "resource": "https://panel.example.com/api/admin/database-hosts/1" }}