POST /backend/hosted/databases
Create a hosted database
Create a hosted PostgreSQL database in one step. Use when the app needs a database. Before: list_databases (needs database read access). Returns the database and, this once, its connection url: store it as an environment secret, never print it. Scope: database:create ; the project balance must cover 24 hours.
API key (Bearer), on the public API endpoint.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
Idempotency-Key | header | string · required |
Request body
application/json
| Field | Type | Description |
|---|---|---|
name | string · required | Database name: 3 to 40 lowercase letters, digits and hyphens. |
Responses
| Status | Description | Body |
|---|---|---|
2XX | Success: the JSON body the route returns (see the description for its fields). | object |
401 | Key missing or invalid | Error |
4XX | Refused: act on detail.code, then follow detail.next_action (404 not_found while the service is not open to the account). | Error |
Examples
curl
curl -X POST "$GALON_API_BASE/backend/hosted/databases" \
-H "Authorization: Bearer $GALON_API_KEY" \
-H "Idempotency-Key: <unique-key>" \
-H "Content-Type: application/json" \
-d '{"name": "string"}'