Change the passwords of users in the native realm and built-in users.
Path parameters
-
The user whose password you want to change. If you do not specify this parameter, the password is changed for the current user.
Query parameters
-
If
true(the default) then refresh the affected shards to make this operation visible to search, ifwait_forthen wait for a refresh to make this operation visible to search, iffalsethen do nothing with refreshes.Values are
true,false, orwait_for.
PUT
/_security/user/{username}/_password
Console
POST /_security/user/user1/_password
{
"password" : "new-test-password"
}
curl \
--request PUT 'http://api.example.com/_security/user/{username}/_password' \
--header "Content-Type: application/json" \
--data '"{\n \"password\" : \"new-test-password\"\n}"'
Request examples
Security change password example1
An example body for a `POST /_security/user/user1/_password` request.
{
"password" : "new-test-password"
}
Run `POST /_security/user/jacknich/_password` to update the password for the `jacknich` user.
{
"password" : "new-test-password"
}