API operation · auth group
POST
/auth/second-factor/confirm
First published 3 Oct 2026
0.1.0Unchanged since publicationConfirm the caller's pending second factor
Who may call it
AdministratorResellerCustomer
Token scope
AnyAnswers200 OK
Send the six-digit code from the authenticator app in code. Surrounding whitespace is allowed. A missing code or a code in any other format returns 400.
After confirmation, signing in requires a second step. The response contains eight single-use recovery codes, shown only once. Each code can replace an authenticator app code for one sign-in.
On a server that requires a second factor for administrators, confirmation grants the all scope to the session used for the request if that session was opened solely for enrolment and its scopes are still empty. The all scope excludes export, which covers export and import.
As a command
Run as root on the servercodestring, up to 16 charactersRequiredSix-digit code displayed by the authenticator app.
Example
See the API overview for how to set $API and $TOKEN.Request
curl -sS -X POST "$API/auth/second-factor/confirm" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"code": "text"
}'Response ·
200 OK{
"confirmed_at": "text",
"enabled": true,
"recovery_codes": [
"text"
]
}Errors
11 errors, each a status and a sentence400--code is the six digits the app shows400--name is required400Invalid id400Invalid username: 2 to 32 lowercase letters, digits or underscores, starting with a letter400The code does not match; check the secret in the app and the clock of the device400The code is the six digits the app shows400Unknown scope '<s>'; the scopes are 400Username '<value>' is reserved401Authentication required404User '<name>' not found409User '<name>' has no enrolment pending; start one firstNo error of this operation matches.
Generated from release 0.2.35 (current) · the API’s own descriptionThis entry has been unchanged since it was first published in release 0.1.0 on 3 Oct 2026.
urbestack.com/docs/api/post-auth-second-factor-confirm/