User authentication code
The second step of multi-factor authentication, verifying or resending the emailed code.
When an account has multi-factor authentication enabled, user/auth does not return a usable session. It returns type: "second_factor_required" and a limited hash, and emails a code to the address the account registered with.
These two operations finish that exchange: one verifies the code and returns an ordinary session hash, the other sends the code again.
Both require the multi-factor session hash issued part-way through user/auth, not an ordinary session hash and not an API key.
API actions
API base path: /user/auth/code.
Operations that list no errors of their own return only the general error codes.
Complete a multi-factor authentication challenge by submitting the code that was sent to the user.
Requires an MFA session, which is issued part-way through authentication. An ordinary session hash or API key cannot call this operation.
Either a user session hash or an API key, with the "NVX " prefix, for example "NVX 22eac1c27af4be7b9d04da2ce1af111b". Obtain a session hash from the userAuth operation, or create an API key from the API keys operations. A small number of operations accept a session hash only and reject an API key with error code 4; each says so in its description.
The verification code sent to the user.
Authentication completed
true if request finished successfully.
trueSession hash for the authenticated session.
Bad request. The response body carries the API-level error code in status.code. Validation failures also include an errors array naming each offending parameter.
Error response object
POST /v2/user/auth/code/verify HTTP/1.1
Host: api.eu.navixy.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 15
{
"code": "text"
}{
"success": true,
"hash": "text"
}Errors
These errors come in addition to the general error codes:
282 - Wrong authentication code.
Resending has its own five-minute rate limit, to prevent abuse.
Send the multi-factor authentication code again.
Rate limited to one call every 5 minutes to prevent abuse.
Requires an MFA session, which is issued part-way through authentication. An ordinary session hash or API key cannot call this operation.
Either a user session hash or an API key, with the "NVX " prefix, for example "NVX 22eac1c27af4be7b9d04da2ce1af111b". Obtain a session hash from the userAuth operation, or create an API key from the API keys operations. A small number of operations accept a session hash only and reject an API key with error code 4; each says so in its description.
Code resent
true if request finished successfully.
trueBad request. The response body carries the API-level error code in status.code. Validation failures also include an errors array naming each offending parameter.
Error response object
POST /v2/user/auth/code/resend HTTP/1.1
Host: api.eu.navixy.com
Authorization: YOUR_API_KEY
Accept: */*
{
"success": true
}Last updated
Was this helpful?