Skip to content

KV Store

POST/api/v1/kv/batch/delete
POST
/api/v1/kv/batch/delete

POST /kv/batch/delete

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Request for batch delete

Response Body

application/json

curl -X POST "https://example.com/api/v1/kv/batch/delete" \  -H "Content-Type: application/json" \  -d '{    "keys": [      "string"    ]  }'
{  "deleted": [    "string"  ],  "forbidden": [    "string"  ],  "not_found": [    "string"  ]}
POST/api/v1/kv/batch/get
POST
/api/v1/kv/batch/get

POST /kv/batch/get

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Request for batch get

Response Body

application/json

curl -X POST "https://example.com/api/v1/kv/batch/get" \  -H "Content-Type: application/json" \  -d '{    "keys": [      "string"    ]  }'
{  "forbidden": [    "string"  ],  "items": {    "property1": {      "content_type": "string",      "value": null    },    "property2": {      "content_type": "string",      "value": null    }  },  "missing": [    "string"  ]}
POST/api/v1/kv/batch/set
POST
/api/v1/kv/batch/set

POST /kv/batch/set

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Request for batch set

Response Body

application/json

curl -X POST "https://example.com/api/v1/kv/batch/set" \  -H "Content-Type: application/json" \  -d '{    "items": [      {        "key": "string",        "value": null      }    ]  }'
{  "results": [    {      "error": "string",      "key": "string",      "success": true    }  ]}
GET/api/v1/kv/binary/{path}
GET
/api/v1/kv/binary/{path}

GET /kv/binary/{*path}

Path Parameters

path*string

Key path

Response Body

application/octet-stream

curl -X GET "https://example.com/api/v1/kv/binary/string"
Empty
PUT/api/v1/kv/binary/{path}
PUT
/api/v1/kv/binary/{path}

PUT /kv/binary/{*path}

Path Parameters

path*string

Key path (e.g., images/logo.png)

Query Parameters

nx?boolean

Only set if key does not exist

xx?boolean

Only set if key exists

ttl_seconds?integer

Time-to-live in seconds

Formatint64
Range0 <= value
tags?string

Tags (comma-separated)

private?boolean

Make the key private

Request Body

application/octet-stream

Raw binary data

TypeScript Definitions

Use the request body type in TypeScript.

[index: integer]?integer
Formatint32
Range0 <= value

Response Body

application/json

curl -X PUT "https://example.com/api/v1/kv/binary/string" \  -H "Content-Type: application/octet-stream" \  -d '<0>0</0>'
{  "content_type": "string",  "created_at": "2019-08-24T14:15:22Z",  "indexed": true,  "key": "string",  "owner": "string",  "private": true,  "size_bytes": 0,  "tags": [    "string"  ],  "ttl_expires_at": "2019-08-24T14:15:22Z",  "ttl_seconds": 0,  "updated_at": "2019-08-24T14:15:22Z"}
GET/api/v1/kv/keys
GET
/api/v1/kv/keys

GET /kv/keys

Query Parameters

filter?

Conditions as filter[][]=. Conditions on different fields all apply. in (any of) and all (every one of, on fields holding several values) take a comma-separated list (\, for a literal comma). exists takes true or false. Datetimes are RFC 3339, now, or a time before now such as -30m, -6h or -7d.

q?string

Full-text search over this list's searchable fields.

Length1 <= length <= 200
sort?string

Comma-separated sort keys, - for descending, at most 1. Keys: size_bytes, updated_at, created_at. Default: -created_at.

limit?integer

Rows per page, 1 to 100 (default 25).

Range1 <= value <= 100
cursor?string

The page.next_cursor of the previous page. Cannot be combined with page.

page?integer

A 1-based page number, for jumping. Cannot be combined with cursor.

Range1 <= value
total?boolean

Set to true to include the number of matching rows in page.total.

prefix?string

Only keys under this path prefix

depth?integer

Group keys deeper than this many segments below prefix into namespace entries (0 = immediate children only); the page then counts entries, ordered by key

Formatint32
Range0 <= value
mine?boolean

Only the caller's own keys

Response Body

application/json

curl -X GET "https://example.com/api/v1/kv/keys"
{  "keys": [    {      "child_count": 0,      "content_type": "string",      "created_at": "2019-08-24T14:15:22Z",      "is_namespace": true,      "key": "string",      "owner": "string",      "private": true,      "size_bytes": 0,      "tags": [        "string"      ],      "ttl_expires_at": "2019-08-24T14:15:22Z",      "updated_at": "2019-08-24T14:15:22Z"    }  ],  "page": {    "has_more": true,    "next_cursor": "string",    "page": 0,    "total": 0  }}
POST/api/v1/kv/ops/increment/{path}
POST
/api/v1/kv/ops/increment/{path}

POST /kv/ops/increment/{*path}

Path Parameters

path*string

Key path

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Request to increment a numeric value

