Dataset
Package dataset is the per-org dataset plane of /v1/risk: a dataset is a VERSIONED, IMMUTABLE snapshot of one tenant's own event surface, and this is where it is declared, materialised, described,…
Package dataset is the per-org dataset plane of /v1/risk: a dataset is a VERSIONED, IMMUTABLE snapshot of one tenant's own event surface, and this is where it is declared, materialised, described, exported and disposed of.
| Base URL | https://api.hanzo.ai |
| Operations | 7 |
| Auth | Authorization: Bearer $HANZO_API_KEY |
Specification
Specification pending — no HIP in hanzoai/hips declares capability: dataset yet. What this capability serves is below, from the API document; what it is — the store it owns, how it meters, what it publishes — is written as a HIP under HIP-0139.
Four surfaces
| Surface | Reaches this capability as | Coverage |
|---|---|---|
| REST | dataset at its own prefix | 7 operations |
| CLI | — | no command reaches it yet — use HTTP or an SDK |
| SDK | DatasetApi in every published client | 7 methods |
| MCP | tool dataset on https://api.hanzo.ai/v1/mcp | 7 operations |
Quickstart
export HANZO_API_KEY=sk-... # console.hanzo.ai → API keysThen the first call — a read that needs nothing but the key. GET /v1/dataset, operation riskDatasets:
hanzo has no subcommand for this operation — the CLI serves only what cloud's live route table confirms. Use HTTP or an SDK.
import { Configuration, DatasetApi } from 'hanzoai';
const api = new DatasetApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.riskDatasets();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_datasets()cfg := cloud.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := cloud.NewAPIClient(cfg)
resp, _, err := client.DatasetAPI.RiskDatasets(context.Background()).Execute()
if err != nil {
return err
}use hanzo_cloud::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_datasets(&cfg, Default::default()).await?;import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.DatasetApi;
ApiClient client = new ApiClient();
client.setRequestInterceptor(b -> b.header("Authorization", "Bearer " + System.getenv("HANZO_API_KEY")));
var result = new DatasetApi(client).riskDatasets();curl https://api.hanzo.ai/v1/dataset \
-H "Authorization: Bearer $HANZO_API_KEY"Tool dataset, op riskDatasets — 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": "riskDatasets",
"input": {}
}
}
}'Answers 200 with object — ok.
Endpoints
| Endpoint | What it does |
|---|---|
GET /v1/dataset/{name}/export | Read a version's rows back, one page at a time |
GET /v1/dataset/{name}/lineage | Show where a version's rows came from, and whether that can still be demonstrated |
POST /v1/dataset/{name}/materialize | Materialise the declared version into immutable rows |
GET /v1/dataset/{name} | Describe every version of one dataset |
DELETE /v1/dataset/{name} | Dispose of one dataset and every version of it |
GET /v1/dataset | List this org's datasets |
POST /v1/dataset | Declare the next version of a dataset |
How is this guide?