---
title: "Creates a rule."
method: POST
path: "/rules"
tags: ["rules"]
---

# Creates a rule.

`POST /rules`

## Request body

- RuleDTO
  - `triggers` TriggerDTO[]
    - `id` string
    - `label` string
    - `description` string
    - `configuration` object
    - `type` string
  - `conditions` ConditionDTO[]
    - `id` string
    - `label` string
    - `description` string
    - `configuration` object
    - `type` string
    - `inputs` object
  - `actions` ActionDTO[]
    - `id` string
    - `label` string
    - `description` string
    - `configuration` object
    - `type` string
    - `inputs` object
  - `configuration` object
  - `configDescriptions` ConfigDescriptionParameterDTO[]
    - `context` string
    - `defaultValue` string
    - `description` string
    - `label` string
    - `name` string
    - `required` boolean
    - `type` 'TEXT' | 'INTEGER' | 'DECIMAL' | 'BOOLEAN'
    - `min` number
    - `max` number
    - `stepsize` number
    - `pattern` string
    - `readOnly` boolean
    - `multiple` boolean
    - `multipleLimit` integer
    - `groupName` string
    - `advanced` boolean
    - `verify` boolean
    - `limitToOptions` boolean
    - `unit` string
    - `unitLabel` string
    - `options` ParameterOptionDTO[]
      - `label` string
      - `value` string
    - `filterCriteria` FilterCriteriaDTO[]
      - `value` string
      - `name` string
  - `templateUID` string
  - `uid` string
  - `name` string
  - `tags` string[]
  - `visibility` 'VISIBLE' | 'HIDDEN' | 'EXPERT'
  - `description` string

## Response `201`

Created

## Other responses

- `400` — Creation of the rule is refused. Missing required parameter.
- `409` — Creation of the rule is refused. Rule with the same UID already exists.

---

[API](https://skmtc.net/openhab/apis/openhab-rest-api.md) · [All operations](https://skmtc.net/openhab/apis/openhab-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/openhab/openhab-rest-api/versions/0f2ce17cab3e/schema)
