> ## Documentation Index
> Fetch the complete documentation index at: https://weights.fyi/run/llms.txt

# DELETE /v1/datasets/{dataset_id}

```text
DELETE https://weights.fyi/run/v1/datasets/<dataset_id>
Authorization: Bearer <token>                    scope: submit
```

**Available since:** 2026-10-08, with fine-tuning. Implemented 2026-10-09: the reservation released only once storage is clean, and `409 dataset_busy` during an upload.

**Answer time:** synchronous: the file is removed from storage and the dataset marked deleted before the answer comes.

Deletes a dataset's file and marks it `deleted`: the rows are your data, and this is how you take them back. The record stays, with name, counts and digest, so the jobs that used it can say what they learned from; the file cannot come back. While an open training job uses it the answer is `409 dataset_in_use` (the job may fetch it again after a move); finish or [stop](/run/docs/reference/jobs-cancel.md) that job first. Otherwise it is deleted at once, whatever its status, and repeating is safe. Models and checkpoints it trained stay, with no call to delete them yet.

Since the merge of 2026-10-09 the dataset is first marked unavailable to new jobs, then its file and anything a failed upload left are removed, and only then is its reservation released; if storage does not answer (`502 storage_unavailable`) it stays marked and reserved until you send the delete again.

## Request

| Name | Where | Required | Meaning |
|---|---|---|---|
| `Authorization` | header | yes | `Bearer` and your token. The token needs the `submit` scope, and the call counts against the token's request rate. |
| `dataset_id` | path | yes | The dataset's identifier, `ds_` followed by 24 hexadecimal characters. |

## Return value

**200 OK** with the dataset after the delete, as [GET /v1/datasets/{dataset_id}](/run/docs/reference/datasets-get.md) shows it.

## Errors

| Status | Code | When it happens | What to do |
|---|---|---|---|
| `401` | `unauthorized`, `invalid_token`, `token_revoked`, `token_expired` | No token, or one that does not work (any more). | Use a valid token. |
| `403` | `scope_required`, `account_suspended` | The token lacks `submit`, or the account is suspended. | Use a token with `submit`. |
| `404` | `dataset_not_found` | There is no such dataset in your account. | Check the id. |
| `409` | `dataset_in_use` | A training job that uses the dataset is still open; `jobs` lists every job that used it. | Wait for the open job to end, or stop it, then delete again. |
| `409` | `dataset_busy` | An upload of this dataset is running (merged 2026-10-09). | Wait for it to end, then delete. |
| `502` | `storage_unavailable` | Storage did not answer; the dataset keeps its reservation (merged 2026-10-09). | Send the delete again later. |
| `429` | `rate_limited` | The token sends work faster than its request rate. | Wait the `Retry-After` seconds and send again. |

## Examples

```sh
curl -s -X DELETE https://weights.fyi/run/v1/datasets/DATASET_ID -H "Authorization: Bearer $WEIGHTS_API_KEY"
```

```json
{
  "dataset_id": "ds_3c5312a9a04e76a477cec491",
  "name": "bad",
  "format": "laya-page-role/jsonl",
  "base_model": "laya-page-role-base",
  "labels": ["detail", "listing", "landing", "not_vacancy", "unresolved"],
  "status": "deleted",
  "error": "unknown_label",
  "rows": null,
  "train_rows": null,
  "validation_rows": null,
  "bytes": null,
  "sha256": null,
  "created_at": "2026-10-09T08:28:09.830Z",
  "ready_at": null,
  "jobs": []
}
```

## History

- 2026-10-08: live with fine-tuning.
- 2026-10-09 (merged): reservation released once storage is clean; `409 dataset_busy`; a refused delete can be sent again.

## See also

[GET /v1/datasets](/run/docs/reference/datasets-list.md), [Fine-tune a model](/run/docs/fine-tune.md).
