# Source: https://langfuse.com/docs/administration/data-retention.md

---
description: Control Data Retention in Langfuse
sidebarTitle: Data Retention
---

# Data Retention

<AvailabilityBanner
  availability={{
    hobby: "not-available",
    core: "not-available",
    pro: "full",
    enterprise: "full",
    selfHosted: "ee",
  }}
/>

With Langfuse's Data Retention feature, you can control how long your event data (Traces, Observations, Scores, and Media Assets) is stored in Langfuse.

## Configuration

Data retention is configured on a project level, and we accept a number of days with a minimum of 3 days.
Project owners and administrators can change the data retention setting within the Project Settings view.

<Callout type="info">
  By default, Langfuse stores event data (Traces, Observations, Scores, and
  Media Assets) indefinitely.
</Callout>

<Frame className="my-10" fullWidth>
  ![Configure data retention in Langfuse](/images/docs/data-retention.png)
</Frame>

Data retention can also be configured via the [projects API](/docs/administration/scim-and-org-api).

## Details

On a nightly basis, Langfuse selects traces, observations, scores, and media assets that are older than the configured retention period and deletes them.
We use the following properties per entity to decide whether they are outside the retention window:

- **Traces**: `timestamp`
- **Observations**: `start_time`
- **Scores**: `timestamp`
- **Media Assets**: `created_at`

Deleted assets cannot be recovered.

The retention policy applies to the respective data, independent of any references.
For example, if a dataset references a trace but the trace is e.g. deleted after 30 days, the dataset run item will point to a non-existent trace.

## Self-hosted Instances

To use the Data Retention feature in a self-hosted environment, you need to grant `s3:DeleteObject` to the Langfuse IAM role on all buckets (see [Blob Storage (S3) docs](/self-hosting/deployment/infrastructure/blobstorage)).
Note that Langfuse only issues delete statements on the API.
If you use versioned buckets, delete markers and non-current versions need to be removed manually or with a lifecycle rule.