Change User Password
A user's own password change, for your app: it sends the current password and the new one the user typed, as on their account page. The new password must meet the endpoint's password rules and must not be one known from a data breach. Once it's changed, the user is signed out of every browser and gets an email saying their password changed. Their access token keeps working. Requires the endpoints:update permission in the active account.
To set a user's password yourself, without their current one, use Update User.
Path parameters
uuid string (uuid) Req
The endpoint's
uuid from /endpoints.client_uuid string (uuid) Req
The user's
uuid. Resolved under this endpoint only.An integer id in the path is refused with 400 integer_id_unsupported (see public IDs). Use the uuid.
Request body
current_password string Req
The password the user signs in with now.
new_password string Req
Their new password.
Response (204 No Content)
No body.
Errors
400 Bad Request
A field is missing or unknown, or
new_password is the same as current_password; or fields.current_password: the current password is wrong; or fields.new_password: the new password doesn't meet the endpoint's rules (the message names the rule) or appeared in a data breach.401 Unauthorized
Missing or invalid auth.
403 Forbidden
Your role lacks
endpoints:update, or you are not a member of the active account.404 Not Found
Endpoint doesn't exist or doesn't belong to the calling account, or the user doesn't belong to this endpoint (
endpoint user not found).409 Conflict
The user has no password, their identity provider manages their sign-in, password sign-in is off for the endpoint, or their password changed meanwhile (read it again and retry).
429 Too Many Requests
Too many password changes tried for this user in a short time. Try again after
Retry-After seconds.503 Service Unavailable
Passwords can't be changed right now. Try again later.
Request
curl -X POST \
"https://api.ngris.com/v1/endpoints/019bb1e4-e785-77d2-9966-c3cff31d0a0e/rbac/clients/019b4b9d-d300-736b-8601-153b3d9f70ee/password/change" \
-H "X-API-KEY: <your_api_key>" \
-H "Content-Type: application/json" \
-d '{"current_password": "what-they-typed-now", "new_password": "what-they-chose"}'
Response (400, wrong current password)
{
"error": "The current password is wrong.",
"fields": {
"current_password": "The current password is wrong."
}
}
Was this helpful?