How can I update user password with admin kratos a...
# ory-copilot
d
How can I update user password with admin kratos api? @chilly-king-10285
c
A message from kapa.ai
To update a user's password using the Kratos admin API, you can use the
password
method as part of the
methods
payload in the Settings Flow. Here is an example of how to do this:
Copy code
bash curl -s -X GET \    -H "Authorization: Bearer $sessionToken" \    -H "Accept: application/json" \    <https://playground.projects.oryapis.com/self-service/settings/api> | jq -r '.ui.nodes[] | select(.group=="password")'
This will return a JSON object with the
password
group. You can then update the password by providing a new password in the
password
field. Please note that if the password is a protected field, the Ory Session must not be older than the configured
privileged_session_max_age
value. If the Ory Session is older than the specified amount, the user is prompted to re-authenticate. For more information, you can refer to the [Ory Kratos documentation](https://www.ory.sh/docs/kratos/self-service/flows/user-settings#update-password).