# Delete dataset

URL: https://docs.hanzo.ai/docs/openapi/dataset/riskdeletedataset

> Disposes of one dataset and every version of it: the rows are dropped and the register is marked with what went.

`DELETE /v1/dataset/{name}`

> [Dataset →](https://docs.hanzo.ai/docs/openapi/dataset) · [All API references →](https://docs.hanzo.ai/docs/openapi) · [Get started →](https://docs.hanzo.ai/docs/guides)

|               |                                          |
| ------------- | ---------------------------------------- |
| **Address**   | `https://api.hanzo.ai/v1/dataset/{name}` |
| **Method**    | `DELETE`                                 |
| **Operation** | `riskDeleteDataset`                      |
| **Auth**      | `Authorization: Bearer $HANZO_API_KEY`   |

Disposes of one dataset and every version of it: the rows are
dropped and the register is marked with what went.

This is the ONLY expiry in this plane. Neither table carries a TTL, deliberately:
a table TTL is a fleet-wide clock no tenant can hold longer or shorten, which is
the opposite of a retention decision belonging to the tenant whose records they
are. The drop is a partition drop on (org, dataset), so the tenant is the first
component of the thing being dropped and a disposal cannot be spelled across one.

The BYTES are what goes. The register keeps one `disposed` row per version — the
name, the number, the spec, the digest and who disposed of it when — for two
reasons: a retention obligation is answered by a record of the deletion, not by
silence; and version numbers must stay monotone, so that after `orders` is
disposed of and declared again the next version is 4 and not 1. A number that
could be reused would make every citation of `orders v3` ambiguous forever.

It is not reversible and there is no soft state in between. A version a model
cited has no rows once this returns, and every read of it says so.

## Request

1 field.

| Field  | In   | Type   | Required | Description                         |
| ------ | ---- | ------ | -------- | ----------------------------------- |
| `name` | path | string | yes      | Name is the dataset, from the path. |

## Response

| Status    | Body                        | Meaning |
| --------- | --------------------------- | ------- |
| `200`     | dataset.riskDatasetDisposal | ok      |
| `default` | problem-details             | refused |

`200` body — 3 fields.

| Field      | In   | Type            | Always | Description                                                                                                                                                                            |
| ---------- | ---- | --------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `dataset`  | body | string          | —      | Dataset is the dataset that was disposed of.                                                                                                                                           |
| `rows`     | body | integer (int64) | —      | Rows is how many rows they held between them, as the REGISTER recorded them when each was materialised — not a count of what the drop deleted, which is gone by the time this answers. |
| `versions` | body | integer (int64) | —      | Versions is how many versions went.                                                                                                                                                    |

Failure carries the platform error shape — see [Errors](https://docs.hanzo.ai/docs/errors).

## Examples

**CLI**

```bash
hanzo dataset rm <name>
```

**SDK**

**.ts**

```ts
import { Configuration, DatasetApi } from 'hanzoai';

const api = new DatasetApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.riskDeleteDataset({ name: 'name' });
```

**.py**

```python
from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import DatasetApi

client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = DatasetApi(client).risk_delete_dataset(name='name')
```

**.go**

```go
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.DatasetAPI.RiskDeleteDataset(context.Background()).Execute()
if err != nil {
	return err
}
```

**.rs**

```rust
use hanzo_client::apis::{configuration::Configuration, dataset_api};

let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();

let result = dataset_api::risk_delete_dataset(&cfg, Default::default()).await?;
```

**.java**

```java
import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.DatasetApi;

ApiClient client = new ApiClient();
client.setBearerToken(System.getenv("HANZO_API_KEY"));

var result = new DatasetApi(client).riskDeleteDataset();
```

**HTTP**

```bash
curl -X DELETE https://api.hanzo.ai/v1/dataset/<name> \
  -H "Authorization: Bearer $HANZO_API_KEY"
```

**MCP**

Tool `dataset`, op `riskDeleteDataset` — POST the JSON-RPC envelope to `https://api.hanzo.ai/v1/mcp`.

```bash
curl -X POST https://api.hanzo.ai/v1/mcp \
  -H "Authorization: Bearer $HANZO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
       "jsonrpc": "2.0",
       "id": 1,
       "method": "tools/call",
       "params": {
         "name": "dataset",
         "arguments": {
           "op": "riskDeleteDataset",
           "input": {
             "name": "<name>"
           }
         }
       }
     }'
```

---

[Dataset API](https://docs.hanzo.ai/docs/openapi/dataset) · [All Hanzo APIs](https://docs.hanzo.ai/docs/openapi) · [Interactive reference](https://docs.hanzo.ai/docs/openapi/reference)
