# Create a rule

`POST /rules`

Operation ID: `createRule`

Tags: `recursive-discriminator`

Accepts a rule container whose `rule_item` is a `oneOf` of variants that
each carry their own `discriminator: technique`.

## Request body (required)

### Content type: `application/json`

Schema: `object`

RuleContainer

- `name` (string, required)
- `rule_item` (one of)
  - Exactly one of these options:
    - Option 1: PatternRule (object)
      - `rule_item.technique` (string, required)
      - `rule_item.id` (string)
      - `rule_item.pattern` (string, required)
    - Option 2: DictionaryRule (object)
      - `rule_item.technique` (string, required)
      - `rule_item.id` (string)
      - `rule_item.dictionary` (string, required)

## Responses

### 200

The created rule container

#### Content type: `application/json`

Schema: `object`

RuleContainer

- `name` (string, required)
- `rule_item` (one of)
  - Exactly one of these options:
    - Option 1: PatternRule (object)
      - `rule_item.technique` (string, required)
      - `rule_item.id` (string)
      - `rule_item.pattern` (string, required)
    - Option 2: DictionaryRule (object)
      - `rule_item.technique` (string, required)
      - `rule_item.id` (string)
      - `rule_item.dictionary` (string, required)
