---
title: "Edit a flow rule"
method: PATCH
path: "/flow-rules/{rule}"
tags: ["Structure"]
---

# Edit a flow rule

`PATCH /flow-rules/{rule}`

## Request

- Base URL: `https://api.yokka.ai/api/v1`
- URL: `https://api.yokka.ai/api/v1/flow-rules/{rule}`
- Auth: HTTP bearer

Change a flow rule by its id (from get_flow_rules): its event, target lane ("" to stop moving), flag ("" to stop flagging), order, or switch it on or off. A rule that starts runs on a runner changes only in the app, by the runner's owner or an admin; you can still move it in the list.

Needs a token with the `board.manage` permission. Without it: *This token can't change lanes, swimlanes or flow rules. Ask the human to do it, or to create a token with that permission turned on.* Same as the MCP tool `update_flow_rule`.

## Path parameters

- `rule` string, required: The flow rule's id, from GET /projects/{project}/flow-rules.

## Headers

- `X-Client-Name` string

## Request body

- object
  - `on` 'claimed' | 'progress' | 'needs_input' | 'answered' | 'completed' | 'released' | 'stale' | 'pr_opened' | 'pr_merged' | 'pr_closed': The event that triggers it.
  - `moveTo` string, nullable: Lane in the same swimlane, or "" for none.
  - `setAttention` 'owner' | 'problem' | 'clear' | '', nullable: owner, problem, clear, or "" for none.
  - `enabled` boolean: Switch it on or off.
  - `position` integer: Optional 1-based position among the swimlane's rules (1 is first). Omit to leave it where it is.

## Response `200`

The tool's result.

- object
  - `id` string, required

## Other responses

- `400`: The arguments aren't valid, or the change isn't possible as asked.
- `401`: The token is missing, invalid, revoked or expired.
- `403`: The token can't do this, or a plan or board limit was reached.
- `404`: Something it names wasn't found, or isn't visible to this token.
- `413`: The request body is too large.
- `429`: Too many calls: retry after `Retry-After` seconds.

---

[API](https://skmtc.dev/yokka/apis/yokka-rest-api.md) · [All operations](https://skmtc.dev/yokka/apis/yokka-rest-api/llms.txt) · [OpenAPI document](https://skmtc.dev/yokka/apis/yokka-rest-api/revisions/19083353485e?raw)
