Change an email account password
PUT /api/v2/shared-hosting/{accountId}/email-accounts/{address}/password
Sets a new password for a mailbox. The call does not check that the mailbox exists first. Mail apps that use the old password stop working until they get the new one. The password must be 8-128 characters and contain uppercase, lowercase, and a number. It must also be hard to guess. Otherwise the call returns 400 password_too_weak. The response does not return the password. An account on Hostup’s previous hosting platform returns 409 account_not_eligible_cpanel.
Authentication: An API key with the scopes write:hosting and console:services. About keys and scopes
Request
Path parameters
accountIdstringrequiredThe hosting account ID (
acct_…).addressstringrequiredThe email address (
hello@example.com) or the email account ID (mail_…). Unicode IDN and punycode spellings are both accepted.Body
newPasswordstringrequiredNew mailbox password, 8-128 characters with uppercase, lowercase and a number. It must be hard to guess.
Example
curl -X PUT "https://cloud.hostup.se/api/v2/shared-hosting/acct_01hxa3b4c5d6e7f8g9h0j1k2m3/email-accounts/hello@example.com/password" \ -H "Authorization: Bearer $HOSTUP_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "newPassword": "Quiet-Meadow-74-Compass" }'Responses
200 The password is changed.
{ "email": "hello@example.com"}Response fields
emailstringThe mailbox address. IDNs are in Unicode form.
Errors
Errors are Problem Details with a stable code. Branch on the code, not on the text.
| 400 | {address} or the body is invalid (invalid_request). A password that breaks the rules returns password_too_weak with minimumScore. A password that is too easy to guess also gets score and suggestions. |
| 401 | Unauthorized. Authentication is required. |
| 403 | The mailbox domain is not on this hosting account (domain_not_owned), the API key lacks a required scope or the account is not active. |
| 404 | Not found. The resource does not exist or is not owned by the caller. |
| 409 | The account is on Hostup’s previous hosting platform. Mailbox passwords cannot be changed there through the API. |
| 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 | The server did not change the password (upstream_failed). This is also the answer when the domain is on the account but no mailbox has this address, or when the server’s own strength check refuses the password. Sending the same request again then fails the same way. Check the address with GET /api/v2/shared-hosting/{accountId}/email-accounts or choose a longer password instead. |