Skip to content

Change data feed

The change feed, list_changes, lists every change as an event: writes through the engine, hand edits with the rules they break, schema changes and, when asked for, tool calls. It works without history. Poll it from a position, or wait for the next event with wait_ms; a webhook has the engine post each event to a web address instead.

Change feed and webhooks shows how a program follows the feed.

list_changes returns numbered row changes across all tables, oldest first. It includes engine writes and hand edits (source: external). Keep the returned last and pass it as since next time to get only what’s new. wait_ms waits for the next change, a technique called long polling.

list_changes

{ "tables": ["film"], "limit": 3 }
Answer (74 lines)
{
"events": [
{
"seq": 3,
"at": "2026-11-21T07:27:26.202Z",
"table": "main.public.film",
"kind": "insert",
"op": "insert_row",
"path": "datanotes/main/public/film/Nosferatu.md",
"row_id": "01a1fd00-bbf7-7c90-9b7e-4efe87cb3eca",
"changes": {
"id": { "after": "01a1fd00-bbf7-7c90-9b7e-4efe87cb3eca" },
"title": { "after": "Nosferatu" },
"status": { "after": "to watch" }
},
"source": "engine",
"row": {
"id": "01a1fd00-bbf7-7c90-9b7e-4efe87cb3eca",
"title": "Nosferatu",
"status": "to watch"
},
"actor": { "session": "history", "harness": "docs-example", "auth": "owner" },
"migration_id": "20261121T072726-insert_row-insert-into-film"
},
{
"seq": 4,
"at": "2026-11-21T07:27:26.206Z",
"table": "main.public.film",
"kind": "insert",
"op": "insert_row",
"path": "datanotes/main/public/film/Metropolis.md",
"row_id": "01a1fd00-bbfc-74d7-9aee-ee78849d14e6",
"changes": {
"id": { "after": "01a1fd00-bbfc-74d7-9aee-ee78849d14e6" },
"title": { "after": "Metropolis" },
"status": { "after": "to watch" }
},
"source": "engine",
"row": {
"id": "01a1fd00-bbfc-74d7-9aee-ee78849d14e6",
"title": "Metropolis",
"status": "to watch"
},
"actor": { "session": "history", "harness": "docs-example", "auth": "owner" },
"migration_id": "20261121T072726-insert_row-insert-into-film-2"
},
{
"seq": 5,
"at": "2026-11-21T07:27:26.210Z",
"table": "main.public.film",
"kind": "update",
"op": "update_row",
"path": "datanotes/main/public/film/Nosferatu.md",
"row_id": "01a1fd00-bbf7-7c90-9b7e-4efe87cb3eca",
"changes": {
"status": { "before": "to watch", "after": "watched" },
"rating": { "after": 4 },
"watched_on": { "after": "2026-10-03" }
},
"source": "engine",
"row": {
"id": "01a1fd00-bbf7-7c90-9b7e-4efe87cb3eca",
"title": "Nosferatu",
"status": "watched",
"rating": 4,
"watched_on": "2026-10-03"
},
"actor": { "session": "history", "harness": "docs-example", "auth": "owner" },
"migration_id": "20261121T072726-update_row-update-film"
}
],
"last": 5,
"head": 13
}

insert_row

{ "table": "film", "values": { "title": "His Girl Friday" } }

With since, the answer holds only the newer changes:

list_changes

{ "since": 13 }

Answer:

{
"events": [
{
"seq": 14,
"at": "2026-11-21T07:27:30.842Z",
"table": "main.public.film",
"kind": "insert",
"op": "insert_row",
"path": "datanotes/main/public/film/His Girl Friday.md",
"row_id": "01a1fd00-ce17-7340-a580-a6fc9c7c8e22",
"changes": {
"id": { "after": "01a1fd00-ce17-7340-a580-a6fc9c7c8e22" },
"title": { "after": "His Girl Friday" },
"status": { "after": "to watch" }
},
"source": "engine",
"row": {
"id": "01a1fd00-ce17-7340-a580-a6fc9c7c8e22",
"title": "His Girl Friday",
"status": "to watch"
},
"actor": { "session": "history", "harness": "docs-example", "auth": "owner" },
"migration_id": "20261121T072730-insert_row-insert-into-film"
}
],
"last": 14,
"head": 14
}

auth keeps the changes one credential made, session those of one agent session:

