POST /api/auth/two-factor/verify-backup-code
No operationId in openapi.json · page id post-api-auth-two-factor-verify-backup-code
Verify a backup code for two-factor authentication
Authentication
Signed-in operator session (browser)
Actual native human session; protected management also requires recent successful factor authentication.
Signed-in operator session (browser)
Native one-use password-to-TOTP sign-in challenge.
Request body
application/json
codestringrequiredA backup code to verify. Eg: "123456"
disableSessionfalseOnly false or omission is accepted; the native session cookie cannot be skipped.
trustDevicefalseOnly false or omission is accepted; successful factor verification cannot be skipped.
Responses
200 Backup code verified successfully
userobjectrequiredThe authenticated user object with two-factor details
idstringrequiredUnique identifier of the user
emailstring (email) | nullUser's email address
emailVerifiedboolean | nullWhether the email is verified
namestring | nullUser's name
imagestring (uri) | nullUser's profile image URL
twoFactorEnabledbooleanrequiredWhether two-factor authentication is enabled for the user
createdAtstring (date-time)requiredTimestamp when the user was created
updatedAtstring (date-time)requiredTimestamp when the user was last updated
tokenstringrequiredNative session token; use the session cookie.
400 Bad Request. Usually due to missing parameters, or invalid parameters.
messagestringrequired
401 Unauthorized. Due to missing or invalid authentication.
messagestringrequired
403 Forbidden. You do not have permission to access this resource or to perform this action.
messagestring
404 Not Found. The requested resource was not found.
messagestring
429 Too Many Requests. You have exceeded the rate limit. Try again later.
messagestring
500 Internal Server Error. This is a problem with the server that you cannot fix.
messagestring