> For the complete documentation index, see [llms.txt](https://qbits-organization.gitbook.io/buildwise-doc/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://qbits-organization.gitbook.io/buildwise-doc/authentication/password-reset.md).

# Password Reset

### **Prerequisites:**

* User account must exist
* Account must be verified (`isVerified = true`)
* Email must be verified (`isEmailVerified = true`)

**Response Codes:**

* `200` - Reset OTP sent successfully
* `400` - Account not verified
* `404` - User not found

***

### Request Password Reset OTP

Initiates the password reset process for verified user accounts.

**Endpoint:** `POST /api/v1/auth/psw-request-otp`

**Request Body:**

```json
{
  "email": "user@example.com"
}
```

### Verify OTP and Reset Password

Completes the password reset process with OTP verification.

**Endpoint:** `POST /api/v1/auth/verify-otp-and-reset`

**Request Body:**

```json
{
  "email": "user@example.com",
  "code": "123456",
  "newPassword": "NewSecurePassword@123"
}
```

**Password Requirements:**

* Minimum 8 characters
* At least one uppercase letter (A-Z)
* At least one lowercase letter (a-z)
* At least one digit (0-9)
* At least one special character (@$!%\*?\&#)

**Response Codes:**

* `200` - Password reset completed successfully
* `400` - OTP expired
* `403` - Invalid OTP or email
* `422` - Password validation failed
