Password
Updates a password. The endpoint has two modes, selected by which fields are present in the request body:
Administrator mode — user.id and user.new_password are supplied.
Requires administrator privileges.
The caller must not target their own account: administrators change their own password through user mode.
The response is the updated user document.
User mode — user.new_password and user.old_password are supplied.
Requires the current password in
old_password. If it does not match, the endpoint responds403with an empty body.The response is the updated user document.
In both modes the new password must be at least 6 characters long.
Password update payload. The endpoint has two modes, chosen by which fields are present:
- Administrator mode: include
user.idanduser.new_password. The caller must hold administrator privileges and must not target their own account (administrators change their own password through user mode). - User mode: include
user.new_passwordanduser.old_password. The caller changes their own password and must supply the current one.
Password updated
Unauthorized
Forbidden. Emitted with an empty body when the caller is authenticated but supplies an incorrect current password in user mode.
Not found
Unprocessable Entity
Internal Server Error
PUT /api/password HTTP/1.1
Content-Type: application/json
Accept: */*
Content-Length: 46
{
"user": {
"id": 42,
"new_password": "s3cr3t-new"
}
}{
"data": {
"groups": [],
"id": 42,
"role": "user",
"user_name": "john.doe"
}
}Updates a password. The endpoint has two modes, selected by which fields are present in the request body:
Administrator mode — user.id and user.new_password are supplied.
Requires administrator privileges.
The caller must not target their own account: administrators change their own password through user mode.
The response is the updated user document.
User mode — user.new_password and user.old_password are supplied.
Requires the current password in
old_password. If it does not match, the endpoint responds403with an empty body.The response is the updated user document.
In both modes the new password must be at least 6 characters long.
Password update payload. The endpoint has two modes, chosen by which fields are present:
- Administrator mode: include
user.idanduser.new_password. The caller must hold administrator privileges and must not target their own account (administrators change their own password through user mode). - User mode: include
user.new_passwordanduser.old_password. The caller changes their own password and must supply the current one.
Password updated
Unauthorized
Forbidden. Emitted with an empty body when the caller is authenticated but supplies an incorrect current password in user mode.
Not found
Unprocessable Entity
Internal Server Error
PATCH /api/password HTTP/1.1
Content-Type: application/json
Accept: */*
Content-Length: 46
{
"user": {
"id": 42,
"new_password": "s3cr3t-new"
}
}{
"data": {
"groups": [],
"id": 42,
"role": "user",
"user_name": "john.doe"
}
}Last updated