API reference

User MFA and devices

Reset a user's MFA, remove or change their methods, make backup codes and trust or untrust their devices.

These routes look after one user's sign-in security when they cannot do it themselves, for example after a lost phone. They take the app key (or a workspace key above the app). No recent sign-in by the user is asked for, since the caller is not the user.

The user is told by email when an admin resets their MFA, removes a method, makes new backup codes or trusts a device again. Each change is recorded as an event.

The MFA view#

The MFA routes answer with the user's MFA state:

MFA viewjson
{  "mfa_enabled": true,  "enrollments": [    {      "id": "0193f960-aaaa-7bbb-8ccc-000000000001",      "method": "totp",      "name": "Authenticator app",      "verified": true,      "is_default": true,      "last_used_at": "2026-11-17T08:01:12Z",      "created_at": "2026-10-02T14:22:00Z"    }  ],  "backup_codes_remaining": 8,  "backup_codes_total": 10}
FieldMeaning
mfa_enabledtrue when the user has at least one verified method.
enrollments[].methodtotp, sms, email, webauthn or push.
enrollments[].verifiedfalse for a method the user started but did not finish setting up.
backup_codes_remainingUnused backup codes.

Errors#

Every route on this page except Stop trusting a device can return:

StatusErrorWhen
403protected_userThe user is protected from being signed in as (one of the app's protected roles, or the no_impersonation attribute), so an admin cannot change their sign-in security.
404user_not_foundNo user with that id.

Reset MFA#

DELETE/v1/:app_id/users/:id/mfaApp key

Removes every MFA method and backup code. If the app requires MFA, the user sets it up again at their next sign-in.

cURLbash
curl -X DELETE https://api.scute.io/v1/$SCUTE_APP_ID/users/$USER_ID/mfa \  -H "Authorization: Bearer $SCUTE_APP_SECRET"

Returns 200 with the MFA view.

Remove a method#

DELETE/v1/:app_id/users/:id/mfa/methods/:method_idApp key

Removes one method, even the last one. If it was the default, the user's oldest other verified method becomes the default.

cURLbash
curl -X DELETE https://api.scute.io/v1/$SCUTE_APP_ID/users/$USER_ID/mfa/methods/$METHOD_ID \  -H "Authorization: Bearer $SCUTE_APP_SECRET"

Returns 200 with the MFA view.

StatusErrorWhen
404enrollment_not_foundThe user has no method with that id.

Set the default method#

PATCH/v1/:app_id/users/:id/mfa/methods/:method_id/defaultApp key
cURLbash
curl -X PATCH https://api.scute.io/v1/$SCUTE_APP_ID/users/$USER_ID/mfa/methods/$METHOD_ID/default \  -H "Authorization: Bearer $SCUTE_APP_SECRET"

Returns 200 with the MFA view.

StatusErrorWhen
404enrollment_not_foundThe user has no method with that id.
422unverified_methodThe method is not verified.

Make new backup codes#

POST/v1/:app_id/users/:id/mfa/backup_codesApp key

Replaces the user's backup codes with 10 new ones. The old unused codes stop working. The new codes are in this response only.

cURLbash
curl -X POST https://api.scute.io/v1/$SCUTE_APP_ID/users/$USER_ID/mfa/backup_codes \  -H "Authorization: Bearer $SCUTE_APP_SECRET"
Response 200json
{  "backup_codes": ["4F7A-29D0", "8B2C-7E1F"],  "mfa": { "mfa_enabled": true, "enrollments": [], "backup_codes_remaining": 10, "backup_codes_total": 10 },  "message": "Give these to the person securely. They won't be shown again."}
StatusErrorWhen
422method_not_allowedBackup codes are not among the app's allowed MFA methods.

Trust a device#

POST/v1/:app_id/users/:id/trusted_devices/:device_idApp key

Trusts a device the user has signed in from, for the app's device_trust_days from now. A trusted device skips the "device not trusted" sign-in check. :device_id is the id of an entry in the user's fingerprints.

cURLbash
curl -X POST https://api.scute.io/v1/$SCUTE_APP_ID/users/$USER_ID/trusted_devices/$DEVICE_ID \  -H "Authorization: Bearer $SCUTE_APP_SECRET"
Response 200json
{  "device": {    "id": "0193f970-aaaa-7bbb-8ccc-000000000009",    "ip_address": "203.0.113.7",    "country_code": "US",    "city": "Austin",    "login_count": 14,    "first_seen_at": "2026-09-01T12:00:00Z",    "last_seen_at": "2026-11-18T09:12:44Z",    "trusted": true,    "trusted_at": "2026-11-19T10:00:00Z",    "trust_expires_at": "2026-12-19T10:00:00Z",    "label": "Chrome 131 on Mac"  }}

The example shows a subset of the fields.

StatusErrorWhen
404device_not_foundThe user has no device with that id.
422device_trust_offTrusted devices are off for the app (device_trust_enabled).

Stop trusting a device#

DELETE/v1/:app_id/users/:id/trusted_devices/:device_idApp key

The user's next sign-in from the device gets the "device not trusted" check again. Returns 200 with { "device": ... } as above, with trusted false.

cURLbash
curl -X DELETE https://api.scute.io/v1/$SCUTE_APP_ID/users/$USER_ID/trusted_devices/$DEVICE_ID \  -H "Authorization: Bearer $SCUTE_APP_SECRET"
StatusErrorWhen
404No user with that id.
404device_not_foundThe user has no device with that id.