Skip to content

Enroll Confirm

POST
/api/auth/mfa/enroll/confirm
curl --request POST \
--url https://example.com/api/auth/mfa/enroll/confirm \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "mfa_pending_token": "example", "otp_code": "example" }'

Verify the first TOTP code and activate MFA. If reached via the forced mid-login path (mfa_pending_token with purpose=enroll), this ALSO completes login and issues real session cookies.

Media type application/json
MfaEnrollConfirmRequest
object
mfa_pending_token
Any of:
string
otp_code
required
Otp Code
string
>= 6 characters <= 6 characters /^\d{6}$/
Example generated
{
"mfa_pending_token": "example",
"otp_code": "example"
}

Successful Response

Media type application/json
MfaEnrollConfirmResponse
object
access_token
Any of:
string
backup_codes
required
Backup Codes
Array<string>
expires_in
Any of:
integer
refresh_token
Any of:
string
token_type
Any of:
string
Example generated
{
"access_token": "example",
"backup_codes": [
"example"
],
"expires_in": 1,
"refresh_token": "example",
"token_type": "example"
}

Validation Error

Media type application/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
ctx
Context
object
input
Input
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
Example generated
{
"detail": [
{
"ctx": {},
"input": "example",
"loc": [
"example"
],
"msg": "example",
"type": "example"
}
]
}