> ## Documentation Index
> Fetch the complete documentation index at: https://zerodrift.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Edit Custom Rule

> Partially update an existing customer-owned custom rule

Partially update an existing customer-owned `AI_SIGNAL`, `REGEX`, or
`REQUIRE_NEAR` rule. Rule type and ownership metadata are immutable. Active
status is changed via
[Activate Rules](/api-reference/custom-policies/activate-rules) /
[Deactivate Rules](/api-reference/custom-policies/deactivate-rules), not this
endpoint.

Requires a full-access API key. Supply only fields applicable to the stored
rule type.

## Path Parameters

<ParamField path="rule_id" type="string" required>
  Custom rule identifier
</ParamField>

## Request Body

At least one field is required. Common editable fields:

<ParamField body="name" type="string">
  Human-readable rule name
</ParamField>

<ParamField body="action" type="string">
  `fix` or `flag`
</ParamField>

<ParamField body="severity" type="string">
  `do_not_send` or `send_with_caution`
</ParamField>

<ParamField body="suggested_text" type="string">
  Editable suggestion. Omit to preserve; `null` clears and suppresses warning fallback.
</ParamField>

<ParamField body="fix_note" type="string">
  Remediation guidance. Nullable to clear.
</ParamField>

Type-specific fields match
[Create Custom Rule](/api-reference/custom-policies/create-rule)
(`prompt` / `keywords` / `window` for `AI_SIGNAL`, `regex_pattern` for `REGEX`,
`anchor` / `near` / distance options for `REQUIRE_NEAR`).

## Response

Returns the updated custom rule definition (same shape as
[Get Custom Rule](/api-reference/custom-policies/get-rule)).

## Errors

| Status | Meaning                       |
| ------ | ----------------------------- |
| `400`  | Invalid custom rule update    |
| `403`  | Full-access API key required  |
| `404`  | Custom rule not found         |
| `409`  | Concurrent custom rule update |

## Example

```bash theme={null}
curl -X PATCH "https://api.zerodrift.ai/api/policies/rules/cust_abc123_no_misleading_claims" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "severity": "send_with_caution",
    "suggested_text": "Past performance is not indicative of future results."
  }'
```
