---
title: Withdraw data
description: Remove data published by mistake, such as personal data, from every version of a dataset and from its forks
---

Withdrawing removes the data files, assets and metadata of versions that hold data that must not be published, such as personal data published by mistake, at once. Removed data cannot be restored. The record of a withdrawn version (its number and parents) stays in the history.

## Steps

1. Make a version without the data and push it to every branch that points at a version to withdraw. With fdl-cli 0.33 and later, the new version's metadata holds only its last snapshot, so it does not reach the data
2. Find the IDs of the versions to withdraw with `uvx --from fdl-cli fdl log <REPO>`
3. Call the withdrawal API. An administrator of the account that owns the dataset calls it with an API token that has the `datasets:write` permission

```bash
curl -X POST https://queria.io/api/datasets/<handle>/<dataset>/withdrawals \
  -H "Authorization: Bearer $QUERIA_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"versions": ["<version ID>"]}'
```

While a branch still points at a version to withdraw, the response is 409 with the list of those branches. Redo step 1 and call it again. Change requests whose head is a version to withdraw are closed.

Files that a version you do not withdraw still reads are kept and listed in `still_read` in the response. If such a file holds the data, call the withdrawal API again with the versions that read it.

## After withdrawing

- The removed data files and assets cannot be pushed again under the same names. Pushing from an old copy, such as a local clone, does not bring the withdrawn data back
- The same data is withdrawn from forks. Versions added in a fork that read the withdrawn data are withdrawn too, and the fork's branches that pointed at them move to the latest version of main in the upstream dataset. Changes added in the fork are lost, and the fork's owner makes them again
- A change request to the upstream dataset cannot be created from a branch that reads withdrawn data
- data.queria.io caches files of public datasets for up to a day, so a removed file may still be readable for that day
