Change Password APIedit

The Change Password API enables you to submit a request to change the password of a user.

Requestedit

POST _xpack/security/user/_password

POST _xpack/security/user/<username>/_password

Path Parametersedit

username
(string) The user whose password you want to change. If you do not specify this parameter, the password is changed for the current user.

Request Bodyedit

password (required)
(string) The new password value.

Authorizationedit

Every user can change their own password. Users with the manage_security privilege can change passwords of other users.

Examplesedit

The following example updates the password for the elastic user:

POST _xpack/security/user/elastic/_password
{
  "password": "x-pack-test-password"
}

A successful call returns an empty JSON structure.

{}