---
title: "Create a rule"
method: PUT
path: "/rules"
tags: ["Rules"]
---

# Create a rule

`PUT /rules`

Create a new rule. You can specify a source rule to clone it.

## Request body

- RuleNew
  - `source` string, uuid — The id of the rule the clone will be based onto. If this parameter if provided, the new rule will be a clone of this source. Other value will override values from the source.
  - `id` string, uuid — Rule id
  - `displayName` string — Rule name
  - `shortDescription` string — One line rule description
  - `longDescription` string — Rule documentation
  - `category` string, uuid — The parent category id. If provided, the new rule will be in this parent category
  - `directives` string[] — Directives linked to the rule
  - `targets` object[] — Node and special groups targeted by that rule
    - `include` object, required — list of groups to include in rule application
      - `or` RuleTarget[]
    - `exclude` object, required — list of groups to exclude from rule application
      - `or` RuleTarget[]
  - `enabled` boolean — Is the rule enabled
  - `system` boolean — If true it is an internal Rudder rule
  - `tags` object[]

## Response `200`

Rules information

- object
  - `result` 'success' | 'error', required — Result of the request
  - `action` 'createRule', required — The id of the action
  - `data` object, required
    - `rules` Rule[], required
      - `id` string, uuid — Rule id
      - `displayName` string — Rule name
      - `shortDescription` string — One line rule description
      - `longDescription` string — Rule documentation
      - `directives` string[] — Directives linked to the rule
      - `targets` object[] — Node and special groups targeted by that rule
        - `include` object, required — list of groups to include in rule application
          - `or` RuleTarget[]
        - `exclude` object, required — list of groups to exclude from rule application
          - `or` RuleTarget[]
      - `enabled` boolean — Is the rule enabled
      - `system` boolean — If true it is an internal Rudder rule
      - `tags` object[]
      - `policyMode` string
      - `status` object
        - `value` string
        - `details` string

---

[API](https://skmtc.net/rudder/apis/rudder-api.md) · [All operations](https://skmtc.net/rudder/apis/rudder-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/rudder/rudder-api/revisions/eab988254fba/schema)
