Link Search Menu Expand Document Documentation Menu

You're viewing version 3.8 of the OpenSearch documentation. This version is no longer maintained. For the latest version, see the current documentation. For information about OpenSearch version maintenance, see Release Schedule and Maintenance Policy.

Change Password API

Introduced 1.0

Changes the password for the current user.

Endpoints

PUT /_plugins/_security/api/account

Request body fields

The request body is required. It is a JSON object with the following fields.

Field Data type Description Required
current_password String The user’s current password. Yes
password String The new password. It must satisfy the password policy set by plugins.security.restapi.password_validation_regex and must not be too similar to the user name. Yes

Example request

PUT /_plugins/_security/api/account
{
  "current_password": "OldPassword_4471!",
  "password": "NewPassword_8823!"
}

Example response

{
  "status": "OK",
  "message": "'pw-demo' updated."
}

Response body fields

The response body is a JSON object with the following fields.

Field Data type Description
status String The status of the request. A successful request returns OK.
message String A message naming the user whose password was changed.
350 characters left

Have a question? .

Want to contribute? or .