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:
| Field | Meaning |
|---|---|
| id | Rule ID |
| workspace_id | The workspace that owns it, null for a Scute wide rule |
| scope | workspace (this workspace's), inherited (from a workspace above, see from_workspace) or global |
| include_clients | The rule also applies in the workspaces below |
| from_workspace | For an inherited rule, id and name of the workspace it comes from |
| ip_address | An address or a CIDR range, or null for a country rule |
| country_code | Two-letter country code, or null for an address rule |
| rule_type | blocked, allowed, flagged or suspicious |
| reason | Free text |
| active | Whether it is on |
| hits_7d | Sign-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.
/v1/workspaces/:workspace_id/security/ip_rulesAPI key + M2M tokencurl 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"{ "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#
/v1/workspaces/:workspace_id/security/ip_rulesAPI key + M2M tokencurl -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.
/v1/workspaces/:workspace_id/security/ip_rules/:idAPI key + M2M tokenReturns 200 with ip_rule.
Delete an IP rule#
/v1/workspaces/:workspace_id/security/ip_rules/:idAPI key + M2M tokenReturns 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.
/v1/workspaces/:workspace_id/security/ip_rules/testAPI key + M2M tokencurl "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"{ "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#
/v1/workspaces/:workspace_id/security/ip_rules/settingsAPI key + M2M token{ "enforced": false }Update settings#
/v1/workspaces/:workspace_id/security/ip_rules/settingsAPI key + M2M tokenReturns 200 with enforced.
Errors#
| Status | error_code | When |
|---|---|---|
| 422 | invalid_ip_rule | A 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 |
| 422 | ip_rule_exists | The workspace already has a rule for that address, range or country |
| 422 | invalid_ip | The test ip is not one address |
| 422 | invalid_country | The test country_code is not two letters |
| 422 | invalid_ip_rule_settings | enforced is not true or false |
| 403 | global_ip_rule | The rule is Scute wide |
| 403 | inherited_ip_rule | The rule comes from a workspace above. Change it there |
| 403 | workspace_admin_required | A signed-in team member who is not an owner or admin |
| 403 | workspace_access_denied | The M2M token's app is not in this workspace |
| 404 | ip_rule_not_found | No rule with that ID |
| 404 | workspace_not_found | No workspace with that ID or slug |