openmemory
Docs
KV

Set a value (optionally compare-and-set)

PUT
/v1/kv/{ns}/{key}

Authorization

headerAuthorizationBearer <token>

Your space key (om_...). Create one with POST /v1/spaces.

Path Parameters

ns*string

Namespace, e.g. settings or cursors. Names starting with '_' are reserved.

Match^[A-Za-z0-9][A-Za-z0-9_.-]*$
Length1 <= length <= 64
key*string
Length1 <= length <= 200

Request Body

application/json
  1. body
value?unknown

Any JSON value.

expected_version?integer

0 = only create; n = only update if at version n. Omit to upsert.

Range0 <= value
expires_at?|
Formatdate-time

Response Body

Saved

application/json
  1. response
ns*string
key*string
value?unknown
version*integer
expires_at*string|null
updated_at*string
Example Request
curl -X PUT 'https://api.openmemory.sh/v1/kv/string/string' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "ns": "string",  "key": "string",  "value": null,  "version": 0,  "expires_at": "string",  "updated_at": "string"}