Skip to content

List database access hosts

GET /api/v2/shared-hosting/{accountId}/database-access-hosts

List the hosts that may connect to the account’s MySQL databases over TCP. The list is account-wide. Every database user may connect from every listed host with its own password. localhost (the local socket) is always allowed and never listed. An app on the hosting that connects over TCP is seen as 127.0.0.1 (::1 over IPv6). That address must be on the list. The account must be active. An account on Hostup’s previous hosting platform returns an empty list. Add a host with POST /api/v2/shared-hosting/{accountId}/database-access-hosts. Remove one with DELETE /api/v2/shared-hosting/{accountId}/database-access-hosts/{host}.

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}/database-access-hosts
curl "https://cloud.hostup.se/api/v2/shared-hosting/acct_01hxa3b4c5d6e7f8g9h0j1k2m3/database-access-hosts" \
-H "Authorization: Bearer $HOSTUP_API_KEY"

Responses

200 Allowed database access hosts.

Response 200
{
"databaseAccessHosts": [
{
"host": "127.0.0.1",
"note": "Node app on the hosting"
},
{
"host": "203.0.113.7",
"note": "Office"
}
]
}
Response fields
databaseAccessHostsarray of object
The allowed hosts. Empty when only the local socket is allowed.
hoststring
An IP address, an IP range with % as the wildcard (203.0.113.%), a hostname or % for every host. Use this value as {host} to remove it.
notestring or null
The comment saved next to the host in the control panel.

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.
403Forbidden. The caller lacks a required scope or does not own the resource.
404Not found. The resource does not exist or is not owned by the caller.
409Conflict. code is account_suspended, account_not_eligible_cpanel.
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.
502Upstream failure. A dependent provider request failed; the Problem Details code is upstream_failed. Retry later or contact support if the issue persists.