Second factor with an authenticator app (TOTP): replaces the code session with an mfa-level one
POST
/v1/auth/mfa/totp
const url = 'https://api.replifier.com/v1/auth/mfa/totp';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"code":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.replifier.com/v1/auth/mfa/totp \ --header 'Content-Type: application/json' \ --data '{ "code": "example" }'RFC 6238, 6 digits, window ±1; each code can be used once. From the fifth failed attempt on, each attempt adds a wait of 1, 2, 4… up to 60 min (429 code_attempts with Retry-After) and an email alert is sent; the count resets after 24 h without attempts or on a success (it is never permanent). A recovery code (/v1/auth/mfa/recovery) counts toward the same count.
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
code
required
string
Example generated
{ "code": "example"}Responses
Section titled “Responses”Two-factor session
Media typeapplication/json
object
session
required
object
id
required
string
expiresAt
required
string
authLevel
required
string
Example generated
{ "session": { "id": "example", "expiresAt": "example", "authLevel": "example" }}Invalid data
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
cause
required
string
fix
required
string
requestId
required
string
Example
{ "error": { "code": "not_found" }}No session, expired session, or invalid, expired or revoked API key
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
cause
required
string
fix
required
string
requestId
required
string
Example
{ "error": { "code": "not_found" }}Not allowed, API key missing the scope, IP not allowed, or request rejected (csrf_rejected)
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
cause
required
string
fix
required
string
requestId
required
string
Example
{ "error": { "code": "not_found" }}Too many attempts
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
cause
required
string
fix
required
string
requestId
required
string
Example
{ "error": { "code": "not_found" }}Internal error
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
cause
required
string
fix
required
string
requestId
required
string
Example
{ "error": { "code": "not_found" }}