# Rules

The Rules tab is where you create and manage purge rules. Each rule defines which conversations to target and how long to retain them.

### Managing existing rules

Rules are listed with their name, scope, and retention period. Each rule can be toggled on or off individually using its toggle, or edited and deleted via the ⋮ menu.

**Bot chats** are deleted immediately after the retention period ends, with **no grace period**.

> **Note:** Purge rules can only be set for Shared Inboxes and Bot Chats. Conversations from personal inboxes are not covered by rules — they can only be deleted by the user themselves (via the Deleted folder).

### Adding a new rule

1. Click **+ Add rule**.
2. Enter a name and ensure the rule is set to **Active**.
3. Choose the **scope** — what type of conversations this rule applies to:
   * **Shared Inboxes** — all shared inboxes in the workspace
   * **Custom Inboxes** — specific inboxes you select
   * **Bot Chats** — conversations handled by bots
4. Add **conditions** to filter which conversations are targeted, using fields such as Tag, Category, Inbox, or Status. For bot chat rules, you can optionally filter by a specific bot — leave conditions empty to apply the rule to all bots.
5. Set the **retention period** — conversations that have not been modified for longer than this value will be queued for purging.
6. Optionally enable **Close conversation on purge** (not available for bot chat rules).

{% hint style="info" %}
**New messages cancel a pending purge.** If a message arrives on a conversation queued for deletion, the purge is automatically cancelled. Enabling **Close conversation on purge** prevents this — new messages will start a fresh thread instead, keeping the original on track for deletion.
{% endhint %}

7. Review the **timeline summary** to confirm the total time to permanent deletion.
8. Click **Submit**.

**Warning:** Deletion is permanent. Conversations matched by a rule cannot be recovered once deleted. Use Upcoming Purges to cancel any pending deletions before the grace period ends.
