---
title: "Create Rule Handler"
method: POST
path: "/api/rules"
tags: ["runtime_mutations", "rules"]
---

# Create Rule Handler

`POST /api/rules`

## Request body

- CreateRuleRequest
  - `name` string, required
  - `description` string
  - `content` string
  - `rule_type` 'always' | 'manual' | 'pipeline'
  - `globs` string[]
  - `project_id` string, nullable
  - `kind` 'rule' | 'file-path' — Discriminator for which UI/dialog should render a rule. ``rule`` (default) is a free-form natural-language rule. ``file_path`` is a structured rule whose body is generated from its path. The injected prompt content is the same for both — kind only affects the editor that opens for the rule.
  - `file_path` string, nullable
  - `pipeline` object, nullable

## Response `200`

Successful Response

- unknown

## Other responses

- `422` — Validation Error

---

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