Skip to content

Create rule
deprecated

Request

Creates a new recommendation rule. Returns the rule_id used to reference the rule in subsequent requests.

Security
risk_access_token
Bodyapplication/jsonrequired
namestring

Name of the recommendation rule. Must be unique across the tenant. Auto generated if not provided.

Example:"Block risky countries"
priorityinteger, [ 1 .. 1000 ]required

Priority of the recommendation rule, which determines the order in which rules are evaluated. Rules are evaluated from smallest to biggest priority value and only the first rule to match will apply. Priority value must be unique.

Example:10
matcherip_cidrs (object) or device_ids (object) or device_fingerprints (object) or device_public_keys (object) or user_ids (object) or country_codes (object) or browser_names (object) or os_versions (object)required
One of:

Activity field matcher. Only one matcher can be defined per rule.

recommendationstringrequired

Recommendation type

Enum:"CHALLENGE""DENY""TRUST"
enabledbooleanrequired

Whether or not the rule will be evaluated

modestringrequired

Allows you to simulate a rule and evaluate its impact before releasing it to production. The simulation occurs each time a recommendation is requested. If a preview rule matches the request (meaning, its priority is higher than all matching rules), the response will include this preview rule and what the recommendation would have been if all rules were in production.

Enum:"PREVIEW""PRODUCTION"
curl -i -X POST \
  https://api.sbx.transmitsecurity.io/risk/v1/recommendation/rules \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "Block risky countries",
    "priority": 10,
    "matcher": {
      "ip_cidrs": [
        "string"
      ]
    },
    "recommendation": "CHALLENGE",
    "enabled": true,
    "mode": "PREVIEW"
  }'

Responses

Rule created successfully

Bodyapplication/json
messagestring
rule_idstring

ID of the recommendation rule, used to reference the rule

Response
{ "message": "string", "rule_id": "string" }