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
accountIdstringrequiredThe web hosting account ID (
acct_…).Body
newPasswordstringrequiredThe new password. 8-128 characters with upper- and lowercase letters and a number. It must also be hard to guess.
Example
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.
{ "accountId": "acct_01hxa3b4c5d6e7f8g9h0j1k2m3", "username": "exampleuser", "affectedAccess": [ "controlPanel", "ftp", "sftp", "ssh", "webmail" ]}Response fields
accountIdstringThe web hosting account ID.
usernamestringThe control panel username whose password was changed.
affectedAccessarray of stringThe logins that now use the new password.
Errors
Errors are Problem Details with a stable code. Branch on the code, not on the text.
| 400 | The password is too weak (password_too_weak) or the body is not valid (invalid_request). |
| 401 | Unauthorized. Authentication is required. |
| 403 | Forbidden. The caller lacks a required scope or does not own the resource. |
| 404 | Not found. The resource does not exist or is not owned by the caller. |
| 409 | The account is not on cPanel (account_not_eligible_cpanel). |
| 429 | Rate limited. Retry after the limit resets. 429 responses include Retry-After seconds plus X-RateLimit-* headers. |
| 500 | Internal error. Retry later or contact support if the issue persists. |
| 502 | Upstream failure. A dependent provider request failed; the Problem Details code is upstream_failed. Retry later or contact support if the issue persists. |