ScalixScalix Docs
Sign up

Key-Value API

Key-value store API for Scalix Cloud with get, set, delete, exists, and list operations plus optional TTL on writes for caching and sessions.

REST API endpoints for Key-Value. 5 operations.

Delete keys

plaintext
POST /v1/kv/del

Removes one or more keys from the tenant's key-value store (batch delete).

Auth: Bearer API key

Request body

application/json (required) — schema KvDelRequest.

Body for /v1/kv/del — one or more keys to delete (batch delete). Matches the implementation (crates/kvstore/src/api.rs DelRequest), which takes a keys array, not a single key.

FieldTypeRequiredDescription
keysarray<string>Yes

Responses

StatusDescription
200Key deleted
401Missing or invalid API key
500Internal error

operationId: kvDel

Check if a key exists

plaintext
POST /v1/kv/exists

Returns whether a key is present in the tenant's key-value store.

Auth: Bearer API key

Request body

application/json (required) — schema KvKeyRequest.

Body for /v1/kv/get, /v1/kv/exists — a single key.

FieldTypeRequiredDescription
keystringYes

Responses

StatusDescription
200{ exists: bool }
401Missing or invalid API key
500Internal error

operationId: kvExists

Fetch a value by key

plaintext
POST /v1/kv/get

Reads a single key from the tenant's key-value store; returns value: null if absent.

Auth: Bearer API key

Request body

application/json (required) — schema KvKeyRequest.

Body for /v1/kv/get, /v1/kv/exists — a single key.

FieldTypeRequiredDescription
keystringYes

Responses

StatusDescription
200The stored value (or value: null if absent)
401Missing or invalid API key
500Internal error

operationId: kvGet

List keys

plaintext
POST /v1/kv/keys

Returns the keys in the tenant's key-value store matching an optional glob pattern.

Auth: Bearer API key

Request body

application/json (required) — schema KvKeysRequest.

Body for /v1/kv/keys — list keys matching an optional glob pattern.

FieldTypeRequiredDescription
patternstring | nullNoGlob pattern; defaults to * (all keys) when omitted.

Responses

StatusDescription
200{ keys: [string] } matching the pattern
401Missing or invalid API key
500Internal error

operationId: kvKeys

Set a value by key

plaintext
POST /v1/kv/set

Writes a value to the tenant's key-value store, with an optional TTL.

Auth: Bearer API key

Request body

application/json (required) — schema KvSetRequest.

Set a key in the key-value store. The downstream kvstore accepts a JSON value of any shape; ttl is in seconds and optional.

FieldTypeRequiredDescription
keystringYes
valueobjectYes
ttlinteger | null (int64)NoOptional time-to-live in seconds.

Responses

StatusDescription
200Value set
401Missing or invalid API key
500Internal error

operationId: kvSet