Change Phone for Personal Account Holder with OTP
This endpoint allows personal account holders to securely update their phone number by providing a one-time password (OTP). The OTP verifies the account holder's identity before applying the change, ensuring that only the legitimate account owner can modify contact information. This process helps maintain accurate records and strengthens account security.
Endpoint
POST /api/account/changePhoneOtp
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 personal account holder needs to update the phone number on file for their account. Before calling this endpoint, an OTP must have been issued to the user (via the appropriate OTP request flow) so they can provide it to authorize the change. This endpoint is applicable to personal customers only; business account phone updates follow a different flow.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| phone | string | Yes | The new phone number to associate with the account. Minimum length: 1 character. Example: "1234567890". |
| oneTimeCode | string | Yes | The 6-digit OTP received by the account holder to verify their identity. Must match pattern ^\d{6}$. |
| secureOperationType | string | Yes | The type of secure operation being performed. Use "ShortMessageCode" for SMS-based OTP. Allowed values: ShortMessageCode, TimeBasedCode, LegacyTimeBasedCode. |
{
"phone": "1234567890",
"oneTimeCode": "482931",
"secureOperationType": "ShortMessageCode"
}Response
200 OK
A 200 Success response indicates the phone number was successfully updated. No response body fields are returned.
{}Error Codes
| Code | When it happens |
|---|---|
| 400 | Missing required fields, invalid OTP format, or phone number fails validation |
| 401 | Token missing, expired, or invalid |
| 403 | Insufficient permissions or OTP mismatch/expired |
| 404 | Account not found |
| 500 | Internal server error |
Common Mistakes
- Submitting a
oneTimeCodethat does not match the 6-digit pattern (^\d{6}$) — the value must be exactly 6 numeric digits. - Using the wrong
secureOperationTypevalue; for standard SMS OTP, always use"ShortMessageCode". - Calling this endpoint without first triggering an OTP send, resulting in an invalid or expired code error.
- Attempting to use this endpoint for business account holders — this endpoint is for personal customers only.
Related Endpoints
POST /api/account/changePhone— Change phone number for a personal account holder without OTP (non-secured variant)POST /api/auth/v2— Obtain a Bearer authentication tokenPOST /api/auth/refresh— Refresh an existing Bearer token
Example
curl -X POST https://api.banking.netevia.dev/api/account/changePhoneOtp \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"phone": "1234567890",
"oneTimeCode": "482931",
"secureOperationType": "ShortMessageCode"
}' 200Success
