Delete dataset

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}

Addresshttps://api.hanzo.ai/v1/dataset/{name}
MethodDELETE
OperationriskDeleteDataset
AuthAuthorization: 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.

FieldInTypeRequiredDescription
namepathstringyesName is the dataset, from the path.

Response

StatusBodyMeaning
200dataset.riskDatasetDisposalok
defaultproblem-detailsrefused

200 body — 3 fields.

FieldInTypeAlwaysDescription
datasetbodystring—Dataset is the dataset that was disposed of.
rowsbodyinteger (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.
versionsbodyinteger (int64)—Versions is how many versions went.

Failure carries the platform error shape — see Errors.

Examples

hanzo dataset rm <name>
import { Configuration, DatasetApi } from 'hanzoai';

const api = new DatasetApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.riskDeleteDataset({ name: 'name' });
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')
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
}
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?;
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();
curl -X DELETE https://api.hanzo.ai/v1/dataset/<name> \
  -H "Authorization: Bearer $HANZO_API_KEY"

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

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 · All Hanzo APIs · Interactive reference

Was this page useful?