[DOCS] Format change password API (elastic/x-pack-elasticsearch#2573)
Original commit: elastic/x-pack-elasticsearch@220c8557883b1190285de064ab6efde470dc4fb7
=== 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]
--------------------------------------------------
