API reference

MFA

Enroll, verify, list and remove a person's second factors, check MFA status and generate backup codes.

These routes manage the signed-in person's own second factors. They take the access token in X-Authorization, or a setup token in X-Scute-Setup-Token during a sign-in that requires a factor first (see MFA setup required).

The app decides which factors are allowed (by default totp, sms, email and backup_codes) and whether MFA is disabled, optional or required. To pass an MFA step during sign-in, see Sign-in steps.

Recent verification#

Removing a factor, generating backup codes, and enrolling a factor when the person already has a verified one need a recent verification. The session must have been created within the app's re-verify window (10 minutes by default). Otherwise send challenge: the token of a completed verification challenge of the person's, completed in the last 10 minutes and not used before.

Statuserror_codeWhen
403verification_requiredNo recent sign-in and no challenge. details.recent_sign_in_minutes is the window.
403verification_invalidThe challenge is unknown, not the person's, not complete, too old, of the wrong kind, or already used.

List enrolled factors#

GET/v1/auth/:app_id/mfa/methodsAccess token
cURLbash
curl https://api.scute.io/v1/auth/$SCUTE_APP_ID/mfa/methods \  -H "X-Authorization: Bearer $ACCESS_TOKEN"
Response 200json
{  "methods": [    {      "id": "0193fc30-4e5f-7a6b-8c7d-8e9f0a1b2c3d",      "method": "totp",      "name": "Authenticator app",      "verified": true,      "is_default": true,      "last_used_at": "2026-11-18T09:12:44Z",      "created_at": "2026-10-02T16:20:00Z"    }  ],  "backup_codes_available": 8,  "mfa_enabled": true}

mfa_enabled is true when the person has at least one verified factor.

Check MFA status#

GET/v1/auth/:app_id/mfa/statusNone

With identifier, needs no credential. Without it, send the access token and get the signed-in person's status.

identifierstring
Email or phone to check.
cURLbash
curl "https://api.scute.io/v1/auth/$SCUTE_APP_ID/mfa/status?identifier=ada@example.com"
Response 200json
{  "mfa_required": true,  "mfa_enabled": true,  "available_methods": ["totp", "backup_codes"],  "in_grace_period": false}

For an identifier with no account, mfa_required reflects the app's policy, mfa_enabled is false and available_methods is empty. An invalid identifier returns 400 invalid_identifier.

Start enrollment#

POST/v1/auth/:app_id/mfa/enrollAccess token

Creates an unverified factor. An earlier unverified factor of the same method is replaced.

methodstringrequired
totp, sms or email. Must be allowed by the app.
secret_datastring
For sms, the phone number. For email, the address (default: the person's email).
namestring
A name for the factor.
challengestring
Token of a completed verification, when a recent verification is needed.
cURLbash
curl -X POST https://api.scute.io/v1/auth/$SCUTE_APP_ID/mfa/enroll \  -H "X-Authorization: Bearer $ACCESS_TOKEN" \  -H "Content-Type: application/json" \  -d '{"method": "totp", "name": "Authenticator app"}'
Response 201json
{  "enrollment": {    "id": "0193fc30-4e5f-7a6b-8c7d-8e9f0a1b2c3d",    "method": "totp",    "name": "Authenticator app",    "verified": false,    "is_default": false,    "last_used_at": null,    "created_at": "2026-11-19T14:04:05Z"  },  "provisioning_uri": "otpauth://totp/Acme:ada%40example.com?secret=JBSWY3DPEHPK3PXP&issuer=Acme",  "secret": "JBSWY3DPEHPK3PXP"}

For totp, show provisioning_uri as a QR code, or secret for manual entry. Both are returned only here. For sms and email, Scute sends a code to the phone or address.

Statuserror_codeWhen
401authentication_requiredNo valid access token or setup token.
422method_not_allowedThe app does not allow the method, or it cannot finish this sign-in.
422enrollment_failedThe factor could not be saved, for example the person already has this method.

Verify enrollment#

POST/v1/auth/:app_id/mfa/enroll/verifyAccess token
enrollment_idstringrequired
The enrollment.id from Start enrollment.
codestringrequired
The code from the authenticator app, SMS or email.
cURLbash
curl -X POST https://api.scute.io/v1/auth/$SCUTE_APP_ID/mfa/enroll/verify \  -H "X-Authorization: Bearer $ACCESS_TOKEN" \  -H "Content-Type: application/json" \  -d '{"enrollment_id": "0193fc30-4e5f-7a6b-8c7d-8e9f0a1b2c3d", "code": "482913"}'

Returns { "enrollment": { ... } } with verified: true. With a setup token, it also makes the factor the default, ends the sign-in and returns the token set with enrollment added.

Statuserror_codeWhen
401setup_expiredThe setup pass expired or was already used.
404enrollment_not_foundNo factor with that ID for this person.
422invalid_codeWrong code.

Set the default factor#

PATCH/v1/auth/:app_id/mfa/methods/:id/defaultAccess token

The default factor is the one a sign-in asks for first.

cURLbash
curl -X PATCH https://api.scute.io/v1/auth/$SCUTE_APP_ID/mfa/methods/$ENROLLMENT_ID/default \  -H "X-Authorization: Bearer $ACCESS_TOKEN"

Returns { "enrollment": { ... } }. An unverified factor returns 422 unverified_method.

Remove a factor#

DELETE/v1/auth/:app_id/mfa/methods/:idAccess token

Needs a recent verification.

cURLbash
curl -X DELETE https://api.scute.io/v1/auth/$SCUTE_APP_ID/mfa/methods/$ENROLLMENT_ID \  -H "X-Authorization: Bearer $ACCESS_TOKEN"

Returns 204 with no body. Removing the last verified factor when the app requires MFA returns 422 cannot_remove_last_method.

Generate backup codes#

POST/v1/auth/:app_id/mfa/backup-codesAccess token

Generates 10 new backup codes and replaces any earlier ones. Needs a recent verification.

cURLbash
curl -X POST https://api.scute.io/v1/auth/$SCUTE_APP_ID/mfa/backup-codes \  -H "X-Authorization: Bearer $ACCESS_TOKEN"
Response 200json
{  "backup_codes": ["A1B2-C3D4", "9F0E-7D6C", "..."],  "message": "Save these codes securely. They will not be shown again."}

The codes are returned only in this response. When the app does not allow backup codes, the route returns 422 method_not_allowed.

Errors on every route#

Statuserror_codeWhen
401authentication_requiredNo valid access token or setup token.
403impersonatingThe session is a support session opened as this person. Factors can't be changed from it.
403setup_onlyA setup token was sent to a route other than list, enroll or verify enrollment.