# Create rule (deprecated)

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

Endpoint: POST /recommendation/rules
Security: risk_access_token

## Request fields (application/json):

  - `name` (string)
    Name of the recommendation rule. Must be unique across the tenant. Auto generated if not provided.
    Example: "Block risky countries"

  - `priority` (integer, 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

  - `matcher` (any, required)
    Activity field matcher. Only one matcher can be defined per rule.

  - `recommendation` (string, required)
    Recommendation type
    Enum: "CHALLENGE", "DENY", "TRUST"

  - `enabled` (boolean, required)
    Whether or not the rule will be evaluated

  - `mode` (string, 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.
    Enum: "PREVIEW", "PRODUCTION"

## Response 201 fields (application/json):

  - `message` (string)

  - `rule_id` (string)
    ID of the recommendation rule, used to reference the rule


## Response 400 fields

## Response 401 fields

## Response 403 fields

## Response 409 fields

## Response 429 fields

## Response 500 fields
