User Password Reset API
Update User Password
Update the password of a user based on their roll number.
Request
- Method: POST
- Can be accessed by: ADMIN, SUPERADMIN
- URL:
/api/user/reset-password
- Headers:
- Authorization: Bearer
<access_token>
- Authorization: Bearer
- Body:
{ "rollNumber": "123456", "newPassword": "password" }
Response
- Status: 200 OK
- Body:
{ "success": true, "data": "Password updated successfully", "error": null }
Error Responses
-
Unauthorized Access
- Status: 401 Unauthorized
- Body:
{ "success": false, "data": null, "error": "Unauthorized" }
-
Invalid Request Body
- Status: 400 Bad Request
- Body:
{ "success": false, "data": null, "error": "Invalid Request Body. Required fields: rollNumber, newPassword" }
-
User Not Found
- Status: 400 Bad Request
- Body:
{ "success": false, "data": null, "error": "User does not exist" }
-
Server Error
- Status: 500 Internal Server Error
- Body:
{ "success": false, "data": null, "error": "<error_message>" }
where
<error_message>
contains the details of the server error.