list_changes

{ "tables": ["film"], "auth": "owner", "limit": 2 }
Answer (50 lines)
{
"events": [
{
"seq": 3,
"at": "2026-11-21T07:27:26.202Z",
"table": "main.public.film",
"kind": "insert",
"op": "insert_row",
"path": "datanotes/main/public/film/Nosferatu.md",
"row_id": "01a1fd00-bbf7-7c90-9b7e-4efe87cb3eca",
"changes": {
"id": { "after": "01a1fd00-bbf7-7c90-9b7e-4efe87cb3eca" },
"title": { "after": "Nosferatu" },
"status": { "after": "to watch" }
},
"source": "engine",
"row": {
"id": "01a1fd00-bbf7-7c90-9b7e-4efe87cb3eca",
"title": "Nosferatu",
"status": "to watch"
},
"actor": { "session": "history", "harness": "docs-example", "auth": "owner" },
"migration_id": "20261121T072726-insert_row-insert-into-film"
},
{
"seq": 4,
"at": "2026-11-21T07:27:26.206Z",
"table": "main.public.film",
"kind": "insert",
"op": "insert_row",
"path": "datanotes/main/public/film/Metropolis.md",
"row_id": "01a1fd00-bbfc-74d7-9aee-ee78849d14e6",
"changes": {
"id": { "after": "01a1fd00-bbfc-74d7-9aee-ee78849d14e6" },
"title": { "after": "Metropolis" },
"status": { "after": "to watch" }
},
"source": "engine",
"row": {
"id": "01a1fd00-bbfc-74d7-9aee-ee78849d14e6",
"title": "Metropolis",
"status": "to watch"
},
"actor": { "session": "history", "harness": "docs-example", "auth": "owner" },
"migration_id": "20261121T072726-insert_row-insert-into-film-2"
}
],
"last": 4,
"head": 14
}

Push changes to a web address with webhooks

Section titled “Push changes to a web address with webhooks”

create_webhook makes the engine send row changes in batches to a web address (URL), as POST requests. The engine signs each batch with a hash-based message authentication code (HMAC) of the body, in X-Datanotes-Signature. It retries until the receiver answers with a 2xx status. Only this answer returns the secret: give it to the receiver so it can check the signature.

create_webhook

{ "url": "http://127.0.0.1:42713/datanotes-hook", "tables": ["film"] }

Answer:

{
"id": "wh_630f3df4a9ca",
"url": "http://127.0.0.1:42713/datanotes-hook",
"tables": ["film"],
"enabled": true,
"cursor": 14,
"created_at": "2026-11-21T07:27:30.846Z",
"failures": 0,
"status": "ok",
"secret": "<shown once>"
}

update_row

{
"table": "film",
"path": "datanotes/main/public/film/His Girl Friday.md",
"set": { "status": "watched" }
}

The receiver got this request:

{
"headers": {
"x-datanotes-signature": "sha256=cdfc7ee6f84685f269ed002859dc0d6922796e27f9d41657b53e36198e8ab6a3"
},
"body": {
"webhook": "wh_630f3df4a9ca",
"events": [
{
"seq": 15,
"at": "2026-11-21T07:27:30.851Z",
"table": "main.public.film",
"kind": "update",
"op": "update_row",
"path": "datanotes/main/public/film/His Girl Friday.md",
"row_id": "01a1fd00-ce17-7340-a580-a6fc9c7c8e22",
"changes": { "status": { "before": "to watch", "after": "watched" } },
"source": "engine",
"row": {
"id": "01a1fd00-ce17-7340-a580-a6fc9c7c8e22",
"title": "His Girl Friday",
"status": "watched"
},
"actor": { "session": "history", "harness": "docs-example", "auth": "owner" },
"migration_id": "20261121T072730-update_row-update-film"
}
],
"last": 15
}
}

list_webhooks (no arguments)

Answer:

{
"webhooks": [
{
"id": "wh_630f3df4a9ca",
"url": "http://127.0.0.1:42713/datanotes-hook",
"tables": ["film"],
"enabled": true,
"cursor": 15,
"created_at": "2026-11-21T07:27:30.846Z",
"last_delivery": "2026-11-21T07:27:30.854Z",
"failures": 0,
"status": "ok"
}
]
}

delete_webhook

{ "id": "wh_630f3df4a9ca" }

Answer:

{ "deleted": true }