Skip to content

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

accountIdstringrequired
The web hosting account ID (acct_…).

Example

GET /api/v2/shared-hosting/{accountId}/databases
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.

Response 200
{
"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 object
idstring
The database ID (db_…).
namestring
The full MySQL database name.
diskUsageobject
Disk space the database uses.
usedBytesinteger
Bytes used.
limitBytesinteger or null
Always null. There is no limit per database.
usedGbnumber
GB used, rounded to three decimals.
limitGbnumber or null
Always null. There is no limit per database.
usagePercentnumber or null
Always null. There is no limit per database.
exceededboolean
Always false.
quotaobject
usedinteger
Databases on the account.
limitinteger or null
Databases the plan allows. null means no limit, or that the limit could not be read.
remaininginteger or null
Databases that can still be created. null when limit is null.
actionsobject
canCreateobject
allowedboolean
reasonstring or null
codestring or null
A machine-readable code for why the action is blocked.

Errors

Errors are Problem Details with a stable code. Branch on the code, not on the text.

400Invalid request. The response body is an RFC 7807 Problem Details document.
401Unauthorized. Authentication is required.
403The 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.
404Not found. The resource does not exist or is not owned by the caller.
429Rate limited. Retry after the limit resets. 429 responses include Retry-After seconds plus X-RateLimit-* headers.
500Internal error. Retry later or contact support if the issue persists.