Skip to main content

Reset Password API

Overview

Resets the user's password using the reset token received via email. Validates token expiration (10-minute validity) and confirms matching new passwords before updating passwordHash.

  • Endpoint: /api/auth/reset-password
  • Method: POST or GET
  • Auth Required: No (Public)

Request Parameters (Body / Query)

FieldTypeRequiredDescription
resetTokenStringYes (or token)Password reset token from email link
passwordStringYesNew password (min 6 characters)
confirmPasswordStringYesConfirmation matching password

Example Request Body

{
"resetToken": "a1b2c3d4e5",
"password": "NewSecurePassword123!",
"confirmPassword": "NewSecurePassword123!"
}

Responses

Success Response (200 OK)

{
"success": true,
"message": "Password Updated",
"data": null
}

Timeout Error (400 Bad Request)

{
"success": false,
"message": "Reset Password timed out",
"data": null
}

Invalid Token Error (400 Bad Request)

{
"success": false,
"message": "User not found",
"data": null
}