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#
/v1/apps/:app_id/attack_protectionAPI key + M2M tokencurl https://api.scute.io/v1/apps/$SCUTE_APP_ID/attack_protection \ -H "Authorization: Bearer $SCUTE_APP_SECRET" \ -H "X-Authorization: Bearer $SCUTE_M2M_TOKEN"{ "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.
/v1/apps/:app_id/attack_protectionAPI key + M2M tokenBooleans must be JSON true or false, or the strings "true" and "false".
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.
| Status | error_code | When |
|---|---|---|
| 422 | attack_protection_required | The body has no attack_protection object |
| 422 | unknown_setting | A key is not one of the settings above |
| 422 | invalid_setting | A value is out of range or not a boolean |
| 403 | workspace_admin_required | A signed-in team member who is not an owner or admin |
| 403 | The API key does not own this app | |
| 404 | app_not_found | No app with that ID |