Change Password
The Change Password endpoint allows authenticated users to securely update their account password. The request requires the user's current password along with a new password and confirmation, ensuring that only the rightful account owner can perform the change. Once successfully processed, the new password takes effect immediately.
Endpoint
POST /changePassword
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 wishes to update their login credentials from within an authenticated session. This is appropriate for user-initiated password changes in account settings flows. It is not intended for password reset scenarios where the user has lost access to their account.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| currentPassword | string | Yes | The user's existing password. Minimum length: 1 character. |
| password | string | Yes | The new password the user wants to set. Must meet platform password strength requirements. Minimum length: 1 character. |
| passwordConfirm | string | Yes | Confirmation of the new password. Must match the password field exactly. Minimum length: 1 character. |
{
"currentPassword": "OldP@ssw0rd!",
"password": "NewP@ssw0rd#2025",
"passwordConfirm": "NewP@ssw0rd#2025"
}Response
200 OK
A 200 status code indicates the password was changed successfully. The response body is empty on success.
{}Error Codes
| Code | When it happens |
|---|---|
| 400 | Missing required fields, password and passwordConfirm do not match, or new password fails strength requirements |
| 401 | Token missing, expired, or invalid |
| 403 | Insufficient permissions |
| 404 | Resource not found |
| 500 | Internal server error |
Common Mistakes
- Providing a
passwordandpasswordConfirmthat do not match — both fields must be identical. - Sending an incorrect
currentPassword— the current password must exactly match the account's existing password. - Using an expired Bearer token — tokens expire after 10 minutes; refresh before making this call.
- Choosing a new password that fails platform strength requirements (e.g., too short or missing required character types).
Related Endpoints
POST /api/auth/v2— Obtain a new Bearer token using username and password credentialsPOST /api/auth/refresh— Refresh an existing Bearer token before it expires
Example
curl -X POST https://api.banking.netevia.dev/changePassword \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"currentPassword": "OldP@ssw0rd!",
"password": "NewP@ssw0rd#2025",
"passwordConfirm": "NewP@ssw0rd#2025"
}' 200Success
