Skip to content

Reset database user password

PUT /api/v2/shared-hosting/{accountId}/database-users/{username}/password

Set a new password for a MySQL user on a web hosting account. The password must be 8-128 characters with uppercase, lowercase, and a number. It must also be hard to guess. A weak password answers 400 password_too_weak. Apps that still use the old password stop connecting until you update them. The account must be active and on cPanel. The response repeats the user name. It never returns the password.

Authentication: An API key with the scopes write:hosting and console:services. About keys and scopes

Request

Path parameters

accountIdstringrequired
The web hosting account ID (acct_…).
usernamestringrequired
The database user’s ID (dbu_…) or its MySQL user name.

Body

newPasswordstringrequired
8-128 characters with uppercase, lowercase, and a number. A password that is easy to guess answers password_too_weak.

Example

PUT /api/v2/shared-hosting/{accountId}/database-users/{username}/password
curl -X PUT "https://cloud.hostup.se/api/v2/shared-hosting/acct_01hxa3b4c5d6e7f8g9h0j1k2m3/database-users/example-user/password" \
-H "Authorization: Bearer $HOSTUP_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"newPassword": "YOUR_NEW_DATABASE_PASSWORD"
}'

Responses

200 Password changed.

Response 200
{
"username": "abcde_wp_exampleuser"
}
Response fields
usernamestring
The MySQL user name.

Errors

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

400The password is too weak or a field is invalid.
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, or a route-specific blocker with its own recovery fields.
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.