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

# Create a new KV bucket

`POST /storage/kv`

## Request

- Base URL: `https://api.quiva.ai`
- URL: `https://api.quiva.ai/storage/kv`
- Auth: one of:
  - HTTP bearer
  - API key in header `x-api-key`
- TypeScript: <https://skmtc.dev/quivaworks/apis/quiva-ai-gateway-5/docs/storage/kv/post.ts> (a function with typed inputs; its response is checked against the schema)

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

## Changes

- **2025-07-04** `ad8205bf93a3`: 8 breaking, 6 info
  - removed the enum value `0.00` of the request property `indexing/storage_type`
  - removed the enum value `0.00` of the request property `storage`
  - removed the enum value `1.00` of the request property `indexing/storage_type`
  - removed the enum value `1.00` of the request property `storage`
  - …10 more
- **2025-07-04** `d566a61279be`: 5 breaking, 9 warning, 13 info
  - removed the enum value `file` of the request property `storage`
  - removed the enum value `geo_point` of the request property `indexing/mappings/items/field_type`
  - removed the enum value `memory` of the request property `storage`
  - the `storage` request property type changed from `string` to `integer`
  - …23 more
- **2025-06-13** `e4ad9e1ccd66`: 2 warning, 1 info
  - removed the optional property `bucket` from the response with the `201` status
  - removed the optional property `status` from the response with the `201` status
  - added the optional property `message` to the response with the `201` status

[Operation history](https://skmtc.dev/quivaworks/apis/quiva-ai-gateway-5/changes/storage/kv/post.md)

---

[API](https://skmtc.dev/quivaworks/apis/quiva-ai-gateway-5.md) - [All operations](https://skmtc.dev/quivaworks/apis/quiva-ai-gateway-5/llms.txt) - [OpenAPI document](https://skmtc.dev/quivaworks/apis/quiva-ai-gateway-5/revisions/104591eadd10?raw)
