# Update WordPress administrator password

This function sets a new password for a WordPress administrator of an
installation that the caller owns.

  Note:

  - Over HTTP this function accepts only the POST method, and it rejects
    any request that carries a password key in the URL query string. It
    checks both before it reads the password, so the password cannot reach
    an access log, a proxy log, or the browser history. The Perl bindings
    and the uapi command-line tool set no request method and no query
    string, so they are unaffected.
  - The system passes the password to WordPress through a file that only the
    caller can read, so it never appears in a process list, in the process
    environment, or in the WordPress Toolkit logs.
  - The system applies no password-strength rule of its own. Any non-empty
    value is accepted.
  - The system verifies that the caller owns the installation before it
    changes anything.

Endpoint: POST /WPX/change_admin_password
Version: 11.138.0.10
Security: BasicAuth

## Request fields (application/x-www-form-urlencoded):

  - `id` (integer, required)
    The WordPress Toolkit installation id, as returned in the wptk_id field of list_websites.
    Example: 17

  - `login` (string)
    The WordPress administrator login to change. Omit this parameter
only when the installation has exactly one administrator, and the
system targets that administrator. When supplied, it must name an
existing administrator of that installation. Call
get_admin_account to list the available logins.
    Example: "admin_abcd"

  - `password` (string, required)
    The new WordPress administrator password. Send this parameter in
the request body. The system rejects the call when a password
key appears in the URL query string.
    Example: "EXAMPLE-PASSWORD-PLACEHOLDER"

## Response 200 fields (application/json):

  - `apiversion` (integer)
    The version of the API.
    Example: 3

  - `func` (string)
    The name of the method called.
    Example: "change_admin_password"

  - `module` (string)
    The name of the module called.
    Example: "WPX"

  - `result` (object)

  - `result.data` (object)
    Confirmation of the change, and the administrator it applied to.

  - `result.data.changed` (integer)
    Always 1. A failure returns a failure status with a message in the errors field instead.
    Enum: 1

  - `result.data.id` (integer)
    The installation id that the system changed.
    Example: 17

  - `result.data.login` (string)
    The WordPress administrator login whose password changed. This is useful when you omit the login parameter.
    Example: "admin_abcd"

  - `result.errors` (array,null)
    List of errors if the API failed.

  - `result.messages` (array,null)
    List of messages generated by the API.

  - `result.metadata` (object)

  - `result.metadata.transformed` (integer)
    Post-processing may have transformed the data.
    Enum: 1

  - `result.status` (integer)
    - 1 - Success.
- 0 - Failed: Check the errors field for more details.
    Enum: 1, 0

  - `result.warnings` (array,null)
    List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running an API.


