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

# Zero data retention

> Read and enable zero data retention (ZDR), and what Boat deletes when it is on.

With zero data retention (ZDR), Boat queues every archived sandbox for deletion. You cannot resume a sandbox after it archives.

## Read the setting

You can read the setting from anywhere. An API key works.

<CodeGroup>
  ```bash CLI theme={null}
  boat data-retention status
  ```

  ```bash curl theme={null}
  curl -sS "$BOAT_API_BASE/account/data-retention" \
    -H "Authorization: Bearer $BOAT_API_KEY"
  ```

  ```ts TypeScript theme={null}
  const policy = await sandbox.getDataRetention();
  console.log(policy.enabled);
  ```

  ```python Python theme={null}
  policy = sandbox.get_data_retention()
  print(policy.enabled)
  ```
</CodeGroup>

`GET /me` also returns the setting, in the `zeroDataRetention` fields.

## Enable zero data retention

<Warning>
  To **change** the setting, you need an interactive browser session. An API key does not work. Run `boat login` without a key first, or use the dashboard. An SDK client that uses `BOAT_API_KEY` gets `403 session_required`. This is by design. Enabling ZDR queues every archived sandbox for deletion, so a leaked service credential must never reach it.
</Warning>

1. Sign in with a browser session. Run `boat login` without a key, or open the dashboard.
2. Send the exact phrase `delete archived sandbox data` as the confirmation.

<CodeGroup>
  ```bash CLI theme={null}
  boat data-retention enable          # prompts for the confirmation phrase
  boat data-retention enable --yes    # skip the prompt
  ```

  ```bash curl theme={null}
  curl -sS -X PATCH "$BOAT_API_BASE/account/data-retention" \
    -H "Authorization: Bearer $BOAT_SESSION_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{"enabled":true,"confirmation":"delete archived sandbox data"}'
  ```

  ```ts TypeScript theme={null}
  // Requires a browser session token, not an API key.
  await sandbox.updateDataRetention({
    enabled: true,
    confirmation: "delete archived sandbox data",
  });
  ```

  ```python Python theme={null}
  from boat_sdk.models.data_retention_update_request import DataRetentionUpdateRequest

  # Requires a browser session token, not an API key.
  sandbox.update_data_retention(DataRetentionUpdateRequest(
      enabled=True,
      confirmation="delete archived sandbox data",
  ))
  ```
</CodeGroup>

In the dashboard, the toggle is under **Data & privacy** on the [Account](https://boat.dev/dashboard?tab=account) tab.

## What happens when ZDR is on

* Boat queues your existing archived sandboxes for deletion.
* Future sandboxes discard their data when they archive.
* Boat removes your named snapshots and queues their data for deletion.
* Accepted deletions continue in the background until Boat verifies that they are complete.

<Warning>
  You cannot cancel a deletion operation. If you disable ZDR, only future archives change. Operations that Boat already accepted continue.
</Warning>

ZDR still snapshots a sandbox while it runs. Boat uses these snapshots to rebuild a sandbox after a machine fails. To keep nothing at all, turn [snapshots off](/data-retention/snapshots-and-monitoring-off#snapshots-off).


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