Skip to content

Delete transaction-log history older than `retain_from_version` (default: keep only the

POST
/datanotes/operations/vacuum_table/
curl --request POST \
--url https://example.com/datanotes/operations/vacuum_table/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Datanotes-Actor: {"harness":"my-script","model":"","session":"s-1"}' \
--data '{ "table": "example", "retain_from_version": null, "dry_run": true }'

Delete transaction-log history older than retain_from_version (default: keep only the latest version); time travel before it becomes impossible. Rows are not touched. dry_run defaults to true: it lists the log files that would go. Only on the user’s explicit request.

X-Datanotes-Actor
string

JSON: on whose behalf the write is made, recorded in the journal (harness, model, session).

Example

{"harness":"my-script","model":"","session":"s-1"}
Media typeapplication/json
object
table
required
string
retain_from_version
Any of:
integer
dry_run
boolean
default: true

Done.

Media typeapplication/json
object
table
required
string
retained_from
required

Oldest version still available for time travel.

integer
deleted
required

Log files deleted (or to delete, on a dry run).

Array<string>
dry_run
required
boolean

Example generated

{
"table": "example",
"retained_from": 1,
"deleted": [
"example"
],
"dry_run": true
}

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 beyond its permissions (the engine’s administration, tables outside its write patterns, schema changes without ddl).

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