---
title: "Create rule"
method: POST
path: "/recommendation/rules"
deprecated: true
---

# Create rule

`POST /recommendation/rules`

> **Deprecated.**

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

## Request body

- Rule — Recommendation rule
  - `name` string — Name of the recommendation rule. Must be unique across the tenant. Auto generated if not provided.
  - `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.
  - `matcher` union, required — Activity field matcher. Only one matcher can be defined per rule.
    - IpCidrs
      - `ip_cidrs` string[] — List of IP ranges in CIDR notation
    - DeviceIds
      - `device_ids` string[] — List of device identifiers generated by Transmit Security and stored by the SDK
    - DeviceFingerprints
      - `device_fingerprints` string[] — List of device fingerprints calculated based on multiple device persistent identifiers
    - DevicePublicKeys
      - `device_public_keys` string[] — List of unique and persistent device key IDs derived from cryptographic binding
    - UserIds
      - `user_ids` string[] — List of opaque identifiers of users in your system
    - CountryCodes
      - `country_codes` string[] — List of country codes per ISO 3166-1 alpha-2 standard
    - BrowserNames
      - `browser_names` string[] — List of browser names as presented by Transmit Security systems. e.g. `yandex`, `electron`
    - OsVersions
      - `os_versions` string[] — List of OS versions as presented by Transmit Security systems. e.g. `14.4.2`, `x86_64`
  - `recommendation` 'CHALLENGE' | 'DENY' | 'TRUST', required — Recommendation type
  - `enabled` boolean, 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.

## Response `201`

Rule created successfully

- CreateRuleResponse
  - `message` string
  - `rule_id` string — ID of the recommendation rule, used to reference the rule

## Other responses

- `400` — Bad request
- `401` — Invalid authentication
- `403` — Invalid authorization
- `409` — Unique field collision
- `429` — Rate limit reached
- `500` — Internal error

---

[API](https://skmtc.net/transmitsecurity/apis/recommendations.md) · [All operations](https://skmtc.net/transmitsecurity/apis/recommendations/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/transmitsecurity/recommendations/versions/9ef2d32db212/schema)
