Restore Password
The POST /v2/restorePassword endpoint allows users to securely reset their password by providing a verification code along with a new password. This endpoint is the second step in the forgot-password flow: after requesting a reset code, the user submits that code together with their nickname and the desired new password. The password change takes effect immediately upon success.
Endpoint
POST /v2/restorePassword
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 has forgotten their password and has already initiated the forgot-password flow to receive a reset code. Submit the reset code along with the user's nickname and the new password to complete the password update. This is also appropriate when a partner application needs to facilitate a secure credential reset on behalf of a user.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| nickName | string | Yes | The unique username/nickname identifying the account. Minimum length: 1. |
| code | string | Yes | The verification code received via the forgot-password flow. Minimum length: 1. |
| password | string | Yes | The new password to set. Must meet strength and complexity requirements. Minimum length: 1. |
| passwordConfirm | string | Yes | Confirmation of the new password. Must exactly match password. Minimum length: 1. |
{
"nickName": "johndoe",
"code": "847291",
"password": "NewSecure@Pass1!",
"passwordConfirm": "NewSecure@Pass1!"
}Response
200 OK
| Field | Type | Description |
|---|---|---|
| restoreState | string (nullable) | Indicates the outcome state of the restore operation (e.g., "Success", "Failed"). |
| errors | array of strings (nullable) | List of error messages if the operation encountered validation or processing issues. Empty or null on success. |
| success | string (nullable) | A success message or confirmation string returned when the password is updated successfully. |
{
"restoreState": "Success",
"errors": null,
"success": "Password has been successfully updated."
}Error Codes
| Code | When it happens |
|---|---|
| 400 | Missing required fields, password and passwordConfirm do not match, or new password fails complexity requirements |
| 401 | Token missing, expired, or invalid |
| 403 | Insufficient permissions to perform the password reset |
| 404 | Account with the provided nickName not found |
| 500 | Internal server error |
Common Mistakes
- Submitting a
codethat has expired or was already used — always request a fresh code if the previous one is no longer valid. - Providing a
passwordthat does not matchpasswordConfirm— both fields must be identical character for character. - Using a weak password that does not meet complexity requirements (minimum length, mix of letters, numbers, and symbols).
- Omitting
nickName— this field is required even though it may seem redundant after the forgot-password request step.
Related Endpoints
POST /v2/forgotPassword— Initiates the password reset flow and sends a verification code to the userPOST /api/auth/v2— Authenticates a user and returns a Bearer tokenPOST /api/auth/refresh— Refreshes an existing Bearer token before it expires
Example
curl -X POST https://api.banking.netevia.dev/v2/restorePassword \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"nickName": "johndoe",
"code": "847291",
"password": "NewSecure@Pass1!",
"passwordConfirm": "NewSecure@Pass1!"
}'