> For the complete documentation index, see [llms.txt](https://docs.nected.ai/nected-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.nected.ai/nected-docs/management-api/rules.md).

# Rules

The Rule API lets you list, create, read, update, test, schedule, and publish rules in your workspace via the Dev api. All paths use the entity type `rule`. Each endpoint link below opens a Swagger-style doc with endpoint details, URL format, authentication, parameters, request/response examples, and a link to try it in Swagger UI.

### Base URL

All endpoints are prefixed with `/dev/v1/rule`.

### Authentication

| Header           | Type   | Required | Description             |
| ---------------- | ------ | -------- | ----------------------- |
| `Nected-API-Key` | string | Yes      | Your Nected API key.    |
| `Nected-Branch`  | string | No       | Branch name (optional). |

### Endpoints

<table><thead><tr><th>Method</th><th width="310">Path</th><th>Description</th></tr></thead><tbody><tr><td>GET</td><td><code>/dev/v1/rule</code></td><td>List rules (Get all)</td></tr><tr><td>POST</td><td><code>/dev/v1/rule</code></td><td>Create rule</td></tr><tr><td>GET</td><td><code>/dev/v1/rule/{entity-id}</code></td><td>Get rule by id</td></tr><tr><td>PATCH</td><td><code>/dev/v1/rule/{entity-id}</code></td><td>Update rule</td></tr><tr><td>POST</td><td><code>/dev/v1/rule/{entity-id}/test</code></td><td>Test rule</td></tr><tr><td>POST</td><td><code>/dev/v1/rule/{entity-id}/publish</code></td><td>Publish rule</td></tr><tr><td>POST</td><td><code>/dev/v1/rule/{entity-id}/schedule</code></td><td>Create or update schedule</td></tr><tr><td>GET</td><td><code>/dev/v1/rule/{entity-id}/version</code></td><td>List published versions</td></tr></tbody></table>
