---
# @generated by sylphx-gen 0.1.0 from contracts@e145cc7cf1bc9605f2b27439e5e17ed76a1a2fd7e7021906a013f7565e4a0cd5. Do not edit.
title: "Delete in KV"
description: "`data.kv.delete` (DELETE /v1/kv/{namespace_id}/{key}): Deletes a value."
type: reference
product: kv
summary: "Deletes a value."
updated: 2026-09-28
nav: false
---

Deletes a value.

- **Path** `DELETE https://api.data.sylphx.com/v1/kv/namespace-id/key`
- **Scope** `data:write`
- **Effect** `destructive` — a successful call removes data; the CLI asks before it runs.
- **Collection** [kv](/docs/api/kv)
- **Query** `expected_version`
- **Host** `https://api.data.sylphx.com`

## Request

| Field | Type | What it is |
| --- | --- | --- |
| `namespace_id` | `string` | The namespace's id. Required. |
| `key` | `string` | The key. Required. |
| `expected_version` | `uint64` | Delete only when the current version equals this one (0: any). |

## Response

| Field | Type | What it is |
| --- | --- | --- |
| `deleted` | `bool` | Whether the key existed. |

## Errors

- [`UNAUTHENTICATED`](/docs/api/errors/UNAUTHENTICATED) — No valid key or token was presented.
- [`PERMISSION_DENIED`](/docs/api/errors/PERMISSION_DENIED) — The key lacks the method's permission.
- [`RESOURCE_NOT_FOUND`](/docs/api/errors/RESOURCE_NOT_FOUND) — The named Resource does not exist or is not visible.
- [`ETAG_MISMATCH`](/docs/api/errors/ETAG_MISMATCH) — The etag sent does not match the Resource's current etag.

Every error arrives in the body [Errors](/docs/platform/errors) describes.

## Examples

**cURL**

```curl
curl -X DELETE "https://api.data.sylphx.com/v1/kv/namespace-id/key" \
  -H "Authorization: Bearer $SYLPHX_API_KEY"
```

**TypeScript**

```ts
const response = await sylphx.data.kv.delete({ key: 'key', namespaceId: 'namespace-id' })
```

**Rust**

```rust
let mut req = sylphx::data::DeleteValueRequest::default();
req.key = "key".to_string();
req.namespace_id = "namespace-id".to_string();
let response = sx.data().kv().delete(req).await?;
```

**MCP**

```json
{ "method_id": "data.kv.delete", "args": {"key":"key","namespace_id":"namespace-id"} }
```
