# Update a redaction rule

```http
PATCH https://trydimmi.com/api/v1/redaction-rules/{redaction_rule}
```

## Authorization

Send an API token as `Authorization: Bearer <token>`.
The token needs: `settings:write`.

## Path parameters

- `redaction_rule` (string, required): Id of the redaction rule, starting with rxr_, such as rxr_01jx2m8k4t. Find it with GET /redaction-rules.

## Body

- `enabled` (boolean): true to turn it on, false to turn it off.
- `name` (string): The name of the redaction rule, at most 80 characters.
- `pattern` (string): An RE2 regular expression, at most 256 characters.
- `replacement` (string): Text written in place of a match, at most 80 characters.

## Response 200 (OK)

- `data` (object, required)
  - `created_at` (string, required): When it was created, as an RFC 3339 time, such as 2026-01-31T09:00:00Z.
  - `enabled` (boolean, required): True when the rule is applied to messages before they are stored.
  - `id` (string, required): The id of this record. Send it wherever an endpoint asks for this record; never use its name or title in its place.
  - `name` (string, required): Name of the rule.
  - `object` (string, required): The kind of record this is, the same for every record of its kind, such as article.
  - `pattern` (string, required): The regular expression whose matches are replaced, up to 256 characters.
  - `position` (integer, required): Where the rule comes in the order rules apply, lowest first.
  - `replacement` (string, required): What each match becomes in the stored text, up to 80 characters, such as [redacted].
  - `updated_at` (string, required): When it last changed, as an RFC 3339 time, such as 2026-01-31T09:00:00Z.

## Response default (Error)

- `code` (string, required): Stable code for programs to tell errors apart, such as validation_failed or internal_error.
- `errors` (object): Each rejected field mapped to its messages. Only present when the input was invalid.
- `message` (string, required): What went wrong, in words safe to show a person.

## Example request

```bash
curl --request PATCH \
  --url 'https://trydimmi.com/api/v1/redaction-rules/{redaction_rule}' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "enabled": true,
  "name": "<string>",
  "pattern": "<string>",
  "replacement": "<string>"
}'
```

## Example response

```json
{
  "data": {
    "created_at": "2026-11-01T09:30:00Z",
    "enabled": true,
    "id": "<string>",
    "name": "<string>",
    "object": "<string>",
    "pattern": "<string>",
    "position": 123,
    "replacement": "<string>",
    "updated_at": "2026-11-01T09:30:00Z"
  }
}
```

---

Index of all dimmi docs: https://trydimmi.com/llms.txt (full text: https://trydimmi.com/llms-full.txt)
