> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.zata.prathamchopde.site/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.zata.prathamchopde.site/_mcp/server.

# Legal hold

A legal hold stops a file version from being deleted or overwritten, like a retention, but it has no end date. It stays until someone turns it off. Use it to keep files during a dispute, an audit or an investigation, for as long as needed.

A legal hold works on its own or together with a [Governance](/buckets/object-lock/governance-mode) or [Compliance](/buckets/object-lock/compliance-mode) retention. While the hold is on, the version cannot be deleted, even if its retention has ended. Legal holds work only in buckets with [Object Lock](/buckets/object-lock/overview), and you set them on one version at a time.

## Turn on a legal hold

#### Open Lock Settings

Open the bucket and turn on **Show Versions**. Open the version's **⋮** menu and select **Lock Settings**.

#### Turn on the switch

In **Version Details**, turn on the **Legal Hold** switch.

![Version Details with the Legal Hold switch pointed out below the Retention section](/_fern-img/fd1552891dd9cc6b2919d5873a1e415e17da25ec026f5d2bd9a363daa08e250e.webp)

#### Confirm

In **Enable Legal Hold**, select **Confirm**.

![The Enable Legal Hold window with the Confirm button](/_fern-img/7bb1b741fe927cef8ebd96d0d72c1de87231bcc77c6071fd0fc4efd6ddbb35b1.webp)

## Turn off a legal hold

Turn off the **Legal Hold** switch in the version's **Lock Settings** and select **Confirm** in **Disable Legal Hold**. The version can then be deleted, unless a retention still applies.

![The Disable Legal Hold window with the Confirm button](/_fern-img/0b601c4a0efe64c56a009396e0ed3d8b2396a24b0627c8af6e6d72fe6b640a9e.webp)

## Deleting a version on hold

While the hold is on, nobody can delete the version. The console shows **Legal Hold Active** and only lets you close the window.

![The Legal Hold Active window saying the version cannot be deleted until the Legal Hold is removed](/_fern-img/c577616fe771b1a0452cbf4195f9295e29f1c917e9585b20d29c9dbc510f7e68.webp)

## Use the AWS CLI

```bash
# Turn the hold on
aws s3api put-object-legal-hold --bucket my-locked-bucket --key myfile.txt --legal-hold Status=ON --profile zata

# Turn it off
aws s3api put-object-legal-hold --bucket my-locked-bucket --key myfile.txt --legal-hold Status=OFF --profile zata
```