API reference

IP rules

Allow, block, flag or mark as suspicious sign-ins by address, range or country, for a workspace.

A workspace has its own rules, and also sees Scute wide rules, which it can't change. A master or MSP workspace's rule can include the workspaces below it (include_clients); a client lists those rules read only. Checking sign-ins against the rules is off until it is turned on in settings. Rules are kept and can be tested either way.

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. See Authentication.

The rule object:

FieldMeaning
idRule ID
workspace_idThe workspace that owns it, null for a Scute wide rule
scopeworkspace (this workspace's), inherited (from a workspace above, see from_workspace) or global
include_clientsThe rule also applies in the workspaces below
from_workspaceFor an inherited rule, id and name of the workspace it comes from
ip_addressAn address or a CIDR range, or null for a country rule
country_codeTwo-letter country code, or null for an address rule
rule_typeblocked, allowed, flagged or suspicious
reasonFree text
activeWhether it is on
hits_7dSign-ins it decided today and the 6 days before

List IP rules#

The workspace's rules, on and off, newest first; then active rules from workspaces above that include it; then active Scute wide rules.

GET/v1/workspaces/:workspace_id/security/ip_rulesAPI key + M2M token
workspace_idstringrequired
Path. The workspace's ID or slug.
Requestbash
curl https://api.scute.io/v1/workspaces/$SCUTE_WORKSPACE_ID/security/ip_rules \  -H "Authorization: Bearer $SCUTE_WORKSPACE_KEY" \  -H "X-Authorization: Bearer $SCUTE_M2M_TOKEN"
Response 200json
{  "ip_rules": [    {      "id": "0193f9e0-1111-7222-8333-444444444444",      "workspace_id": "0193f8aa-0000-7000-8000-000000000000",      "scope": "workspace",      "include_clients": false,      "from_workspace": null,      "ip_address": "203.0.113.0/24",      "country_code": null,      "rule_type": "blocked",      "reason": "Known bad range",      "active": true,      "metadata": {},      "hits_7d": 4,      "created_at": "2026-11-10T09:00:00.000Z",      "updated_at": "2026-11-10T09:00:00.000Z"    }  ]}

Create an IP rule#

POST/v1/workspaces/:workspace_id/security/ip_rulesAPI key + M2M token
ip_addressstring
An address or a CIDR range, like 203.0.113.0/24. Send this or country_code, not both.
country_codestring
Two-letter uppercase code, like US.
rule_typestringrequired
blocked, allowed, flagged or suspicious.
reasonstring
Up to 500 characters.
activeboolean
Whether the rule is on.
include_clientsboolean
Apply in the workspaces below. Master and MSP workspaces only.
Requestbash
curl -X POST https://api.scute.io/v1/workspaces/$SCUTE_WORKSPACE_ID/security/ip_rules \  -H "Authorization: Bearer $SCUTE_WORKSPACE_KEY" \  -H "X-Authorization: Bearer $SCUTE_M2M_TOKEN" \  -H "Content-Type: application/json" \  -d '{ "ip_address": "203.0.113.0/24", "rule_type": "blocked", "reason": "Known bad range" }'

Returns 201 with ip_rule.

Update an IP rule#

Takes any create field. To switch a rule between an address and a country, send the other one as null.

PATCH/v1/workspaces/:workspace_id/security/ip_rules/:idAPI key + M2M token

Returns 200 with ip_rule.

Delete an IP rule#

DELETE/v1/workspaces/:workspace_id/security/ip_rules/:idAPI key + M2M token

Returns 200 with the deleted ip_rule.

Test an address#

Which rule decides for an address, by the same pick sign-ins use. Country rules are tested only when country_code is sent: at sign-in the country comes from the connection, and there is no lookup for a typed address.

GET/v1/workspaces/:workspace_id/security/ip_rules/testAPI key + M2M token
ipstringrequired
Query. One address, not a range.
country_codestring
Query. Two-letter code.
Requestbash
curl "https://api.scute.io/v1/workspaces/$SCUTE_WORKSPACE_ID/security/ip_rules/test?ip=203.0.113.9" \  -H "Authorization: Bearer $SCUTE_WORKSPACE_KEY" \  -H "X-Authorization: Bearer $SCUTE_M2M_TOKEN"
Response 200json
{  "ip": "203.0.113.9",  "country_code": null,  "city": null,  "rule": { "id": "0193f9e0-1111-7222-8333-444444444444", "rule_type": "blocked", "ip_address": "203.0.113.0/24", "scope": "workspace" },  "outcome": "blocked"}

rule is the full rule object (shortened above), or null. outcome is the rule's rule_type, or none.

Get settings#

GET/v1/workspaces/:workspace_id/security/ip_rules/settingsAPI key + M2M token
Response 200json
{ "enforced": false }

Update settings#

PATCH/v1/workspaces/:workspace_id/security/ip_rules/settingsAPI key + M2M token
enforcedbooleanrequired
Check sign-ins against the rules. Default false.

Returns 200 with enforced.

Errors#

Statuserror_codeWhen
422invalid_ip_ruleA validation failed: no target, both targets, a bad address or country, a long reason, or include_clients outside a master or MSP. details has the messages per field
422ip_rule_existsThe workspace already has a rule for that address, range or country
422invalid_ipThe test ip is not one address
422invalid_countryThe test country_code is not two letters
422invalid_ip_rule_settingsenforced is not true or false
403global_ip_ruleThe rule is Scute wide
403inherited_ip_ruleThe rule comes from a workspace above. Change it there
403workspace_admin_requiredA signed-in team member who is not an owner or admin
403workspace_access_deniedThe M2M token's app is not in this workspace
404ip_rule_not_foundNo rule with that ID
404workspace_not_foundNo workspace with that ID or slug