openmemory
Docs
Records

Update a record (compare-and-set with expected_version)

PATCH
/v1/collections/{collection}/records/{id}

Authorization

headerAuthorizationBearer <token>

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

Path Parameters

collection*string

Collection name, e.g. commitments, goals, routines.

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

Request Body

application/json
  1. body
status?string
Lengthlength <= 50
due_at?|
Formatdate-time
data?

Shallow-merged into the existing data. Set a field to null to clear it.

expected_version?integer

Fail with 409 unless the record is at this version.

Range1 <= value

Response Body

Updated

application/json
  1. response
id*string
collection*string
key*string|null
status*string
due_at*string|null
data*
origin*Origin
Value in"user""agent""dream"
version*integer
created_at*string
updated_at*string
Example Request
curl -X PATCH 'https://api.openmemory.sh/v1/collections/string/records/string' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "id": "string",  "collection": "string",  "key": "string",  "status": "string",  "due_at": "string",  "data": {    "property1": null,    "property2": null  },  "origin": "user",  "version": 0,  "created_at": "string",  "updated_at": "string"}