> For the complete documentation index, see [llms.txt](https://documentation.dnanexus.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.dnanexus.com/user/objects/data-retention.md).

# Data Retention

Learn how data retention keeps deleted data recoverable for a set number of days, what it covers, and how it affects project operations and charges.

{% hint style="info" %}
A license is required to use data retention. [Contact DNAnexus Sales](mailto:sales@dnanexus.com) for more information.
{% endhint %}

With data retention, deleted data stays recoverable for a set number of days before the platform permanently deletes it. In a project with data retention turned on, deleted objects move to the project's recycle bin, where project members can review them and recover them until their retention period ends.

## What Data Retention Covers

| Item                            | When you delete it                    | How to recover it                          | Controlled by                                        |
| ------------------------------- | ------------------------------------- | ------------------------------------------ | ---------------------------------------------------- |
| Data object in a project        | Moves to the project's recycle bin    | In the **Recycle Bin**, or through the API | The project's **Enable Data Retention** setting      |
| DBCluster                       | Enters the `terminate_pending` status | Through the API                            | The project's **Enable Data Retention** setting      |
| App and global workflow version | Marked for deletion                   | Through the API                            | The billing org's **Enforce Data Retention** setting |

## Turning On Data Retention

Org admins can set the retention period for the org and enforce data retention for all projects billed to the org. For details, see [Set Org Data Retention Policies](/admin/org-management.md#set-org-data-retention-policies).

To turn data retention on or off for a project, you need ADMINISTER access to the project. Open the project's **Settings** tab, and in the **Data Retention & Recovery** section, set **Enable Data Retention** to **ON** or **OFF**. The **Enable Data Retention** description shows the org's current retention period. When the billing org enforces data retention, the setting is locked.

To turn data retention off, the project's recycle bin must be empty. To empty the recycle bin, either recover or permanently delete objects in it.

## What Happens When You Delete Data

In a project with data retention turned on, deleted objects move to the project's recycle bin. Objects in the recycle bin can't be viewed, downloaded, or used as job or analysis inputs, and they don't appear in search results.

Each deleted object has a **Scheduled Purge Time**, set from the org's retention period when the object is deleted. Changing the retention period later doesn't affect objects already in the recycle bin. After its **Scheduled Purge Time**, the object is permanently deleted and can no longer be recovered.

Permanently deleting an object removes that project's copy of the object. If copies of the object exist in other projects (for example, created through cloning), those copies remain accessible. The underlying file data is permanently removed from the platform only when all copies across all projects are deleted. For more information about how data objects and copies share platform data, see [Platform IDs and Data Objects in Projects](/user/platform-ids.md#platform-ids-and-data-objects-in-projects).

To work with objects in the recycle bin, see [Viewing Deleted Objects](/getting-started/key-concepts/projects.md#viewing-deleted-objects), [Recovering Deleted Objects](/getting-started/key-concepts/projects.md#recovering-deleted-objects), and [Permanently Deleting Objects](/getting-started/key-concepts/projects.md#permanently-deleting-objects).

## Who Can Do What

| Action                                              | Required [project access level](/getting-started/key-concepts/projects.md#project-access-levels) |
| --------------------------------------------------- | ------------------------------------------------------------------------------------------------ |
| View the **Recycle Bin** and its contents           | VIEW or higher                                                                                   |
| Delete objects and recover them                     | CONTRIBUTE or higher                                                                             |
| Permanently delete objects or clear the recycle bin | ADMINISTER                                                                                       |

If the project's *Delete Access* policy allows only admins to delete data, deleting objects requires ADMINISTER access. For more information, see [Project Data Access Controls](/getting-started/key-concepts/projects.md#project-data-access-controls).

## Storage and Compute Charges

Objects in the recycle bin count towards the project's storage charges until they are permanently deleted. DBClusters pending termination continue to incur charges as if they were running. For more information, see [Charges for Deleted Data Under Data Retention](/admin/billing-and-account-management.md#charges-for-deleted-data-under-data-retention).

## Limits and Restrictions

Data retention limits these project operations:

* **Deleting objects** - A single delete action can move at most 10,000 objects to the recycle bin, counting hidden linked objects.
* **Copying data** - If the destination project's recycle bin holds a copy of the object, recover or permanently delete that copy first, or wait until its **Scheduled Purge Time** passes.
* **Transferring a project or changing its billing account** - Requires an empty recycle bin.
* **Deleting a project** - Requires an empty project, including an empty recycle bin.

To empty the recycle bin, [recover](/getting-started/key-concepts/projects.md#recovering-deleted-objects) or [permanently delete](/getting-started/key-concepts/projects.md#permanently-deleting-objects) every object in it. Objects past their **Scheduled Purge Time** still count until the platform permanently deletes them, so if only those objects remain, try again later.

## DBClusters

When you terminate a DBCluster in a project with data retention turned on, the DBCluster enters the `terminate_pending` status instead of being deleted. The cluster is inaccessible until the retention period ends, and then it is permanently deleted. Until then, it continues to incur charges as if it were running.

To recover a DBCluster before its retention period ends, use the [`/dbcluster-xxxx/recover`](/developer/api/introduction-to-data-object-classes/dbclusters.md#api-method-dbcluster-xxxx-recover) API method. For more about DBClusters, see [Relational Database Clusters](/user/objects/relational-database-clusters.md).

## Apps and Global Workflows

When the billing org of an app or global workflow enforces data retention, deleting a version marks it for deletion instead of deleting it immediately. The version can't be run, and it is permanently deleted when the retention period ends.

Recovery of app and global workflow versions is available only through the API. To recover a version, use [`/app-xxxx[/yyyy]/recover`](/developer/api/running-analyses/apps.md#api-method-app-xxxx-yyyy-recover) or [`/globalworkflow-xxxx[/yyyy]/recover`](/developer/api/running-analyses/global-workflows.md#api-method-globalworkflow-xxxx-yyyy-recover). Recovery also restores the version's aliases, except any that another version has claimed since the deletion.

## Learn More

* [Deleting objects in a project](/getting-started/key-concepts/projects.md#deleting-objects)
* [Set Org Data Retention Policies](/admin/org-management.md#set-org-data-retention-policies)
* [Recycle Bin in the API reference](/developer/api/data-containers/folders-and-deletion.md#recycle-bin)
* [`/project-xxxx/listRecycleBin`](/developer/api/data-containers/projects.md#api-method-project-xxxx-listrecyclebin)
* [`/project-xxxx/recoverObjects`](/developer/api/data-containers/projects.md#api-method-project-xxxx-recoverobjects)
* [`/project-xxxx/purgeRecycleBinObjects`](/developer/api/data-containers/projects.md#api-method-project-xxxx-purgerecyclebinobjects)
* [Org Policies](/developer/api/organizations.md#org-policies)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://documentation.dnanexus.com/user/objects/data-retention.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
