API reference

Attack protection

Read and change how strictly an app checks sign-ins, which security emails go out, and how long devices stay trusted.

Attack protection scores every sign-in of the app (codes, magic links, passkeys, and OAuth and SAML sign-ins) for a new device, a new address, a new country, impossible travel, a suspicious address and an untrusted device. These settings decide what happens then.

Both endpoints take an API key that owns the app in Authorization and an M2M token in X-Authorization. Reads take the token's read scope, changes take write. See Authentication.

Get attack protection#

GET/v1/apps/:app_id/attack_protectionAPI key + M2M token
Requestbash
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  }}

Update attack protection#

Send only the settings to change, inside attack_protection.

PATCH/v1/apps/:app_id/attack_protectionAPI key + M2M token
attack_protectionobjectrequired
The settings below.
security_levelstring
off, low, medium, high or paranoid. Default medium.
notify_on_new_deviceboolean
Email the person after a sign-in from a new device. Default true.
notify_on_new_ipboolean
Email after a sign-in from a new address. Default false.
notify_on_country_changeboolean
Email after a sign-in from a new country. Default true.
require_verification_new_deviceboolean
Ask for a second step on a new device. Default false.
require_verification_suspiciousboolean
Ask for a second step on a suspicious sign-in. Default true.
limit_blocked_notice_dailyboolean
Send the "sign-in blocked" email to a person at most once a day. Default true.
device_trust_enabledboolean
Let people trust a device after a sign-in with a second factor. A trusted device skips the untrusted device check. Default true.
device_trust_daysinteger
1 to 365. How long a device stays trusted. Default 30.
max_login_distance_kminteger
50 to 10000. Distance between sign-ins that counts as impossible travel. Default 500.
suspicious_distance_time_hoursinteger
1 to 48. The time window for that distance. Default 2.

Booleans must be JSON true or false, or the strings "true" and "false".

Requestbash
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", "require_verification_new_device": true } }'

Returns 200 with all settings. A change records an app.attack_protection.updated event.

Statuserror_codeWhen
422attack_protection_requiredThe body has no attack_protection object
422unknown_settingA key is not one of the settings above
422invalid_settingA value is out of range or not a boolean
403workspace_admin_requiredA signed-in team member who is not an owner or admin
403The API key does not own this app
404app_not_foundNo app with that ID