Skip to content

Change feed across all tables: numbered row changes (`seq`), oldest first, from engine writes

POST
/datanotes/operations/list_changes/
curl --request POST \
--url https://example.com/datanotes/operations/list_changes/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "since": 0, "tables": null, "kinds": null, "columns": null, "where": null, "exclude_actor": null, "auth": null, "session": null, "limit": 500, "wait_ms": 0 }'

Change feed across all tables: numbered row changes (seq), oldest first, from engine writes and from hand edits (source: external). Each has table, kind (insert, update, delete, move, metastore, unreadable), op (the operation that made it), path, row_id, changes ({column: {before, after}}), actor, migration_id. Hand edits are compared in batches (0.7 s after the last vault change, at most 5 s after the first), in the order they happened, renames included. A hand edit that creates, changes, renames or removes a row is checked against the tables’ rules (as check_table does) with the rows that link to it: the last event of each row in the batch has violations ([{path, violations: [{code, column | constraint (the CHECK’s name), index, message}]}]), what the edit breaks (a rule a row already broke is not listed); empty when it breaks nothing, absent when nothing was checked (engine events, a check that failed). A hand edit of metastore.yaml that changes tables’ entries checks every row of those tables: on its metastore event. At most 100 per event; violations_total then counts them all. A note renamed or moved by hand (a row or a plain note) has the links to its old path rewritten across the vault once the vault is quiet (4 s without a change; not while git pulls, rebases or merges; setting repairLinksOnHandMove, on by default), and its move event does not report them as broken_link: that repair’s events (op: repair_links) follow the batch and name the moves in cause ([{path, old_path, seq}], seq of the row’s move event). A hand edit that leaves a row’s front matter unreadable (broken YAML) is a kind: unreadable event with one violation of code unreadable: every read leaves the row out until the note is fixed, and the fix is an update of the row’s last readable state (an insert for a new note). Agents’ tool calls (reported by MCP servers) are kind: tool_call events (call: tool, args, ok, duration_ms, value, served_by), returned only when kinds includes tool_call. Pass the returned last as since next time (head is the newest number); wait_ms (max 60000) waits for a new change (long poll); limit max 5000. gap: true means older changes were dropped: re-read the tables. where filters rows as in select_rows (on the values after the change). auth: only the changes made with this credential (owner or a token’s name); session: only those of one agent session (with kinds: ["tool_call"]: its tool calls). Per-table versions: table_changes.

X-Datanotes-View-As
string

Owner only, on reads only (an operation that only reads, tokens/me/, extensions/, the change stream): the request runs with this named token’s permissions and read scope, and the token’s last_seen does not change. A named token sending it gets 403; a request that is not a read gets 400.

Media typeapplication/json
object
since
integer
0
tables
Any of:
Array<string>
kinds
Any of:
Array<string>
Allowed values: insert update delete move metastore tool_call unreadable
columns
Any of:
Array<string>
where
Any of:
object
key
additional properties
any
exclude_actor
Any of:
string
auth
Any of:
string
session
Any of:
string
limit
integer
default: 500
wait_ms
integer
0

Done.

Media typeapplication/json
object
events
required

Matching changes, oldest first.

Array<object>
object
seq
required

Sequence number.

integer
at
required

ISO date-time.

string
table
required

Qualified table, or null for a note outside any table.

string | null
kind
required

The kind of change: insert, update, delete, move, metastore (metastore.yaml), tool_call, or unreadable (a hand edit left the row’s front matter unreadable).

string
Allowed values: insert update delete move metastore tool_call unreadable
op

The operation that made it (insert_row, update_row, undo_migration, repair_links, …); absent for hand edits.

string
path
required
string
old_path

Previous path (move).

string
row_id

Row id.

string
changes

Changed columns: {before, after}.

object
key
additional properties
object
before

Any JSON value.

after

Any JSON value.

source
required
string
Allowed values: engine external
row

Row values after the change (before it, for a delete).

object
key
additional properties
any
actor
Actor

Who made the change.

object
session

MCP session id.

string
harness

App running the agent.

string
harness_version
string
model

Model id reported by the agent.

string
tool

Tool the agent called.

string
auth

Credential: owner, or the name of the token that made the request.

string
migration_id

Journal id of the engine operation.

string
call

The MCP tool call, for kind tool_call.

object
tool
required
string
args
required
object
key
additional properties
any
ok
required
boolean
duration_ms
required
number
value
required

The result, or the error text (long values cut).

summary

The result’s top-level scalars, and lists as their length.

object
key
additional properties
any
served_by
required

“engine”, or the MCP server that ran a tool of its own.

string
result_chars
integer
result_tokens
integer
session
string
violations

External insert / update / move / delete (the last event of the row in its batch): what the edit breaks, the row’s rules and those of the rows linking to it (a rule broken before the edit is not listed); external schema event: what the rows of the tables it changed break. Empty when nothing is broken; absent when nothing was checked. At most 100 (see violations_total).

Array<object>

The violations of one row.

object
path
required

The row that breaks the rule: the edited row or a row linking to it.

string
violations
required
Array<object>
ExternalViolation
object
code
required

Kind of violation.

string
Allowed values: required type min max step enum broken_link ref unique unknown_column check cycle vocabulary unreadable
column

Column the violation is about (all codes but check and unreadable).

string
index

The item of a list column, from 0.

integer
constraint

The CHECK’s name (code check).

string
message
required

Agent-readable explanation.

string
violations_total

How many violations there are in all, when violations holds only the first 100.

integer
cause

An engine write that follows hand edits (operation repair_links: the links repaired after notes were renamed or moved by hand): those moves.

Array<object>
object
path
required

The note’s path after the move.

string
old_path
required

Its path before the move.

string
seq

The move’s event, when the note is a row.

integer
last
required

Pass as since next time.

integer
head
required

Newest sequence number.

integer
gap

Events after since were dropped by retention: re-read the tables.

boolean

Example

{
"events": [
{
"kind": "insert",
"source": "engine",
"violations": [
{
"violations": [
{
"code": "required"
}
]
}
]
}
]
}

Bad input: the body is not a JSON object, or an argument is unknown, missing or of the wrong type.

Media typeapplication/json
object
error
required

What went wrong, for a person or an agent.

string

Example generated

{
"error": "example"
}

Missing or wrong bearer token.

Media typeapplication/json
object
error
required

What went wrong, for a person or an agent.

string

Example generated

{
"error": "example"
}

A named token whose read patterns do not cover the table, view or note the request names (such as token cook may not read personal.health.weight). Sets it did not name (listings, bases, search, the graph, the change feed) are filtered instead.

Media typeapplication/json
object
error
required

What went wrong, for a person or an agent.

string

Example generated

{
"error": "example"
}

Unexpected error.

Media typeapplication/json
object
error
required

What went wrong, for a person or an agent.

string

Example generated

{
"error": "example"
}