---
title: "Create a new KV bucket"
method: POST
path: "/storage/kv"
tags: ["KV Buckets"]
---

# Create a new KV bucket

`POST /storage/kv`

Creates a new key-value bucket with optional indexing configuration

## Request body

- CreateKVBucketRequest
  - `bucket` string, required — Name of the bucket to create
  - `compression` boolean — Whether to enable compression
  - `description` string — Description of the bucket
  - `history` integer — Number of historical versions to keep
  - `indexing` IndexRequest
    - `mappings` IndexMapping[], required — Field mappings for indexing
      - `field` string, required — Field name to be indexed
      - `field_type` 'text' | 'number' | 'date' | 'boolean' | 'keyword', required — Type of the field
    - `partitions` integer, required — Number of partitions for the index
    - `replicas` integer, required — Number of replicas for the index
    - `storage_type` 'file' | 'memory', required
    - `stream` string — Optional stream name for the index
  - `max_bytes` integer — Maximum size of the bucket in bytes
  - `max_value_size` integer — Maximum size of individual values in bytes
  - `replicas` integer — Number of replicas
  - `storage` 'file' | 'memory'

## Response `200`

Bad Request

- SuccessMessage
  - `message` string

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `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)
