openmemory
Docs
Records

Create a record, or update the one with the same key

POST
/v1/collections/{collection}/records

On an update by key, fields you send replace the old values and fields you leave out keep them. data is replaced whole; to change single fields, use record_update.

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

Request Body

application/json
  1. body
key?string

Optional unique key within the collection. Writing it again updates that record: fields you send replace the old values, and fields you leave out keep them.

Length1 <= length <= 200
status?string

A new record defaults to an empty status.

Lengthlength <= 50
due_at?|

Send null to clear it on an update by key.

Formatdate-time
data?

Replaces all of the record's data when sent. A new record defaults to {}. To change single fields, use record_update.

origin?string

A new record defaults to agent.

Value in"user""agent"

Response Body

Updated by key

application/json
  1. response
record*
created*boolean
Example Request
curl -X POST 'https://api.openmemory.sh/v1/collections/string/records' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "record": {    "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"  },  "created": true}