Skip to content

List database users

GET /api/v2/shared-hosting/{accountId}/database-users

List the MySQL users on a web hosting account. databases names the databases each user can access. Link a user to a database with POST /api/v2/shared-hosting/{accountId}/database-users/{username}/privileges. Use id or username as {username} in the calls on one user. The hosts users may connect from are account-wide. See GET /api/v2/shared-hosting/{accountId}/database-access-hosts. The account must be active. An account on Hostup’s previous hosting platform returns an empty list.

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

Responses

200 Database users.

Response 200
{
"databaseUsers": [
{
"id": "dbu_01hxa3b4c5d6e7f8g9h0j1k2m3",
"username": "abcde_wp_exampleuser",
"host": "localhost",
"databases": [
"abcde_wp_example"
]
}
]
}
Response fields
databaseUsersarray of object
idstring
The database user ID (dbu_…).
usernamestring
The MySQL user name.
hoststring or null
The MySQL host the user is defined for, when reported.
databasesarray of string
The databases this user can access.

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.