API reference

App settings

The sign-in, session, MFA and email settings of an app, and its attack protection.

Most settings are fields of the app, changed with Update an app. Attack protection has its own routes, below.

Sign-in settings#

FieldTypeDefaultMeaning
namestringApp name, up to 80 characters.
originstringThe app's URL. Sign-in links and redirects go to it.
additional_originsstring[][]Other URLs the app runs on.
login_urlstring/Path of the sign-in page on origin.
callback_urlstring/callbackPath on origin that sign-in links and OAuth and SAML redirects return to. Starts with /; no ? or #.
identifier_emailbooleantrueUsers can sign in with an email.
identifier_phonebooleanfalseUsers can sign in with a phone.
email_requiredbooleanfalseAsk the user for a confirmed email.
phone_number_requiredbooleanfalseAsk the user for a confirmed phone.
public_signupbooleantrueNew users can sign up. Sign up also needs the workspace open; signup_open on the app says whether both are.
passkeys_enabledbooleantrueUsers can sign in with passkeys.
email_auth_typestringmagicWhat an email sign-in sends: magic (a magic link) or otp (a code).
magic_link_expirationintegerSeconds a magic link lasts: 60 to 604800.
otp_expirationinteger600Seconds a one-time code lasts: 1 to 604800.
otp_lengthinteger6Digits in a one-time code.
sms_magic_link_modestringdirect_authWhat a magic link sent by SMS does: direct_auth signs in on the web sign-in page, deep_link opens the mobile app at sms_magic_link_app_url.
sms_magic_link_app_urlstringWhere deep_link opens.
sms_country_allowlist_enabledbooleanfalseSend SMS only to the countries in sms_country_allowlist.
sms_country_allowliststring[][]Country codes SMS may go to.
test_identitiesbooleanfalseAllow test identities. Only in a sandbox workspace.
platform, frameworkstringWhat the app is built for, as you describe it.

A change that would leave no way to sign in (no email, no phone, no passkeys and no enabled OAuth provider) is refused with 422.

Sessions#

FieldTypeDefaultMeaning
access_expirationinteger3600Seconds an access token lasts: 1 to 34560000 (400 days).
refresh_expirationinteger604800Seconds a session (its refresh token) lasts: 1 to 34560000.
session_timeoutinteger604800Idle timeout in seconds: 300 to 34560000. A session not used or refreshed for this long cannot be refreshed.
refresh_payloadbooleantrueReturn the refresh token in sign-in responses. When false, the refresh token is left out.
auto_refreshbooleantrueThe SDKs refresh the access token before it expires.

MFA#

FieldTypeDefaultMeaning
mfa_policystringdisableddisabled, optional or required.
mfa_methods_allowedstring[]["totp", "sms", "email", "backup_codes"]Methods users may set up. Values: totp, sms, email, webauthn, push, backup_codes.
mfa_grace_period_daysinteger7When MFA is required, days after a user is created during which they may still sign in without it.
mfa_reverify_minutesinteger10Minutes a recent check of the user counts before they change their MFA methods: 5 to 60.
webauthn_skip_mfabooleantrueA passkey sign-in skips the MFA step.

Email#

FieldTypeMeaning
email_primary_colorstringButton and accent color in emails. Returned as primary_color too.
email_logo_urlstringLogo in emails, when no logo is uploaded.
email_footer_textstringFooter text in emails.

Get attack protection#

GET/v1/apps/:app_id/attack_protectionApp key + M2M

Attack protection controls the checks Scute runs on each sign-in. These routes take the app key in Authorization and an M2M token in X-Authorization. Changing settings with an M2M token needs its write scope. See Authentication.

cURLbash
curl https://api.scute.io/v1/apps/$SCUTE_APP_ID/attack_protection \  -H "Authorization: Bearer $SCUTE_APP_SECRET" \  -H "X-Authorization: Bearer $SCUTE_M2M_TOKEN"
Response 200json
{  "attack_protection": {    "security_level": "medium",    "notify_on_new_device": true,    "notify_on_new_ip": false,    "notify_on_country_change": true,    "require_verification_new_device": false,    "require_verification_suspicious": true,    "limit_blocked_notice_daily": true,    "device_trust_enabled": true,    "max_login_distance_km": 500,    "suspicious_distance_time_hours": 2,    "device_trust_days": 30  }}

The values above are the defaults.

FieldMeaning
security_levelHow strict the sign-in checks are: off, low, medium, high or paranoid.
notify_on_new_deviceEmail the user after a sign-in from a new device.
notify_on_new_ipEmail the user after a sign-in from a new IP address.
notify_on_country_changeEmail the user after a sign-in from a new country.
require_verification_new_deviceAsk for a second step on a new device.
require_verification_suspiciousAsk for a second step on a suspicious sign-in.
limit_blocked_notice_dailySend the "sign-in blocked" notice to a user at most once a day.
device_trust_enabledUsers may trust a device after a sign-in with a second factor. A trusted device skips the "device not trusted" check.
device_trust_daysDays a device stays trusted: 1 to 365.
max_login_distance_kmDistance between two sign-ins that counts as impossible travel: 50 to 10000.
suspicious_distance_time_hoursThe time window for that distance: 1 to 48.

Update attack protection#

PATCH/v1/apps/:app_id/attack_protectionApp key + M2M

Send any of the fields inside attack_protection. Booleans must be true or false (or the strings "true" and "false"). Returns 200 with the full settings.

cURLbash
curl -X PATCH https://api.scute.io/v1/apps/$SCUTE_APP_ID/attack_protection \  -H "Authorization: Bearer $SCUTE_APP_SECRET" \  -H "X-Authorization: Bearer $SCUTE_M2M_TOKEN" \  -H "Content-Type: application/json" \  -d '{ "attack_protection": { "security_level": "high", "notify_on_new_ip": true } }'
StatusErrorWhen
404app_not_foundNo app with that id.
422attack_protection_requiredNo attack_protection object.
422unknown_settingA field that is not in the list.
422invalid_settingA value is out of range or of the wrong type.