> 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>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.nected.ai/nected-docs/management-api/rules.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
