---
title: "Update Rule"
method: PATCH
path: "/api/rules/{rule_id}"
tags: ["rules"]
---

# Update Rule

`PATCH /api/rules/{rule_id}`

## Path parameters

- `rule_id` string, uuid, required

## Headers

- `X-Workspace-Id` string, nullable

## Request body

- RuleUpdate
  - `name` string, nullable
  - `conditions_op` string, nullable
  - `conditions` RuleCondition[], nullable
    - `field` string, required
    - `op` string, required
    - `value` unknown, required
  - `actions` RuleAction[], nullable
    - `op` string, required
    - `value` unknown, required
  - `priority` integer, nullable
  - `is_active` boolean, nullable
  - `apply_to_existing` boolean, nullable
  - `overwrite_existing_categories` boolean

## Response `200`

Successful Response

- RuleMutationResponse — A changed rule plus how many existing transactions it just affected.
  - `id` string, uuid, required
  - `user_id` string, uuid, required
  - `name` string, required
  - `conditions_op` string, required
  - `conditions` object[], required
  - `actions` object[], required
  - `priority` integer, required
  - `is_active` boolean, required
  - `applied_count` integer

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.dev/usesecuro/apis/securo.md) · [All operations](https://skmtc.dev/usesecuro/apis/securo/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/usesecuro/securo/revisions/1df3dfa0c028/schema)
