List Databases
GET /databases/
Responses
- 200 list[DatabaseOut]
- 401 no key, or a key that was revoked
- 403 the key lacks the permission
Example request
curl -X GET "$API/databases/" \
-H "Authorization: Bearer $LH_API_KEY"
The managed databases on the account. Read-only here; credentials stay in the panel.
Every call needs Authorization: Bearer lh_… unless marked No key needed; the example uses $API for https://api.localhost.co.zw and $LH_API_KEY for your key. A * marks a required field.
GET /databases/
curl -X GET "$API/databases/" \
-H "Authorization: Bearer $LH_API_KEY"
POST /databases/
A new database, as many as the plan includes; past that, one more at the extra database price a month with
`add_extra` (its first month from the wallet now). The connection details are in the panel, or become the named
site's DATABASE_URL.
| Name | Type | Notes |
|---|---|---|
| name | string | default "" |
| engine | string | default postgres |
| site | string | default "" |
| add_extra | boolean | default false |
curl -X POST "$API/databases/" \
-H "Authorization: Bearer $LH_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "<name>",
"engine": "postgres",
"site": "<site>",
"add_extra": false
}'
The objects these endpoints send and receive.
| Name | Type | Notes |
|---|---|---|
| name | string | default "" |
| engine | string | default postgres |
| site | string | default "" |
| add_extra | boolean | default false |
| Name | Type | Notes |
|---|---|---|
| id * | string | |
| name * | string | |
| role * | string | |
| engine * | string | |
| host * | string | |
| port * | integer | |
| size_mb * | number | |
| status * | string | |
| site | string | null |