Update a user
Any signed in user. Patches a user; an admin may move the role, branch, and active flag. A pharmacist may edit only their own name and phone, and the password is refused here.
PUT
/api/v1/users/{userId}Authorization
AuthorizationBearer token (JWT) · headerrequiredJWT from POST /api/v1/auth/login sent as Authorization Bearer.
Path parameters
userIdstringrequiredThe user being updated.
Request body
requiredapplication/jsonfull_namestringphonestringrolestringbranch_idstringis_activebooleanResponses
200
User updated
idstringrequiredbranch_idstringrequiredemailstringrequiredfull_namestringrequiredphonestringrequiredrolestringrequiredis_activebooleanrequiredlast_login_atstring | nullrequiredcreated_atstringrequiredupdated_atstringrequiredbranch_namestring | nullrequired400
No valid fields, a supplied field fails validation, the password is refused here, or the branch does not exist or is inactive
detailstringrequired401
Not authenticated
detailstringrequired403
Access forbidden
detailstringrequired404
User not found
detailstringrequired