List hosting databases
GET /api/v2/shared-hosting/{accountId}/databases
List the MySQL databases on a web hosting account with the disk space each one uses. quota counts the databases against the plan’s limit. quota.limit null means no limit, or that the limit could not be read right now. actions.canCreate says whether the plan has room for one more. No API call creates a database. Create it in the hosting control panel. POST /api/v2/shared-hosting/{accountId}/actions/sso gives a login link.
The account must be active. Otherwise the call answers 403 forbidden without requiredScopes. Check serviceStatus on GET /api/v2/shared-hosting/{accountId} first. An account on Hostup’s previous hosting platform returns an empty list and quota.limit null.
Authentication: An API key with the scopes read:hosting and console:services. About keys and scopes
Request
Path parameters
accountIdstringrequiredacct_…).Example
curl "https://cloud.hostup.se/api/v2/shared-hosting/acct_01hxa3b4c5d6e7f8g9h0j1k2m3/databases" \ -H "Authorization: Bearer $HOSTUP_API_KEY"Responses
200 Databases, the plan’s database quota and whether one more can be created.
{ "databases": [ { "id": "db_01hxa3b4c5d6e7f8g9h0j1k2m3", "name": "abcde_wp_example", "diskUsage": { "usedBytes": 134217728, "limitBytes": null, "usedGb": 0.125, "limitGb": null, "usagePercent": null, "exceeded": false } } ], "quota": { "used": 1, "limit": 10, "remaining": 9 }, "actions": { "canCreate": { "allowed": true, "reason": null } }}Response fields
databasesarray of objectidstringdb_…).namestringdiskUsageobjectusedBytesintegerlimitBytesinteger or nullnull. There is no limit per database.usedGbnumberlimitGbnumber or nullnull. There is no limit per database.usagePercentnumber or nullnull. There is no limit per database.exceededbooleanfalse.quotaobjectusedintegerlimitinteger or nullnull means no limit, or that the limit could not be read.remaininginteger or nullnull when limit is null.actionsobjectcanCreateobjectallowedbooleanreasonstring or nullcodestring or nullErrors
Errors are Problem Details with a stable code. Branch on the code, not on the text.
| 400 | Invalid request. The response body is an RFC 7807 Problem Details document. |
| 401 | Unauthorized. Authentication is required. |
| 403 | The API key lacks read:hosting or console:services. The body then lists requiredScopes. An account that is not active answers the body below, without requiredScopes. |
| 404 | Not found. The resource does not exist or is not owned by the caller. |
| 429 | Rate limited. Retry after the limit resets. 429 responses include Retry-After seconds plus X-RateLimit-* headers. |
| 500 | Internal error. Retry later or contact support if the issue persists. |