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

# Data retention policy

> Set how long Champ keeps case and workflow data for your organization, and what remains after cleanup.

Your organization's data retention policy controls how long Champ keeps cases, workflow runs, and run history. When
data passes its retention period, Champ permanently deletes the content and keeps only basic details such as status
and dates.

Without a policy, Champ keeps this data indefinitely.

## Set retention periods

Organization admins manage the policy:

1. Open [**Data retention**](https://dash.champ.ai/app/data-retention) from the account menu.
2. Enter a period in days for each type of data, or leave a field blank to keep that data indefinitely.
3. Click **Save retention settings**.

| Data | What gets deleted | When |
| - | - | - |
| **Run history** | Detailed results from each workflow step, including browser recordings. | The run and any workflows it starts have finished and stayed unchanged for the period. |
| **Workflow runs** | Data used and produced during a run, including files, approvals, and call details. | The run has finished and stayed unchanged for the period, and its run history is cleared. |
| **Cases** | Case messages, field values, attachments, and reviews. Uploaded bulk run values also follow this period. Email and Slack cases are not deleted. | The case is closed and has stayed unchanged for the period, and all of its workflow runs are cleared. |

Periods are whole numbers of days, and they must follow this order: **Cases** at least as long as **Workflow runs**,
and **Workflow runs** at least as long as **Run history**. A blank field counts as indefinite, so a **Cases** period
also needs periods on the other two, and a **Workflow runs** period also needs one on **Run history**. For example:
30 days of run history, 60 days of workflow runs, and 90 days of cases.

## How cleanup works

Champ checks for expired data daily. Cleanup may take more than one day while files and related records are removed.
The Data retention page shows how much has been deleted so far and when cleanup last ran.

* **Run history clears first, then workflow runs, then cases.** Each stage waits for the one before it, so data can
  outlast its own period. For example, a closed case stays until all of its workflow runs are cleared.
* **Work in progress is kept.** Open cases and workflow runs still in progress aren't deleted.
* **Changes apply to existing data.** Shortening a period may delete older data at the next cleanup.

> [!WARNING]
>
> Deletion is permanent and irreversible. Extending a period or leaving it blank won't restore deleted data or cancel
> cleanup that has already started.

## After data is deleted

The case or workflow run itself remains, with basic details such as its status, outcome, and dates. It can no longer
be changed, and integrations see the following:

| Where | What happens |
| - | - |
| [Cases API](https://docs.champ.ai/integrations/cases-api.md) reads | The case is still returned. Its `subject` is `[deleted]` and its `attributes` are empty. |
| Cases API status updates and messages | `410` with the error `case data deleted`. |
| [Case file URLs](https://docs.champ.ai/integrations/case-files.md) | `404`. |
| [Webhooks](https://docs.champ.ai/webhooks/subscriptions.md) | Champ no longer delivers events for the case. |

If you need case data or files for longer than your retention period, copy them to your own systems first.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.