API reference

Sign-in steps

The responses a sign-in returns instead of tokens when it owes MFA, a contact confirmation or a security check, and how to finish each.

Any route that completes a first factor (magic link, code, passkey, OAuth, SAML, invitation) can answer with a step instead of a token set. Check the response for these fields before you look for access:

FieldStatusStep
contact_verification_required200The app wants the person's email or phone confirmed first.
mfa_required with mfa_challenge200A second factor is required.
mfa_required with mfa_enrollment_required200A second factor is required and the person has none that counts.
verification_required202Attack protection wants a code from this device.

The steps run in that order: contact first, then MFA.

MFA challenge#

Response 200json
{  "mfa_required": true,  "app_user_id": "0193f900-aaaa-7bbb-8ccc-eeeeeeeeeeee",  "mfa_challenge": {    "token": "ch_Qm3nB5vC7xZ9aS1dF3gH5jK7lP9oI2uY",    "status": "pending",    "purpose": "mfa",    "method": "totp",    "expires_at": "2026-11-19T14:14:05Z",    "remaining_attempts": 3,    "time_remaining": 600,    "delivery_required": false  },  "available_methods": ["totp", "sms", "backup_codes"]}

mfa_challenge.method is the person's default factor. available_methods lists the factors the person can use for this sign-in.

Finish it with the challenge verify route. No app key is needed for an MFA challenge that belongs to a sign-in:

cURLbash
curl -X POST https://api.scute.io/v1/auth/$SCUTE_APP_ID/challenges/$MFA_TOKEN/verify \  -H "Content-Type: application/json" \  -d '{"code": "482913"}'

A correct code returns the token set.

MFA setup required#

When MFA is required and the person has no factor that counts (and any grace period is over), the sign-in returns a setup pass instead of a session:

Response 200json
{  "mfa_required": true,  "mfa_enrollment_required": true,  "app_user_id": "0193f900-aaaa-7bbb-8ccc-eeeeeeeeeeee",  "available_methods": ["totp", "sms"],  "setup_token": "scsetup_8fK2mQ4rT6vX8zA0cE2gI4kM6oQ8sU0wYb3nD5fH7jL9",  "setup_expires_at": "2026-11-19T14:19:05Z"}

Send setup_token in the X-Scute-Setup-Token header (or as setup_token in the body) to Start enrollment and Verify enrollment. Verifying the new factor ends the sign-in and returns the token set. The pass works only on those MFA routes and on List enrolled factors; any other MFA route returns 403 setup_only.

When the app allows no second factor that can follow the first factor used, the sign-in returns 403 mfa_method_unavailable. Change the app's allowed MFA methods.

Contact confirmation#

Apps can require a confirmed email or phone before the first session.

When the person has the contact on file, Scute sends a code to it:

Response 200json
{  "contact_verification_required": true,  "field": "phone",  "app_user_id": "0193f900-aaaa-7bbb-8ccc-eeeeeeeeeeee",  "challenge": {    "token": "ch_Lk8jH6gF4dS2aQ0wE9rT7yU5iO3pZ1xC",    "status": "pending",    "purpose": "verify_contact",    "method": "sms_otp",    "expires_at": "2026-11-19T14:14:05Z",    "remaining_attempts": 3,    "time_remaining": 600,    "delivery_required": false  }}

Verify the code with POST /v1/auth/:app_id/challenges/:token/verify and {"code": "..."}, as for MFA. The sign-in then goes on.

When the person has no contact of that kind, the response carries setup_token and setup_expires_at instead of challenge. Ask for the email or phone and add it:

Add the contact#

POST/v1/auth/:app_id/sign_in/contactSetup token
setup_tokenstringrequired
The setup_token from the response. The X-Scute-Setup-Token header works too.
identifierstringrequired
The email or phone to add. Must match field.
cURLbash
curl -X POST https://api.scute.io/v1/auth/$SCUTE_APP_ID/sign_in/contact \  -H "X-Scute-Setup-Token: $SETUP_TOKEN" \  -H "Content-Type: application/json" \  -d '{"identifier": "+14155551234"}'
Response 201json
{  "field": "phone",  "challenge": {    "token": "ch_Lk8jH6gF4dS2aQ0wE9rT7yU5iO3pZ1xC",    "status": "pending",    "purpose": "verify_contact",    "method": "sms_otp",    "expires_at": "2026-11-19T14:14:05Z",    "remaining_attempts": 3,    "time_remaining": 600,    "delivery_required": false  }}

Verify the code with the challenge verify route. The contact is added to the account as confirmed and the sign-in goes on. One setup pass sends up to 3 codes.

Statuserror_codeWhen
400invalid_identifierNot a valid email or phone, or not the kind field asks for.
401setup_expiredThe setup pass expired or was used. Sign in again.
409contact_takenAnother person in the workspace has that email or phone.
422sms_unavailableSMS is off for the workspace.
422sms_country_not_allowedThe app does not allow texts to this country.
429setup_send_limitThree codes were already sent for this pass. Sign in again.

Security verification#

Attack protection can ask for a code when a sign-in comes from a new device or address:

Response 202json
{  "verification_required": true,  "reason": "security_verification",  "threats": ["new_device"],  "verification": {    "token": "ch_Wq2eR4tY6uI8oP0aS2dF4gH6jK8lZ0xC",    "method": "email_otp",    "expires_at": "2026-11-19T14:14:05Z"  }}

Verify the code with POST /v1/auth/:app_id/challenges/:token/verify (no app key needed). The device and address are then known: repeat the original finishing call (open the same link again, or poll again) to get the session.

A sign-in attack protection refuses outright returns 403 security_block.