- Created by Documentation, last modified on Apr 09, 2018
Description
This function modifies a cPanel or reseller account's password.
Examples
https://hostname.example.com:2087/cpsess##########/json-api/passwd?user=username&pass=12345luggage&enabledigest=1
https://hostname.example.com:2087/cpsess##########/xml-api/passwd?user=username&pass=12345luggage&enabledigest=1
whmapi0 passwd user=username pass=12345luggage enabledigest=1
Notes:
- You must URI-encode values.
- For more information and additional output options, read our Guide to WHM API 0 documentation or run the
whmapi0 --help
command. If you run CloudLinux™, you must use the full path of the
whmapi0
command:/usr/local/cpanel/bin/whmapi0
{ "passwd":[ { "statusmsg":"Password changed for user "username".", "services":[ { "app":"system" }, { "app":"ftp" }, { "app":"mail" }, { "app":"MySQL" }, { "app":"webdisk (digest)" } ], "rawout":"Password for "username" has been changed.\nUpdating FTP passwords for username\nFTP password files updated.\nFTP vhost passwords synced\n", "status":1 } ] }
<passwd> <passwd> <rawout> Password for “username” has been changed. Updating FTP passwords for username FTP password files updated. FTP vhost passwords synced </rawout> <services> <app>system</app> </services> <services> <app>ftp</app> </services> <services> <app>mail</app> </services> <services> <app>MySQL</app> </services> <services> <app>webdisk (digest)</app> </services> <status>1</status> <statusmsg>Password changed for user “username”.</statusmsg> </passwd> </passwd>
Parameters
Parameter | Type | Description | Possible values | Example |
---|---|---|---|---|
user | string | Required The account's username. | A cPanel account username on the server. | username |
pass | string | Required The account's new password. | A secure password. | 12345luggage |
enabledigest | Boolean | Whether to enable Digest Authentication for the account. If you do not specify a value, the account retains its current Digest Authentication setting. |
| 1 |
db_pass_update | Boolean | Whether to also change the account's MySQL® password. This parameter defaults to |
| 0 |
Returns
Return | Type | Description | Possible values | Example |
---|---|---|---|---|
| Boolean | Whether the system successfully called the function. |
| 1 |
| string | A message of success or a reason for failure. |
|
|
rawout | string | The function's output messages. | One or more output strings. | Click to view... Password for “username” has been changed.\nUpdating FTP passwords for username\nFTP password files updated.\nFTP vhost passwords synced\n |
services | array of hashes | An array of hashes of services for which the system changed the password. | Each hash includes the app return. | |
| string | A service for which the password changed. The function returns this value in the | A valid service name. | ftp |
Function information
API Version:
WHM API 1 Equivalent:
Important:
We strongly recommend that you use WHM API 1. WHM API 0 is deprecated.
Available in:
WHM 11+
Methods:
GET, POST
Required Parameters:
user
, pass
Return Formats:
About WHM API 0
Warning:
WHM API 0 is deprecated. We strongly recommend that you use the equivalent WHM API 1 function instead.
Notes:
- Some functions and parameters may require that you authenticate as the
root
user. - You must use the appropriate WHM ports (
2086
or2087
) to call WHM API functions.
Find a function
Related functions
-
Page:WHM API 0 Sections - Accounts — Account functions allow you to manage cPanel accounts, WHM accounts, and their settings.
-
Page:WHM API 0 Functions - accountsummary — This function retrieves a user's account summary.
-
Page:WHM API 0 Functions - domainuserdata — This function retrieves domain data.
-
Page:WHM API 0 Functions - editquota — This function modifies a user's disk quota.
-
Page:WHM API 0 Functions - limitbw — This function modifies a cPanel account's bandwidth quota.