# Create hold

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

> Places or releases a litigation hold on named records.

`POST /v1/label/hold`

> [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/hold`   |
| **Method**    | `POST`                                 |
| **Operation** | `riskHoldLabels`                       |
| **Auth**      | `Authorization: Bearer $HANZO_API_KEY` |

Places or releases a litigation hold on named records.

A hold is a fact about the RECORD, not about the world: it says retention may
not dispose of this row, and it asserts nothing about what happened. So it is
not a field on an assertion and it is not folded into the content digest —
carried there it was silently a no-op on any record that already existed, since
re-filing the same assertion with a hold flag produced the same digest, the
insert was ignored, and the caller was answered `duplicate` while the hold it
asked for was never placed. This op is the one way a hold moves, in either
direction, and the move is written to the audit log.

Every named id is this tenant's or is nothing. The statement runs against the
tenant's own file, which holds no other tenant's rows and has no column that
could name one.

## Request

2 fields, body `application/json` (required).

| Field  | In   | Type      | Required | Description                                                                           |
| ------ | ---- | --------- | -------- | ------------------------------------------------------------------------------------- |
| `hold` | body | boolean   | —        | Hold is the state to put them in: true places the hold, false releases it.            |
| `ids`  | body | string\[] | —        | IDs are the content digests of the records, as returned by the write and by the read. |

## Response

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

`200` body — 4 fields.

| Field     | In   | Type            | Always | Description                                                      |
| --------- | ---- | --------------- | ------ | ---------------------------------------------------------------- |
| `changed` | body | integer (int64) | —      | Changed is how many records moved into that state.               |
| `held`    | body | integer (int64) | —      | Held is how many records this tenant is now holding, at any age. |
| `hold`    | body | boolean         | —      | Hold echoes the state asked for.                                 |
| `missing` | body | integer (int64) | —      | Missing is how many of the named ids this tenant does not hold.  |

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

## Examples

**CLI**

```bash
hanzo label hold
```

**SDK**

**.ts**

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

const api = new LabelApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.riskHoldLabels({ hold: false, ids: ["<ids>"] });
```

**.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_hold_labels(hold=False, ids=["<ids>"])
```

**.go**

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

resp, _, err := client.LabelAPI.RiskHoldLabels(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_hold_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).riskHoldLabels();
```

**HTTP**

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

**MCP**

Tool `label`, op `riskHoldLabels` — 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": "riskHoldLabels",
           "input": {
             "hold": false,
             "ids": [
               "<ids>"
             ]
           }
         }
       }
     }'
```

---

[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)
