API reference

Security flags

Flag, suspend or ban a person across every app in a workspace, and set the rules that flag people automatically.

A flag belongs to the person in the workspace, so it holds in every app they use there. There are three types, from mild to strict:

flag_typeEffect
flaggedWatched. They can still sign in
suspendedCan't sign in until it is lifted or expires_at passes
bannedCan't sign in. A ban has no end

A new or escalated suspension or ban signs the person out everywhere. A person has at most one flag in force.

These endpoints take an API key in Authorization and an M2M token of an app in this workspace in X-Authorization. Reads take the token's read scope, changes take write. Every change records a security.flag.* event. See Authentication and Events.

List flags#

Newest first.

GET/v1/workspaces/:workspace_id/security/flagsAPI key + M2M token
workspace_idstringrequired
Path. The workspace's ID or slug.
statusstring
Query. all, active (in force now) or past. Default all.
limitinteger
Query. Default 200, at most 500.
Requestbash
curl "https://api.scute.io/v1/workspaces/$SCUTE_WORKSPACE_ID/security/flags?status=active" \  -H "Authorization: Bearer $SCUTE_WORKSPACE_KEY" \  -H "X-Authorization: Bearer $SCUTE_M2M_TOKEN"
Response 200json
{  "flags": [    {      "id": "0193f9f0-1111-7222-8333-444444444444",      "flag_type": "suspended",      "reason": "Shared credentials reported",      "trigger": "manual",      "sign_in": null,      "active": true,      "expires_at": "2026-11-20T14:00:00.000Z",      "created_at": "2026-11-19T14:00:00.000Z",      "updated_at": "2026-11-19T14:00:00.000Z",      "user": {        "id": "0193f900-9999-7999-8999-999999999999",        "name": "Alice",        "email": "alice@example.com",        "phone": null,        "apps": [          { "id": "app_3mxZRrzWxhPZ08dXvqq6", "name": "Portal", "slug": "portal", "app_user_id": "0193f900-aaaa-bbbb-cccc-eeeeeeeeeeee" }        ]      },      "flagged_by": null,      "ended": null,      "metadata": {}    }  ],  "counts": { "flagged": 0, "suspended": 1, "banned": 0 }}
FieldMeaning
triggermanual, or the signal that flagged them automatically: impossible_travel, suspicious_ip, new_country, failed_attempts
sign_inFor an automatic flag, the sign-in that set it off: request_id, the app, and app_user_id
activeIn force now
user.appsThe apps of the workspace the person uses
flagged_byThe team member who flagged them, id and name, or null
endedFor a flag no longer in force: at, how (lifted or expired), by and note
countsPeople held back now, by type

Flag a person#

POST/v1/workspaces/:workspace_id/security/flagsAPI key + M2M token
user_idstring
The person's user ID in the workspace. Send this or app_user_id.
app_user_idstring
The person's user ID in one of the workspace's apps.
flag_typestringrequired
flagged, suspended or banned.
reasonstringrequired
Up to 1000 characters. Your team sees it, the person does not.
hoursinteger
1 to 8760. Suspensions only: it ends on its own after this many hours.
Requestbash
curl -X POST https://api.scute.io/v1/workspaces/$SCUTE_WORKSPACE_ID/security/flags \  -H "Authorization: Bearer $SCUTE_WORKSPACE_KEY" \  -H "X-Authorization: Bearer $SCUTE_M2M_TOKEN" \  -H "Content-Type: application/json" \  -d '{    "app_user_id": "0193f900-aaaa-bbbb-cccc-eeeeeeeeeeee",    "flag_type": "suspended",    "reason": "Shared credentials reported",    "hours": 24  }'

Returns 201 with flag.

Change a flag#

Send exactly one of lift, extend_hours or escalate.

PATCH/v1/workspaces/:workspace_id/security/flags/:idAPI key + M2M token
liftstring
End it now. The value is a note and may be empty.
extend_hoursinteger
1 to 8760. Push expires_at later by this many hours. Only for a flag with an end.
escalatestring
Make it stricter: suspended or banned. Needs reason. Escalating to banned clears expires_at.
reasonstring
With escalate. Up to 1000 characters.
hoursinteger
With escalate to suspended: a new end, in hours from now.
Requestbash
curl -X PATCH https://api.scute.io/v1/workspaces/$SCUTE_WORKSPACE_ID/security/flags/0193f9f0-1111-7222-8333-444444444444 \  -H "Authorization: Bearer $SCUTE_WORKSPACE_KEY" \  -H "X-Authorization: Bearer $SCUTE_M2M_TOKEN" \  -H "Content-Type: application/json" \  -d '{ "lift": "Confirmed with the customer" }'

Returns 200 with flag.

Get automatic flag rules#

Which sign-in signals flag a person on their own, and as what.

GET/v1/workspaces/:workspace_id/security/flags/settingsAPI key + M2M token
Response 200json
{  "auto_flags": {    "enabled": false,    "rules": {      "impossible_travel": "flagged",      "suspicious_ip": "flagged",      "new_country": "off",      "failed_attempts": "flagged"    },    "suspend_hours": 24,    "failed_attempts": 10,    "failed_attempts_minutes": 15,    "lift_grace_hours": 24  }}

Update automatic flag rules#

Send only what changes, inside auto_flags.

PATCH/v1/workspaces/:workspace_id/security/flags/settingsAPI key + M2M token
auto_flagsobjectrequired
The settings below.
enabledboolean
Turn automatic flags on. Default false.
rulesobject
Per signal (impossible_travel, suspicious_ip, new_country, failed_attempts): off, flagged or suspended.
suspend_hoursinteger
1 to 8760. How long an automatic suspension lasts. Default 24.
failed_attemptsinteger
3 to 100. Failed sign-ins that trigger failed_attempts. Default 10.
failed_attempts_minutesinteger
1 to 1440. The window for those attempts. Default 15.
lift_grace_hoursinteger
0 to 720. After your team lifts a flag, the rules add none to that person for this many hours. 0 for no grace. Default 24.
Requestbash
curl -X PATCH https://api.scute.io/v1/workspaces/$SCUTE_WORKSPACE_ID/security/flags/settings \  -H "Authorization: Bearer $SCUTE_WORKSPACE_KEY" \  -H "X-Authorization: Bearer $SCUTE_M2M_TOKEN" \  -H "Content-Type: application/json" \  -d '{ "auto_flags": { "enabled": true, "rules": { "new_country": "flagged" } } }'

Returns 200 with auto_flags.

Errors#

Statuserror_codeWhen
422user_not_foundNo such person in the workspace
422invalid_flag_typeflag_type or escalate is not a flag type
422reason_requiredreason is empty
422too_longA text field is over 1000 characters
422hours_not_allowedhours with a type other than suspended
422invalid_hoursHours out of range
422already_flaggedThe person already has a flag in force
422invalid_changeNot exactly one of lift, extend_hours, escalate
422flag_endedThe flag already ended
422no_expiryextend_hours on a flag with no end
422not_stricterescalate to the same or a milder type
422invalid_status, invalid_limitBad list parameters
422auto_flags_required, invalid_auto_flagsBad settings body
403workspace_admin_requiredA signed-in team member who is not an owner or admin
404flag_not_foundNo flag with that ID in the workspace