---
title: "Save Rule"
method: PUT
path: "/dashboard/bot/settings/{guild_id}/automod/rules/{rule_id}"
tags: ["dashboard"]
---

# Save Rule

`PUT /dashboard/bot/settings/{guild_id}/automod/rules/{rule_id}`

Create or update one rule. `rule_id` is client-supplied for a new rule ("new" asks the server to mint one), which
keeps the dashboard from having to round-trip before it can render the row.

## Path parameters

- `guild_id` integer, required
- `rule_id` string, required

## Request body

- AutomodRule
  - `rule_id` string, nullable
  - `check_type` 'spam' | 'repeat' | 'mentions' | 'attachments' | 'links' | 'words' | 'channel_spam' | 'emoji' | 'lines' | 'caps' | 'zalgo' | 'polls' | 'spoilers', required — The configurable checks a guild can use.
  - `name` string, required
  - `enabled` boolean
  - `order_by` integer
  - `settings` object
  - `actions` object[]
  - `filters` RuleFilters — Channel/role scope. Stacks: a rule must pass the module-wide ignores, its check's filters and its own. Roles always exempt; `mode` only governs channels.
    - `mode` 'only' | 'except'
    - `channels` string[]
    - `roles` string[]
  - `escalation` Escalation — Repeat-offence handling. `window` is how long a strike counts for. The strike COUNT itself lives in Redis for exactly that long.
    - `enabled` boolean
    - `window` integer
    - `actions` object[]

## Response `200`

Successful Response

- AutomodRule
  - `rule_id` string, nullable
  - `check_type` 'spam' | 'repeat' | 'mentions' | 'attachments' | 'links' | 'words' | 'channel_spam' | 'emoji' | 'lines' | 'caps' | 'zalgo' | 'polls' | 'spoilers', required — The configurable checks a guild can use.
  - `name` string, required
  - `enabled` boolean
  - `order_by` integer
  - `settings` object
  - `actions` object[]
  - `filters` RuleFilters — Channel/role scope. Stacks: a rule must pass the module-wide ignores, its check's filters and its own. Roles always exempt; `mode` only governs channels.
    - `mode` 'only' | 'except'
    - `channels` string[]
    - `roles` string[]
  - `escalation` Escalation — Repeat-offence handling. `window` is how long a strike counts for. The strike COUNT itself lives in Redis for exactly that long.
    - `enabled` boolean
    - `window` integer
    - `actions` object[]

## Other responses

- `422` — Validation Error

## Changes

- **2026-09-16** `83ac8f547df8` — 2 info
  - added the optional property `detail/items/ctx` to the response with the `422` status
  - added the optional property `detail/items/input` to the response with the `422` status
- **2026-09-09** `0f647fa78ebf` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/monni/apis/fastapi/changes/dashboard/bot/settings/:guild_id/automod/rules/:rule_id/put.md)

---

[API](https://skmtc.dev/monni/apis/fastapi.md) · [All operations](https://skmtc.dev/monni/apis/fastapi/llms.txt) · [OpenAPI document](https://skmtc.dev/monni/apis/fastapi/revisions/2ec565e413a7?raw)
