Skip to content

Set a new control panel password

POST /api/v2/shared-hosting/{accountId}/actions/reset-password

Set a new password for the main control panel user of a web hosting account on cPanel. The same password is used for FTP, SFTP, SSH and webmail logins with the control panel username. Passwords must be 8-128 characters with uppercase, lowercase, and a number. They must also be hard to guess. A weak password returns 400 password_too_weak with suggestions. The existing password cannot be fetched. The response never echoes the new password. The account must be active.

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_…).

Body

newPasswordstringrequired
The new password. 8-128 characters with upper- and lowercase letters and a number. It must also be hard to guess.

Example

POST /api/v2/shared-hosting/{accountId}/actions/reset-password
curl -X POST "https://cloud.hostup.se/api/v2/shared-hosting/acct_01hxa3b4c5d6e7f8g9h0j1k2m3/actions/reset-password" \
-H "Authorization: Bearer $HOSTUP_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"newPassword": "YOUR_NEW_CPANEL_PASSWORD"
}'

Responses

200 The password was changed.

Response 200
{
"accountId": "acct_01hxa3b4c5d6e7f8g9h0j1k2m3",
"username": "exampleuser",
"affectedAccess": [
"controlPanel",
"ftp",
"sftp",
"ssh",
"webmail"
]
}
Response fields
accountIdstring
The web hosting account ID.
usernamestring
The control panel username whose password was changed.
affectedAccessarray of string
The logins that now use the new password.

Errors

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

400The password is too weak (password_too_weak) or the body is not valid (invalid_request).
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.
409The account is not on cPanel (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.