Response Body

application/json

curl -X POST "https://example.com/api/v1/kv/ops/increment/string" \  -H "Content-Type: application/json" \  -d '{}'
{  "key": "string",  "value": 0}
POST/api/v1/kv/ops/ttl/{path}
POST
/api/v1/kv/ops/ttl/{path}

POST /kv/ops/ttl/{*path}

Path Parameters

path*string

Key path

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Request to manage TTL

Response Body

application/json

curl -X POST "https://example.com/api/v1/kv/ops/ttl/string" \  -H "Content-Type: application/json" \  -d '{}'
{  "key": "string",  "sliding": true,  "ttl_expires_at": "2019-08-24T14:15:22Z",  "ttl_seconds": 0}
GET/api/v1/kv/search
GET
/api/v1/kv/search

GET /kv/search

Query Parameters

filter?

Conditions as filter[][]=. Conditions on different fields all apply. in (any of) and all (every one of, on fields holding several values) take a comma-separated list (\, for a literal comma). exists takes true or false. Datetimes are RFC 3339, now, or a time before now such as -30m, -6h or -7d.

q?string

Full-text search over this list's searchable fields.

Length1 <= length <= 200
sort?string

Comma-separated sort keys, - for descending, at most 1. Keys: size_bytes, updated_at, created_at. Default: -created_at.

limit?integer

Rows per page, 1 to 100 (default 25).

Range1 <= value <= 100
cursor?string

The page.next_cursor of the previous page. Cannot be combined with page.

page?integer

A 1-based page number, for jumping. Cannot be combined with cursor.

Range1 <= value
total?boolean

Set to true to include the number of matching rows in page.total.

prefix?string

Only keys under this path prefix

Response Body

application/json

curl -X GET "https://example.com/api/v1/kv/search"
{  "page": {    "has_more": true,    "next_cursor": "string",    "page": 0,    "total": 0  },  "results": [    {      "content_type": "string",      "key": "string",      "score": 0.1,      "snippet": "string",      "tags": [        "string"      ],      "updated_at": "2019-08-24T14:15:22Z"    }  ]}
GET/api/v1/kv/stats
GET
/api/v1/kv/stats

GET /kv/stats

Query Parameters

prefix?string

Limit stats to a namespace prefix

Response Body

application/json

curl -X GET "https://example.com/api/v1/kv/stats"
{  "indexed_keys": 0,  "keys_by_content_type": {    "property1": 0,    "property2": 0  },  "keys_by_namespace": {    "property1": 0,    "property2": 0  },  "keys_with_ttl": 0,  "private_keys": 0,  "total_keys": 0,  "total_size_bytes": 0}
GET/api/v1/kv/{path}
GET
/api/v1/kv/{path}

GET /kv/{*path}

Path Parameters

path*string

Key path

Query Parameters

path?string

JSONPath expression to extract a subset

include_metadata?boolean

Include full metadata

Response Body

application/json

curl -X GET "https://example.com/api/v1/kv/string"
{  "content_type": "string",  "key": "string",  "metadata": null,  "updated_at": "2019-08-24T14:15:22Z",  "value": null}
PATCH/api/v1/kv/{path}
PATCH
/api/v1/kv/{path}

PATCH /kv/{*path}

Path Parameters

path*string

Key path

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Request for JSON merge patch

Response Body

application/json

curl -X PATCH "https://example.com/api/v1/kv/string" \  -H "Content-Type: application/json" \  -d '{    "patch": null  }'
{  "key": "string",  "value": null}
DELETE/api/v1/kv/{path}
DELETE
/api/v1/kv/{path}

DELETE /kv/{*path}

Path Parameters

path*string

Key path

Response Body

curl -X DELETE "https://example.com/api/v1/kv/string"
Empty
HEAD/api/v1/kv/{path}
HEAD
/api/v1/kv/{path}

HEAD /kv/{*path}

Path Parameters

path*string

Key path

Response Body

curl -X HEAD "https://example.com/api/v1/kv/string"
Empty
PUT/api/v1/kv/{path}
PUT
/api/v1/kv/{path}

PUT /kv/{*path}

Path Parameters

path*string

Key path (e.g., config/db/host)

Query Parameters

nx?boolean

Only set if key does not exist

xx?boolean

Only set if key exists

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Request to set a key-value pair (JSON body)

Response Body

application/json

application/json

curl -X PUT "https://example.com/api/v1/kv/string" \  -H "Content-Type: application/json" \  -d '{    "value": null  }'
{  "content_type": "string",  "created_at": "2019-08-24T14:15:22Z",  "indexed": true,  "key": "string",  "owner": "string",  "private": true,  "size_bytes": 0,  "tags": [    "string"  ],  "ttl_expires_at": "2019-08-24T14:15:22Z",  "ttl_seconds": 0,  "updated_at": "2019-08-24T14:15:22Z"}