Step 1: Request Password Reset
Forgot Password
Send a password reset link to the user’s email address.
Request Reset Link
Request Parameters
Email address of the account to reset. Case-insensitive.
Response
Indicates if the request was successful
Generic message to prevent email enumeration: “If your email is registered, you will receive a password reset link”
Contains the same message as above
Example Request
Example Response
Reset Email Details
- Reset token is valid for 1 hour
- Email contains a link in the format:
{FRONTEND_URL}/reset-password?token=<reset_token> - Tokens are securely hashed using SHA-256 before storage
- The same success message is returned whether or not the email exists (security best practice)
Step 2: Reset Password
Reset Password
Use the reset token from the email to set a new password.
Set New Password
Request Parameters
The reset token received in the email (extracted from the URL query parameter)
The new password. Must meet security requirements:
- Minimum 8 characters
- At least one uppercase letter
- At least one lowercase letter
- At least one number
Response
Indicates if the password reset was successful
Response message (“Password reset successful”)
Contains the success message
Example Request
Example Response
After Password Reset
- All existing sessions are automatically revoked
- User must log in again with the new password
- A confirmation email is sent to the user
- The reset token is invalidated and cannot be reused
Error Responses
401 - Account Inactive (Forgot Password)
401 - Account Inactive (Forgot Password)
Returned when attempting to reset password for an inactive account.
400 - Invalid Email (Forgot Password)
400 - Invalid Email (Forgot Password)
Returned when the email format is invalid.
400 - Token Invalid or Expired (Reset Password)
400 - Token Invalid or Expired (Reset Password)
Returned when the reset token is invalid, expired, or already used.
400 - Weak Password (Reset Password)
400 - Weak Password (Reset Password)
Returned when the new password doesn’t meet security requirements.
Security Features
- Reset tokens are hashed using SHA-256 before storage
- Tokens expire after 1 hour
- Generic success messages prevent email enumeration attacks
- All sessions are revoked after password reset
- Password change notifications are sent to the user’s email
- Failed reset attempts are logged
