Delete kv — DELETE /v1/kv/{bucket}/{key}

Removes one key — a delete marker in the key's history, so watchers see it and Get answers 404 — and answers 204 with no body.

DELETE /v1/kv/{bucket}/{key}

Addresshttps://api.hanzo.ai/v1/kv/{bucket}/{key}
MethodDELETE
Operationdelete_kv_by_bucket_by_key
AuthAuthorization: Bearer $HANZO_API_KEY

Removes one key — a delete marker in the key's history, so watchers see it and Get answers 404 — and answers 204 with no body. 404 when the bucket does not exist.

Request

2 fields.

FieldInTypeRequiredDescription
bucketpathstringyesBucket is the bucket, from the path.
keypathstringyesKey is the key, from the path.

Response

StatusBodyMeaning
204—no content
defaultproblem-detailsrefused

Failure carries the platform error shape — see Errors.

Examples

hanzo kv bucket rm <bucket> <key>
import { Configuration, KvApi } from 'hanzoai';

const api = new KvApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.deleteKvByBucketByKey({ bucket: 'bucket', key: 'key' });
from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import KvApi

client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = KvApi(client).delete_kv_by_bucket_by_key(bucket='bucket', key='key')
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.KvAPI.DeleteKvByBucketByKey(context.Background()).Execute()
if err != nil {
	return err
}
use hanzo_client::apis::{configuration::Configuration, kv_api};

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

let result = kv_api::delete_kv_by_bucket_by_key(&cfg, Default::default()).await?;
import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.KvApi;

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

var result = new KvApi(client).deleteKvByBucketByKey();
curl -X DELETE https://api.hanzo.ai/v1/kv/<bucket>/<key> \
  -H "Authorization: Bearer $HANZO_API_KEY"

Tool kv, op delete_kv_by_bucket_by_key — 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": "kv",
         "arguments": {
           "op": "delete_kv_by_bucket_by_key",
           "input": {
             "bucket": "<bucket>",
             "key": "<key>"
           }
         }
       }
     }'

KV API · All Hanzo APIs · Interactive reference

Was this page useful?