Forgot Password (OTP)
This endpoint enables users to reset a forgotten password through a secure two-step process. In the first step, the user submits their registered username (nickname) to receive a One-Time Password (OTP) via email. In the second step, the user submits the OTP along with the desired new password to complete the reset.
Endpoint
POST /v3/forgotPasswordOTP
Authentication
Bearer token required. Obtain via:
POST https://api.banking.netevia.dev/api/auth/v2
Include in header: Authorization: Bearer {token}
Token lifetime: 10 minutes. Refresh via POST /api/auth/refresh.
When to use
Use this endpoint when a user cannot log in because they have forgotten their password. The two-step flow ensures that only the registered account owner — who has access to the email associated with the nickname — can complete the reset. Call the endpoint first with only nickName to trigger OTP delivery, then call it again with nickName, code, password, and passwordConfirm to finalize the reset.
Request Body
This endpoint accepts one of two request shapes depending on the step in the flow.
Step 1 — Request OTP (forgotPasswordRequest)
| Field | Type | Required | Description |
|---|---|---|---|
| nickName | string | Yes | The registered username (nickname) of the account requesting a password reset. |
{
"nickName": "[email protected]"
}Step 2 — Set New Password (restorePasswordRequest)
| Field | Type | Required | Description |
|---|---|---|---|
| nickName | string | Yes | The registered username (nickname) of the account. Must match the value used in Step 1. |
| code | string | Yes | The OTP code received via email after Step 1. |
| password | string | Yes | The new password to set for the account. |
| passwordConfirm | string | Yes | Confirmation of the new password. Must match password. |
{
"nickName": "[email protected]",
"code": "847291",
"password": "NewSecureP@ssw0rd!",
"passwordConfirm": "NewSecureP@ssw0rd!"
}Response
200 OK
| Field | Type | Description |
|---|---|---|
| restoreState | string (nullable) | Indicates the current state of the password reset flow (e.g., "OtpSent", "PasswordRestored"). |
| errors | array of strings (nullable) | List of error messages if the request could not be completed. Empty or null on success. |
| success | string (nullable) | A success message confirming the action taken. Null if errors occurred. |
Step 1 — OTP sent response example:
{
"restoreState": "OtpSent",
"errors": null,
"success": "OTP has been sent to the registered email address."
}Step 2 — Password reset response example:
{
"restoreState": "PasswordRestored",
"errors": null,
"success": "Password has been successfully reset."
}Error response example:
{
"restoreState": "Failed",
"errors": [
"Invalid OTP code.",
"OTP has expired."
],
"success": null
}Error Codes
| Code | When it happens |
|---|---|
| 400 | Missing required fields, mismatched passwords, or invalid OTP format |
| 401 | Token missing, expired, or invalid |
| 403 | Insufficient permissions |
| 404 | No account found for the provided nickName |
| 500 | Internal server error |
Common Mistakes
- Submitting
code,password, andpasswordConfirmin the Step 1 request — Step 1 only requiresnickName; additional fields will be ignored or may cause a validation error. - Sending
passwordandpasswordConfirmwith different values — both fields must match exactly or the reset will be rejected. - Reusing an OTP after it has already been consumed or after it has expired — request a fresh OTP by calling Step 1 again.
- Using the wrong
nickNamein Step 2 — thenickNamemust match exactly what was used in Step 1 when the OTP was issued.
Related Endpoints
POST /api/auth/v2— Obtain a Bearer token by authenticating with username, password, and partnerIdPOST /api/auth/refresh— Refresh an existing Bearer token before it expires
Example
Step 1 — Request OTP:
curl -X POST https://api.banking.netevia.dev/v3/forgotPasswordOTP \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"nickName": "[email protected]"
}'Step 2 — Set New Password:
curl -X POST https://api.banking.netevia.dev/v3/forgotPasswordOTP \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"nickName": "[email protected]",
"code": "847291",
"password": "NewSecureP@ssw0rd!",
"passwordConfirm": "NewSecureP@ssw0rd!"
}'