Update cPanel account password

This function modifies a cPanel or reseller account's password.

Note

  • When modifying the root password, this will only update the password for the root system user, but not for the root MySQL user.
  • To update the MySQL root user's password, use set_local_mysql_root_password.
SecurityBasicAuth
Request
query Parameters
password
required
string

The account's new password.

Example: password=12345luggage
user
required
string

The account's username.

Example: user=username
db_pass_update
integer
Default: 1

Whether to also change the account's MySQL® password.

  • 1 — Also update the account's MySQL password to match the password value.
  • 0 — Do not update.
Enum: 0 1
Example: db_pass_update=0
enabledigest or digestauth
integer

Whether to enable Digest Authentication for the account. If you do not specify a value, the account retains its current Digest Authentication setting.

  • 1 — Enable.
  • 0 — Disable.
Enum: 0 1
Example: enabledigest or digestauth=1
Responses
200

HTTP Request was successful.

Response Schema: application/json
object
object
get/passwd
Request samples
whmapi1 --output=jsonpretty \
  passwd \
  user='username' \
  password='12345luggage'
Response samples
application/json
{
  • "data": {
    • "app": [
      • "ftp"
      ]
    },
  • "metadata": {
    • "command": "passwd",
    • "reason": "Password changed for user “username”.",
    • "result": 1,
    • "version": 1
    }
}