Unclear API endpoint

Good evening,

I’m currently working on a very basic demo with the Rancher API. The documentation for the specific endpoint to change a user password is a little bare. The example explorer does not show a field for the actual user you want to change the password of.

data = {
“currentPassword”: “test1”,
“newPassword”: “Test”
}
url = ‘https://rancher.qstars.nl/v3/users?action=changepassword

How do I specify the user?

Thanks!

The changepassword action is for the user who is logged in and making the request, and requires knowing their current password. This is the self-service “change my password” flow. It’s on the collection (instead of an individual /v3/users/<id>) because the person who’s logged in doesn’t necessarily have access to list users and find themselves in the collection.

If you are logged in as an admin, then individual /v3/user entries also have a setpassword action which will let you just set a new password for them (without knowing the old one). This is more like an help desk ticket “Steve forgot his password, can you help him” flow.