---
title: "Create or update a KV bucket"
method: PUT
path: "/storage/kv/{bucket}"
tags: ["KV Buckets"]
---

# Create or update a KV bucket

`PUT /storage/kv/{bucket}`

## Request

- Base URL: `https://api.quiva.ai`
- URL: `https://api.quiva.ai/storage/kv/{bucket}`
- 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/:bucket/put.ts> (a function with typed inputs; its response is checked against the schema)

Creates a new key-value bucket with optional indexing or updates it if one does not exist

## Path parameters

- `bucket` string, required

## Request body

- UpdateKVBucketRequest
  - `description` string: Updated description of the bucket
  - `max_bytes` integer: Updated maximum size of the bucket in bytes
  - `max_value_size` integer: Updated maximum size of individual values in bytes
  - `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

## Response `200`

Bad Request

- SuccessMessage
  - `message` string

## Other responses

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

## Changes

- **2025-07-04** `ad8205bf93a3`: 3 breaking, 3 info
  - removed the enum value `0.00` of the request property `indexing/storage_type`
  - removed the enum value `1.00` of the request property `indexing/storage_type`
  - the `indexing/storage_type` request property type changed from `integer` to `string`
  - the `storage_type` request property default value `0` was removed
  - …2 more
- **2025-07-04** `d566a61279be`: 3 breaking, 13 warning, 8 info
  - added the new path request parameter `bucket`
  - removed the enum value `geo_point` of the request property `indexing/mappings/items/field_type`
  - removed the success response with the status `201`
  - the `max_bytes` request property's min was set to `1.00`
  - …20 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/:bucket/put.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)
