v1

latestOpenAPI 3.0.22026-08-0664154.9 KB

Create rule

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

post/recommendation/rules

Request body

namestring

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

priorityinteger 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.

recommendation'CHALLENGE' | 'DENY' | 'TRUST' required

Recommendation type

enabledboolean required

Whether or not the rule will be evaluated

mode'PREVIEW' | 'PRODUCTION' required

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.

Example request

{
  "name": "Block risky countries",
  "priority": 10
}

Response

Rule created successfully

messagestring
rule_idstring

ID of the recommendation rule, used to reference the rule