Skip to content

Second factor with an authenticator app (TOTP): replaces the code session with an mfa-level one

POST
/v1/auth/mfa/totp
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.

Media typeapplication/json
object
code
required
string
/^\d{6}$/

Example generated

{
"code": "example"
}

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"
}
}