<commit_before>[role="xpack"]
[[security-api-change-password]]
=== Change Password API

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

==== 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.<commit_msg>[DOCS] Fix formatting in change password API<commit_after>[role="xpack"]
[[security-api-change-password]]
=== Change Password API

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

==== 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.
{'fraction_non_alphanumeric': 0.10461538461538461, 'fraction_numerical': 0.0, 'mean_word_length': 4.775147928994083, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5101413', 'n_tokens_mistral': 278, 'n_tokens_neox': 266, 'n_words': 113}