# Create dispose

URL: https://docs.hanzo.ai/docs/openapi/label/riskdisposelabels

> Applies this tenant's retention, and only this tenant's.

`POST /v1/label/dispose`

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

|               |                                         |
| ------------- | --------------------------------------- |
| **Address**   | `https://api.hanzo.ai/v1/label/dispose` |
| **Method**    | `POST`                                  |
| **Operation** | `riskDisposeLabels`                     |
| **Auth**      | `Authorization: Bearer $HANZO_API_KEY`  |

Applies this tenant's retention, and only this tenant's.

It is bounded three ways, each a compliance property rather than a
convenience. It refuses a boundary younger than the platform floor, because a
label can be the input to an adverse action and five years is what the
retention ledger holds such a record for. It never touches a record under
litigation hold. And it disposes of whole records rather than redacting
fields.

It removes the derived columnar copy BEFORE the record, and refuses the whole
disposal if the warehouse cannot be reached. The other order would leave rows
in the warehouse that nothing can identify any more, which is a disposal that
did not happen and says it did.

## Request

1 field, body `application/json` (required).

| Field    | In   | Type   | Required | Description                                                          |
| -------- | ---- | ------ | -------- | -------------------------------------------------------------------- |
| `before` | body | string | —        | Before disposes of assertions WRITTEN before this instant, RFC 3339. |

## Response

| Status    | Body                 | Meaning |
| --------- | -------------------- | ------- |
| `200`     | label.riskDisposeOut | ok      |
| `default` | problem-details      | refused |

`200` body — 7 fields.

| Field       | In   | Type            | Always | Description                                                                                                                                                                                                                                                                     |
| ----------- | ---- | --------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `before`    | body | string          | —      | Before echoes the retention boundary that was applied, RFC 3339 in UTC, as this plane parsed it from the request.                                                                                                                                                               |
| `disposed`  | body | integer (int64) | —      | Disposed is how many whole records were removed.                                                                                                                                                                                                                                |
| `held`      | body | integer (int64) | —      | Held is how many records inside the boundary were kept under litigation hold.                                                                                                                                                                                                   |
| `oldest`    | body | string          | —      | Oldest is the WRITE time of the oldest assertion this tenant still holds after the sweep, RFC 3339, and it is omitted exactly when nothing remains at all.                                                                                                                      |
| `remaining` | body | integer (int64) | —      | Remaining is how many disposable records are still older than the boundary.                                                                                                                                                                                                     |
| `restored`  | body | integer (int64) | —      | Restored is how many records this sweep had already removed from the derived columnar copy and then did NOT dispose of, because a litigation hold arrived between the identify and the delete — and which were therefore written back to the derived copy before this answered. |
| `total`     | body | integer (int64) | —      | Total and Oldest describe what the tenant still holds afterwards, so a disposal that removed nothing is distinguishable from a tenant that had nothing.                                                                                                                         |

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

## Examples

**CLI**

```bash
hanzo label dispose
```

**SDK**

**.ts**

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

const api = new LabelApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.riskDisposeLabels({ before: "<before>" });
```

**.py**

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

client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = LabelApi(client).risk_dispose_labels(before="<before>")
```

**.go**

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

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

**.rs**

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

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

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

**.java**

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

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

var result = new LabelApi(client).riskDisposeLabels();
```

**HTTP**

```bash
curl -X POST https://api.hanzo.ai/v1/label/dispose \
  -H "Authorization: Bearer $HANZO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
       "before": "<before>"
     }'
```

**MCP**

Tool `label`, op `riskDisposeLabels` — 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": "label",
         "arguments": {
           "op": "riskDisposeLabels",
           "input": {
             "before": "<before>"
           }
         }
       }
     }'
```

---

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