---
title: "Update a rule"
method: PATCH
path: "/v1/rules/{id}"
---

# Update a rule

`PATCH /v1/rules/{id}`

## Request

- Base URL: `https://webhook-studio.com`
- URL: `https://webhook-studio.com/v1/rules/{id}`
- Auth: HTTP bearer

## Request body

- object
  - `name` string
  - `active` boolean
  - `condition_tree` object: A condition group { op: "AND"|"OR", children: [...] } or a leaf { field, operator, value? }, nested arbitrarily. field is "body.<dot.path>", "header.<name>" or "meta.<key>". operator is equals|not_equals|contains|exists|regex; all but exists require value. An empty AND group matches every event.
  - `destination_ids` string[]

## Response `200`

OK

## Other responses

- `400`: Error
- `401`: Error
- `404`: Error

---

[API](https://skmtc.dev/webhook-studio/apis/webhook-studio-api.md) · [All operations](https://skmtc.dev/webhook-studio/apis/webhook-studio-api/llms.txt) · [OpenAPI document](https://skmtc.dev/webhook-studio/apis/webhook-studio-api/revisions/99d81099e6d6?raw)
