API reference

User sign-in security

Reset a user's MFA, end their sessions and manage trusted devices from your backend, and let users manage their own trusted devices.

These endpoints look after one user's sign-in security when they can't do it themselves: a lost phone, a lockout, a session left open. They take the app key (or a workspace key above the app). None of them asks the user for a recent sign-in.

A user protected from impersonation (one of the app's impersonation_protected_roles) can't be changed here: the call returns 403 protected_user. Changes record an event, and the user gets an email for a removed method, a reset, new backup codes and a device trusted again.

Common errors:

Statuserror_codeWhen
404user_not_foundNo user with that ID in the app
403protected_userThe user is protected
403workspace_admin_requiredA signed-in team member who is not an owner or admin

The MFA endpoints return the user's MFA state:

MFA statejson
{  "mfa_enabled": true,  "enrollments": [    {      "id": "0193fa10-1111-7222-8333-444444444444",      "method": "totp",      "name": "Authenticator app",      "verified": true,      "is_default": true,      "last_used_at": "2026-11-18T09:12:00Z",      "created_at": "2026-10-01T10:00:00Z"    }  ],  "backup_codes_remaining": 8,  "backup_codes_total": 10}

MFA#

Reset MFA#

Removes every MFA method and backup code. With MFA required, the user sets it up again at the next sign-in.

DELETE/v1/:app_id/users/:id/mfaApp key
Requestbash
curl -X DELETE https://api.scute.io/v1/$SCUTE_APP_ID/users/0193f900-aaaa-bbbb-cccc-eeeeeeeeeeee/mfa \  -H "Authorization: Bearer $SCUTE_APP_SECRET"

Returns 200 with the MFA state.

Remove an MFA method#

Removes one method, the last one too. When the default goes, the user's oldest other verified method becomes the default.

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

Returns 200 with the MFA state, or 404 enrollment_not_found.

Set the default MFA method#

PATCH/v1/:app_id/users/:id/mfa/methods/:method_id/defaultApp key

Returns 200 with the MFA state. 422 unverified_method when the user did not finish setting the method up.

Create backup codes#

New codes replace the old unused ones. The codes are in this response only.

POST/v1/:app_id/users/:id/mfa/backup_codesApp key
Response 200json
{  "backup_codes": ["4F7A-29C1", "8E3B-61D0"],  "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."}

Returns 422 method_not_allowed when the app does not allow backup codes.

Sessions#

End all sessions#

Signs the user out everywhere.

DELETE/v1/:app_id/users/:id/sessionsApp key
Requestbash
curl -X DELETE https://api.scute.io/v1/$SCUTE_APP_ID/users/0193f900-aaaa-bbbb-cccc-eeeeeeeeeeee/sessions \  -H "Authorization: Bearer $SCUTE_APP_SECRET"
Response 200json
{ "ended": 3 }

Each ended session records a session.revoked event.

Trusted devices#

A trusted device skips attack protection's untrusted device check for the app's device_trust_days. See Attack protection.

Trust a device again#

Trusts a device the user has signed in from, for device_trust_days from now.

POST/v1/:app_id/users/:id/trusted_devices/:device_idApp key
Requestbash
curl -X POST https://api.scute.io/v1/$SCUTE_APP_ID/users/0193f900-aaaa-bbbb-cccc-eeeeeeeeeeee/trusted_devices/0193fa20-1111-7222-8333-444444444444 \  -H "Authorization: Bearer $SCUTE_APP_SECRET"
Response 200json
{  "device": {    "id": "0193fa20-1111-7222-8333-444444444444",    "fingerprint_hash": "c1f0...",    "ip_address": "198.51.100.20",    "country_code": "US",    "city": "Austin",    "latitude": 30.27,    "longitude": -97.74,    "login_count": 14,    "first_seen_at": "2026-09-02T08:00:00Z",    "last_seen_at": "2026-11-18T09:12:00Z",    "trusted": true,    "trusted_at": "2026-11-19T14:00:00Z",    "trust_expires_at": "2026-12-19T14:00:00Z",    "label": "Chrome on macOS"  }}

Returns 404 device_not_found, or 422 device_trust_off when the app has trusted devices off.

Stop trusting a device#

The user's next sign-in from it gets the untrusted device check again.

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

Returns 200 with device in the shape above, or 404 device_not_found.

The signed-in user's trusted devices#

These take the user's access token in X-Authorization. An M2M token is refused: it has no person. Trusting and untrusting are refused while someone is signed in as the user (403 impersonating).

List the user's devices#

GET/v1/auth/:app_id/trusted_devicesAccess token
Requestbash
curl https://api.scute.io/v1/auth/$SCUTE_APP_ID/trusted_devices \  -H "X-Authorization: Bearer $ACCESS_TOKEN"
Response 200json
{  "devices": [    {      "id": "0193fa20-1111-7222-8333-444444444444",      "label": "Chrome on macOS",      "city": "Austin",      "country_code": "US",      "first_seen_at": "2026-09-02T08:00:00Z",      "last_seen_at": "2026-11-18T09:12:00Z",      "trusted": false,      "trusted_at": null,      "trust_expires_at": null,      "current": true    }  ],  "current_device": { "id": "0193fa20-1111-7222-8333-444444444444", "trusted": false, "can_trust": true, "reason": null },  "device_trust": { "enabled": true, "days": 30 }}

Up to 100 devices, most recently seen first. current_device.reason says why the current device can't be trusted: device_trust_off, second_factor_required or device_unknown.

Trust the current device#

Trusts the device this session signed in from. The session must come from a sign-in that passed a second factor.

POST/v1/auth/:app_id/trusted_devicesAccess token

Returns 201 with device.

Statuserror_codeWhen
403device_trust_offThe app does not let people trust devices
403second_factor_requiredThe session did not pass a second factor
422device_unknownThe sign-in sent no device fingerprint

Stop trusting one of the user's devices#

DELETE/v1/auth/:app_id/trusted_devices/:idAccess token

Returns 200 with device, or 404 device_not_found.