---
# @generated by sylphx-gen 0.1.0 from contracts@e145cc7cf1bc9605f2b27439e5e17ed76a1a2fd7e7021906a013f7565e4a0cd5. Do not edit.
title: "Scan in KV"
description: "`data.kv.scan` (POST /v1/kv-scans): Walks a namespace's keys that match a glob (SCAN)."
type: reference
product: kv
summary: "Walks a namespace's keys that match a glob (SCAN)."
updated: 2026-09-28
nav: false
---

Walks a namespace's keys that match a glob (SCAN). Call again with the returned `cursor` until it is empty.

- **Path** `POST https://api.data.sylphx.com/v1/kv-scans`
- **Scope** `data:read`
- **Effect** `read` — nothing is written.
- **Collection** [kv](/docs/api/kv)
- **Host** `https://api.data.sylphx.com`

## Request

| Field | Type | What it is |
| --- | --- | --- |
| `namespace_id` | `string` | The namespace's id. Required. |
| `glob` | `string` | A glob of the keys to answer (`*`, `?`, `\` escapes); empty matches every key. |
| `cursor` | `string` | The `cursor` of the previous call; empty starts the walk. |
| `count` | `uint32` | At most this many keys per call; the service caps it at 1000. |

## Response

| Field | Type | What it is |
| --- | --- | --- |
| `keys` | `string[]` | The matching keys of this step. |
| `cursor` | `string` | Pass to the next call; empty when the walk is done. |

## 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.
- [`INVALID_FIELD`](/docs/api/errors/INVALID_FIELD) — A field failed validation.
- [`RESOURCE_NOT_FOUND`](/docs/api/errors/RESOURCE_NOT_FOUND) — The named Resource does not exist or is not visible.

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

## Examples

**cURL**

```curl
curl -X POST "https://api.data.sylphx.com/v1/kv-scans" \
  -H "Authorization: Bearer $SYLPHX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"namespace_id":"…"}'
```

**TypeScript**

```ts
const response = await sylphx.data.kv.scan({ namespaceId: '…' })
```

**Rust**

```rust
let mut req = sylphx::data::ScanValuesRequest::default();
req.namespace_id = "…".to_string();
let response = sx.data().kv().scan(req).await?;
```

**MCP**

```json
{ "method_id": "data.kv.scan", "args": {"namespace_id":"…"} }
```
