latestSwagger 2.02026-08-109450223.9 KB
94acb422c07d
Unwanted Access Rules
Create an Unwanted Access Rule
Creates a new Unwanted Access Rule associated with your account, an organization, or a specific identity.
Rule logic. Provide exactly one of country_code, vpn, ip_address, or logic:
- Omit logic and supply country_code, vpn, or ip_address to create standard rules. Provide a single value to create one rule, or a comma-separated list to create one standard rule per value in a single request. All rules share the same scope, type, and schedule, and are created atomically. If any value fails validation (for example a duplicate rule already exists, or an ip_address value is not a valid address or CIDR range), no rules are created. Duplicate values in the list are ignored. Only the last created rule is returned in the response. ip_address rules must be expected.
- Set logic as catchall (with category) to create a catchall rule that matches every value in the category. Catchalls must be unauthorized and may only be scoped to the account or an organization. An account or organization may have at most one catchall per category.
- Set logic as catchall_exception (with category) to create an exception that opts an organization out of an account-level catchall. Exceptions must be expected, may only be scoped to an organization, and must omit starts_at/expires_at.
Scope. The rule scope is determined by the IDs supplied: provide identity_id to scope the rule to a single identity, organization_id to scope it to an organization. Omitting both scopes the rule at the account level.
post/v1/unwanted_access_rules
Request body
Response
Create an Unwanted Access Rule
Example response
{
"unwanted_access_rule": {
"id": 84938,
"applied_to": {
"type": "Organization",
"id": 1234,
"name": "ExampleCo"
},
"category": "country",
"country_code": "US",
"vpn": "NORD_VPN",
"ip_address": "203.0.113.0/24",
"type": "unauthorized",
"status": "active",
"logic": "standard",
"note": "Approved by compliance — regional office access",
"starts_at": "2025-09-05T18:20:34Z",
"expires_at": "2025-12-05T18:20:34Z",
"created_by": "Jane Doe",
"created_at": "2025-09-05T18:20:34Z",
"updated_at": "2025-09-05T18:20:34Z"
}
}