Skip to content

DESCRIBE HISTORY: the table's versions, newest first — `version`, `timestamp`, `operation`

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

DESCRIBE HISTORY: the table’s versions, newest first — version, timestamp, operation (CREATE TABLE, WRITE, UPDATE, DELETE, MERGE, ALTER TABLE, ADD COLUMNS, RESTORE, UNDO, …; EXTERNAL_EDIT = changed outside the engine: an editor, git, sync), operation_metrics and migration_id (undo). An EXTERNAL_EDIT’s operation_metrics.violations counts the rules this table’s rows break because of the hand edits it holds (each once): the edited rows whose front matter changed and the rows of the table linking to them, a removed or renamed row included (rows of other tables count in their table; a body-only edit is not checked); every rule its rows break when its definition was edited in metastore.yaml. Absent when nothing was checked, or when the edits were logged right before an engine write (the change feed has them); check_table lists the rows invalid now. Works for dropped tables too (full catalog.schema.table). Use a version with select_rows (time travel), table_changes or restore_table. Without table: the history of the whole database — the commits of every table with a log (dropped ones included), newest first, each with its table (the result’s tables lists the logged tables). An operation that changed several tables (a cascade, inverse links, restore_database) commits to each with the same migration_id, and the operations of a batch carry its id as batch: their commits list in tables every table that operation (or batch) committed to. Pick a moment for restore_database from it (timestamp, or before_migration with a migration_id or a batch). limit (default 50) counts commits; since (ISO date or date-time): only commits at or after it.

Media typeapplication/json
object
table
Any of:
string
limit
Any of:
integer
since
Any of:
string

Done.

Media typeapplication/json
object
table

Qualified table (with table only).

string
history
required

Commits, newest first.

Array<object>
object
table

Without table: the table of the commit.

string
version
required
integer
timestamp
required

ISO date-time of the commit.

string
operation
required

E.g. CREATE TABLE, WRITE, UPDATE, DELETE, EXTERNAL_EDIT.

string
operation_parameters

Parameters of the operation.

object
key
additional properties
any
migration_id

Journal entry of the operation.

string
operation_metrics
required
object
num_added_files
required
integer
num_removed_files
required
integer
metadata_changed
required
boolean
violations

EXTERNAL_EDIT: the rules this table’s rows break because of the commit’s hand edits; absent when nothing was checked.

integer
engine_info
required
string
user_name

Harness / model of the agent (absent for hand edits).

string
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
batch

Without table: the batch the operation ran in (undo_migration on it reverts the batch).

string
tables

Without table: every table the same operation (or batch) committed to, when there are several.

Array<string>
tables

Without table: every table with a transaction log (dropped ones included).

Array<string>

Example generated

{
"table": "example",
"history": [
{
"table": "example",
"version": 1,
"timestamp": "example",
"operation": "example",
"operation_parameters": {},
"migration_id": "example",
"operation_metrics": {
"num_added_files": 1,
"num_removed_files": 1,
"metadata_changed": true,
"violations": 1
},
"engine_info": "example",
"user_name": "example",
"actor": {
"session": "example",
"harness": "example",
"harness_version": "example",
"model": "example",
"tool": "example",
"auth": "example"
},
"batch": "example",
"tables": [
"example"
]
}
],
"tables": [
"example"
]
}

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

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