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_type | Effect |
|---|---|
| flagged | Watched. They can still sign in |
| suspended | Can't sign in until it is lifted or expires_at passes |
| banned | Can'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.
/v1/workspaces/:workspace_id/security/flagsAPI key + M2M tokencurl "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"{ "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 }}| Field | Meaning |
|---|---|
| trigger | manual, or the signal that flagged them automatically: impossible_travel, suspicious_ip, new_country, failed_attempts |
| sign_in | For an automatic flag, the sign-in that set it off: request_id, the app, and app_user_id |
| active | In force now |
| user.apps | The apps of the workspace the person uses |
| flagged_by | The team member who flagged them, id and name, or null |
| ended | For a flag no longer in force: at, how (lifted or expired), by and note |
| counts | People held back now, by type |
Flag a person#
/v1/workspaces/:workspace_id/security/flagsAPI key + M2M tokencurl -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.
/v1/workspaces/:workspace_id/security/flags/:idAPI key + M2M tokencurl -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.
/v1/workspaces/:workspace_id/security/flags/settingsAPI key + M2M token{ "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.
/v1/workspaces/:workspace_id/security/flags/settingsAPI key + M2M tokencurl -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#
| Status | error_code | When |
|---|---|---|
| 422 | user_not_found | No such person in the workspace |
| 422 | invalid_flag_type | flag_type or escalate is not a flag type |
| 422 | reason_required | reason is empty |
| 422 | too_long | A text field is over 1000 characters |
| 422 | hours_not_allowed | hours with a type other than suspended |
| 422 | invalid_hours | Hours out of range |
| 422 | already_flagged | The person already has a flag in force |
| 422 | invalid_change | Not exactly one of lift, extend_hours, escalate |
| 422 | flag_ended | The flag already ended |
| 422 | no_expiry | extend_hours on a flag with no end |
| 422 | not_stricter | escalate to the same or a milder type |
| 422 | invalid_status, invalid_limit | Bad list parameters |
| 422 | auto_flags_required, invalid_auto_flags | Bad settings body |
| 403 | workspace_admin_required | A signed-in team member who is not an owner or admin |
| 404 | flag_not_found | No flag with that ID in the workspace |