Skip to main content
POST
/
storage
/
kv
Create a new KV bucket
curl --request POST \
  --url https://api.quiva.ai/storage/kv \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "bucket": "my-bucket",
  "description": "My test bucket",
  "compression": true,
  "history": 5,
  "max_bytes": 1048576,
  "max_value_size": 8192,
  "replicas": 3,
  "storage": 0,
  "indexing": {
    "mappings": [
      {
        "field": "name",
        "field_type": "text"
      },
      {
        "field": "age",
        "field_type": "number"
      }
    ],
    "partitions": 3,
    "replicas": 2,
    "storage_type": 0
  }
}
'
{
  "message": "success"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
bucket
string
required

Name of the bucket to create

compression
boolean
default:false

Whether to enable compression

description
string

Description of the bucket

history
integer
default:1

Number of historical versions to keep

Required range: x >= 1
indexing
object
max_bytes
integer<int64>

Maximum size of the bucket in bytes

Required range: x >= 1
max_value_size
integer<int32>

Maximum size of individual values in bytes

Required range: x >= 1
replicas
integer
default:1

Number of replicas

Required range: x >= 1
storage
enum<string>
Available options:
file,
memory

Response

Bad Request

message
string
Example:

"success"