Skip to content

The version history of ONE row, like a document's: who created it, who changed it last, and every change, newest first. Read from the table's transaction log (nothing extra is stored in the note), so it needs history on for the table.

POST
/datanotes/operations/row_history/
curl --request POST \
--url https://example.com/datanotes/operations/row_history/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "table": "example", "id": null, "path": null, "limit": null, "since": null, "before": null }'

The version history of ONE row, like a document’s: who created it, who changed it last, and every change, newest first. Read from the table’s transaction log (nothing extra is stored in the note), so it needs history on for the table.

Name the row by table and id (its system UUID) or path (now, or before it was deleted). The row is followed by its id across renames and moves between tables (move_rows); a row without an id by its path.

  • created / last_modified: when, by which operation and agent (actor: session, harness, model, tool, auth). created is null when the oldest versions were vacuumed (history_start.truncated); a row present when its table’s history began shows that version (often CREATE TABLE, no actor).
  • versions: version (of table), timestamp, operation, change (insert, update, move, delete), source (external = a hand edit: an editor, git, a sync, no agent), actor, migration_id (undo_migration), path and old_path (rename), from_table (move), changes {column: {before, after}}, body_changed and body_diff (lines removed and added).
  • limit (default 50, max 1000), since / before (ISO date or date-time); pass next_before as before for the next, older page.

The whole row as it was at a version: select_rows with version (or timestamp). Every change of a table: table_changes; of the database: list_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
table
required

The table (a dropped one by its full catalog.schema.table name).

string
id
Any of:
string
path
Any of:
string
limit
Any of:
integer
since
Any of:
string
before
Any of:
string

Done.

Media typeapplication/json
object
table
required

The table the row is in now (or was in last, when deleted).

string
id

The row’s system id.

string
path
required

The row’s path now (or its last one).

string
exists
required

Whether the row exists now.

boolean
created
required

Its first version: null when the older versions were vacuumed.

object
table
required

The table the row was in.

string
version
required

The table’s version (describe_history; select_rows version reads the table as it was then).

integer
timestamp
required
string
operation
required

The log’s operation: WRITE, UPDATE, DELETE, MOVE ROWS, MERGE, RESTORE, UNDO, EXTERNAL_EDIT (a hand edit), …

string
change
required
string
Allowed values: insert update move delete
source
required

external: changed outside the engine (an editor, git, a sync): no agent is known.

string
Allowed values: engine external
path
required

The row’s path after the version (before it, for a delete).

string
actor

The agent behind the version (absent for hand edits): session, harness, harness_version, model, tool (reported by the agent’s MCP server) and auth (the credential: owner or a token’s name, set by the engine).

object
session
string
harness
string
harness_version
string
model
string
tool
string
auth
string
user_name

“harness / model” of the agent.

string
migration_id

The operation in the journal (list_migrations, undo_migration).

string
last_modified
required

Its newest version.

object
table
required

The table the row was in.

string
version
required

The table’s version (describe_history; select_rows version reads the table as it was then).

integer
timestamp
required
string
operation
required

The log’s operation: WRITE, UPDATE, DELETE, MOVE ROWS, MERGE, RESTORE, UNDO, EXTERNAL_EDIT (a hand edit), …

string
change
required
string
Allowed values: insert update move delete
source
required

external: changed outside the engine (an editor, git, a sync): no agent is known.

string
Allowed values: engine external
path
required

The row’s path after the version (before it, for a delete).

string
actor

The agent behind the version (absent for hand edits): session, harness, harness_version, model, tool (reported by the agent’s MCP server) and auth (the credential: owner or a token’s name, set by the engine).

object
session
string
harness
string
harness_version
string
model
string
tool
string
auth
string
user_name

“harness / model” of the agent.

string
migration_id

The operation in the journal (list_migrations, undo_migration).

string
history_start
required

Where the history read starts: the oldest version kept of the oldest table followed; truncated when older versions were vacuumed.

object
table
required
string
version
required
integer
timestamp
required
string
truncated
required
boolean
total
required

Versions matching since / before.

integer
versions
required

Newest first.

Array<object>
object
table
required

The table the row was in.

string
version
required

The table’s version (describe_history; select_rows version reads the table as it was then).

integer
timestamp
required
string
operation
required

The log’s operation: WRITE, UPDATE, DELETE, MOVE ROWS, MERGE, RESTORE, UNDO, EXTERNAL_EDIT (a hand edit), …

string
change
required
string
Allowed values: insert update move delete
source
required

external: changed outside the engine (an editor, git, a sync): no agent is known.

string
Allowed values: engine external
path
required

The row’s path after the version (before it, for a delete).

string
actor

The agent behind the version (absent for hand edits): session, harness, harness_version, model, tool (reported by the agent’s MCP server) and auth (the credential: owner or a token’s name, set by the engine).

object
session
string
harness
string
harness_version
string
model
string
tool
string
auth
string
user_name

“harness / model” of the agent.

string
migration_id

The operation in the journal (list_migrations, undo_migration).

string
old_path

A rename or move: the path before.

string
from_table

A move from another table (move_rows): the table it came from.

string
changes
required

The columns the version changed, {column: {before, after}} (null: no value); an insert lists every column it set.

object
key
additional properties
object
before
required
after
required
body_changed
required
boolean
body_diff

The body’s lines removed and added (at most 20 each, each cut at 200 characters; truncated when there were more).

object
removed
required
Array<string>
added
required
Array<string>
truncated
boolean
next_before

Pass as before for the next (older) page; absent on the last page.

string

Example

{
"created": {
"change": "insert",
"source": "engine"
},
"last_modified": {
"change": "insert",
"source": "engine"
},
"versions": [
{
"change": "insert",
"source": "engine"
}
]
}

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"
}

Unknown table, view, migration, note or folder.

Media typeapplication/json
object
error
required

What went wrong, for a person or an agent.

string

Example generated

{
"error": "example"
}

Ambiguous table name: it matches several tables (paths or tables lists them).

Media typeapplication/json
object
error
required
string
paths

The tables’ folders the name matches.

Array<string>
tables

The qualified tables the name matches.

Array<string>

Example generated

{
"error": "example",
"paths": [
"example"
],
"tables": [
"example"
]
}

Unexpected error.

Media typeapplication/json
object
error
required

What went wrong, for a person or an agent.

string

Example generated

{
"error": "example"
}