---
title: "Search KV entries by key pattern"
method: GET
path: "/storage/kv/{bucket}/search-by-key"
tags: ["KV Search"]
---

# Search KV entries by key pattern

`GET /storage/kv/{bucket}/search-by-key`

Searches for KV entries by key pattern (e.g., 'user*')

## Path parameters

- `bucket` string, required

## Query parameters

- `search` string, required
- `limit` integer

## Response `200`

Search results

- SearchByKeyResponse
  - `body` object
    - `results` SearchKVItem[]
      - `key` string
      - `value` string
    - `results_total` integer
  - `metadata` Metadata
    - `bucket` string — Bucket name
    - `duration` string — Operation duration
    - `field` string — Search field
    - `hits` integer — Number of hits
    - `index_duration` string — Index search duration
    - `index_hits` integer — Number of index hits
    - `index_name` string — Index name
    - `index_partitions` integer — Number of index partitions
    - `key` string — Entry key
    - `limit` integer — Query limit
    - `partitions` integer — Number of partitions
    - `search` string — Search term
    - `stream` string — Stream name
    - `subject` string — Subject pattern

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `404` — Not Found
- `500` — Internal Server Error

---

[API](https://skmtc.net/quivaworks/apis/quiva-ai-gateway-5.md) · [All operations](https://skmtc.net/quivaworks/apis/quiva-ai-gateway-5/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/quivaworks/quiva-ai-gateway-5/revisions/072de10ada5e/schema)
