PATCH /api/admin/users/:id/password
Reset or change a user’s password. This endpoint allows administrators to set a new password for any user account without requiring the old password.Authentication
This endpoint requires:- Valid JWT token in the Authorization header
- User must have ADMIN role
Path Parameters
UUID of the user whose password should be changed
Request Body
New password for the user (minimum 8 characters recommended)
Response
Returns a success message.Confirmation message
Example Request
cURL
JavaScript
Python
Example Response
Password Security
The new password is automatically:- Hashed using bcrypt with salt rounds (typically 10)
- Never stored in plain text
- Validated for minimum length requirements
The password is hashed on the server before storage. The bcrypt algorithm with salt ensures passwords cannot be reversed or easily cracked.
Error Responses
403 - Forbidden
403 - Forbidden
404 - User Not Found
404 - User Not Found
400 - Invalid Password
400 - Invalid Password
400 - OAuth User
400 - OAuth User
401 - Unauthorized
401 - Unauthorized
Best Practices
Notify User
Send an email notification when password is reset by admin
Log Action
Record admin ID, timestamp, and user ID for audit trail
Temporary Password
Generate a temporary password and require change on first login
Verify Request
Confirm the password reset request is legitimate
Password Requirements
Enforce these password requirements in your application:Minimum Length
Minimum Length
At least 8 characters (configurable in the backend validation)
Recommended Complexity
Recommended Complexity
- At least one uppercase letter
- At least one lowercase letter
- At least one number
- At least one special character
Avoid Common Passwords
Avoid Common Passwords
Check against a list of commonly used passwords
Use Cases
Account Recovery
Help users who forgot their password and can’t receive reset emails
Support Requests
Assist users locked out of their accounts
Security Incidents
Force password change after suspected account compromise
Initial Setup
Set initial passwords for manually created accounts
Security Considerations
Related Endpoints
List Users
View all users in the system
Delete User
Permanently delete a user account
