Authorize by Multi-Factor Authentication

Authorize by Multi-Factor Authentication

The POST /api/auth/v2/2Fac endpoint completes Multi-Factor Authentication (MFA) by validating a one-time code delivered to the user's registered device alongside their primary credentials. Upon successful verification, it returns a Bearer token that authorizes subsequent API requests. This endpoint is the second step in an MFA-enabled authentication flow that follows the initial credential submission.

Endpoint

POST /api/auth/v2/2Fac

Authentication

This endpoint does not require a pre-existing Bearer token — it is part of the login flow. A Bearer token is issued upon successful completion of MFA.

When to use

Use this endpoint when your integration enforces Multi-Factor Authentication for partner users or administrators logging into the Netevia Banking API. After the user submits their username and password through the primary auth flow and receives a ticket referencing the pending MFA challenge, call this endpoint with that ticket and the one-time code to complete the authentication process and obtain a usable Bearer token.

Request Body

FieldTypeRequiredDescription
usernamestringYesThe user's login username. Minimum length: 1.
passwordstringYesThe user's login password. Minimum length: 1.
ticketstringYesThe MFA session ticket received from the initial authentication step. Minimum length: 1.
codestringYesThe one-time authentication code (OTP) delivered to the user's registered device or authentication app. Minimum length: 1.
remember30daybooleanNoWhen true, extends the trusted-device window for 30 days so MFA is not required on subsequent logins from the same device.
{
  "username": "[email protected]",
  "password": "S3cur3P@ssw0rd!",
  "ticket": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "code": "847291",
  "remember30day": false
}

Response

200 OK

FieldTypeDescription
tokenstring (nullable)The Bearer token to include in the Authorization header for all subsequent API requests. Valid for 10 minutes.
expirationstring (date-time)ISO 8601 UTC timestamp indicating when the token expires.
userIdinteger (int32)Internal numeric identifier of the authenticated user.
{
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTYiLCJuYW1lIjoianNtaXRoQGV4YW1wbGUuY29tIiwiaWF0IjoxNzQ5Mzk5NjAwfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
  "expiration": "2026-06-08T14:30:00Z",
  "userId": 123456
}

Error Codes

CodeWhen it happens
400Missing required fields (username, password, ticket, or code), or fields fail minimum-length validation
401The provided code is invalid or expired, or the ticket does not match an active MFA session
403The user account is locked or MFA attempts have been exceeded
404The MFA session referenced by ticket was not found
500Internal server error

Common Mistakes

  • Submitting the code after it has expired — OTP codes are time-limited (typically 30–60 seconds for TOTP or a few minutes for SMS/email codes); request a new code if needed.
  • Reusing a ticket from a previous MFA session — each ticket is single-use and tied to one authentication attempt; restart the login flow to obtain a fresh ticket.
  • Omitting the ticket field — the ticket is required to correlate this MFA step with the preceding credential submission; without it the request will return a 400 error.
  • Setting remember30day: true on shared or public devices — this bypasses MFA for 30 days on that device and should only be used on trusted personal devices.

Related Endpoints

  • POST /api/auth/v2 — Initial authentication step; submit username, password, and partnerId to begin the login flow and receive the MFA ticket.
  • POST /api/auth/refresh — Refresh an existing Bearer token before it expires (10-minute lifetime) to maintain an active session.

Example

curl -X POST https://api.banking.netevia.dev/api/auth/v2/2Fac \
  -H "Content-Type: application/json" \
  -d '{
    "username": "[email protected]",
    "password": "S3cur3P@ssw0rd!",
    "ticket": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "code": "847291",
    "remember30day": false
  }'
Body Params
string
required
length ≥ 1
string
required
length ≥ 1
string
required
length ≥ 1
string
required
length ≥ 1
boolean
Headers
string
enum
Defaults to application/json

Generated from available response content types

Allowed:
string
enum
Defaults to application/json

Generated from available request content types

Allowed:
Response

Language
Credentials
Bearer
JWT
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
text/plain
application/json
text/json