[DOCS] Format change password API (elastic/x-pack-elasticsearch#2573)

Original commit: elastic/x-pack-elasticsearch@d1fc1a6116
This commit is contained in:
Lisa Cawley 2017-09-22 10:00:04 -07:00 committed by GitHub
parent 42f90b25e3
commit 3e68a89a45

View File

@ -3,11 +3,36 @@
=== Change Password API
The Change Password API enables you to submit a request to change the password
of a user. Every user can change their own password and users with the
`manage_security` privilege can change passwords of other users.
of a user.
To change the password of the logged in user, submit a POST request to the
`_xpack/security/user/_password` endpoint:
==== Request
`POST _xpack/security/user/_password` +
`POST _xpack/security/user/<username>/_password`
==== Path Parameters
`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 Body
`password` (required)::
(string) The new password value.
==== Authorization
Every user can change their own password. Users with the `manage_security`
privilege can change passwords of other users.
==== Examples
The following example updates the password for the `elastic` user:
[source,js]
--------------------------------------------------