Auth
Reset password
/auth/resetpassword
PATCH
This endpoint requires authentication. Include your Bearer token in the Authorization header.
Description
/auth/resetpassword Description: The /auth/resetpassword endpoint allows users to reset their password. This endpoint supports two different flows:Flow 1: Forgot Password (Email Code Reset)
Use this flow when the user has forgotten their password and received a reset code via email from/auth/forgotpassword.
- Provide the
codeas a query parameter - Provide
emailandnew_passwordin the request body - No authentication required (the code validates the request)
Flow 2: Change Password (Authenticated)
Use this flow when a logged-in user wants to change their current password.- Provide
email,current_password, andnew_passwordin the request body - Requires valid Bearer token authentication
- The
current_passwordmust match the user’s existing password
PATCH
Password Requirements:
- Minimum 8 characters
- At least one uppercase letter
- At least one lowercase letter
- At least one number
- At least one special character
| Parameter | Type | Description |
|---|---|---|
| code | string | The verification code sent to the user’s email (required for forgot password flow) |
| Parameter | Type | Required | Description |
|---|---|---|---|
| string | Yes | The email address of the user | |
| new_password | string | Yes | The new password to be set |
| confirm_password | string | No | Password confirmation (must match new_password if provided) |
| current_password | string | Conditional | Required for authenticated password change (Flow 2) |
Note: You must provide eithercode(query param) ORcurrent_password(body), but not both.
Code Examples
Authorizations
JWT Authorization header using the Bearer scheme. Format: "Bearer {token}"
Query Parameters
The verification code sent to the user's email (required for forgot password flow)
Body
application/json
The email address of the user
Example:
"user@example.com"
The new password to be set (must meet password complexity requirements)
Example:
"NewSecurePassword123!"
Password confirmation (optional, must match new_password if provided)
Example:
"NewSecurePassword123!"
Current password (required for authenticated password change, not needed if using code)
Example:
"OldPassword123!"
Response
Password reset successful