Skip to content
Hoody.com

The KV Store on the Hoody platform maintains a full time-travel log of every operation. This page covers the endpoints that let you inspect that history — listing query executions, reconstructing a key or an entire table at any point in time, diffing two snapshots, and rolling back changes. Use these endpoints for auditing, debugging accidental writes, or building undo workflows on top of the KV store.

All endpoints below target the SQLite container’s HTTP interface and share the same per-project host template.

These endpoints operate on the database-level query log, independent of any specific KV key.

Retrieve query execution history for a database. Each entry records the SQL executed, its timestamp, duration, and result summary.

NameInTypeRequiredDescription
dbquerystringYesDatabase file path
limitqueryintegerNoMaximum number of entries to return. Default: 100.
Terminal window
curl "https://a1b2c3d4-7890abcdef12-sqlite-1.eu-west-1.containers.hoody.icu/api/v1/sqlite/history?db=app.db&limit=50"

Retrieve aggregated statistics over the query history of a database — totals, average durations, top patterns, and error counts.

NameInTypeRequiredDescription
dbquerystringYesDatabase file path
Terminal window
curl "https://a1b2c3d4-7890abcdef12-sqlite-1.eu-west-1.containers.hoody.icu/api/v1/sqlite/history/stats?db=app.db"

Remove every query history entry associated with a database. This action is irreversible.

NameInTypeRequiredDescription
dbquerystringYesDatabase file path
Terminal window
curl -X DELETE "https://a1b2c3d4-7890abcdef12-sqlite-1.eu-west-1.containers.hoody.icu/api/v1/sqlite/history?db=app.db"

Delete a single query history entry identified by its integer ID.

NameInTypeRequiredDescription
indexpathintegerYesHistory entry ID
dbquerystringYesDatabase file path
Terminal window
curl -X DELETE "https://a1b2c3d4-7890abcdef12-sqlite-1.eu-west-1.containers.hoody.icu/api/v1/sqlite/history/142?db=app.db"

These endpoints reconstruct and manipulate the state of KV keys and tables based on their operation history.

Return every recorded operation on a single key in reverse chronological order. Use it to audit who changed a key and when.

NameInTypeRequiredDescription
keypathstringYesKey name
dbquerystringYesDatabase file path
tablequerystringNoCustom table name. Default: "kv_store".
limitqueryintegerNoMaximum number of operations to return (0 resolves to default 50, clamped to maximum 1000). Default: 50.
Terminal window
curl "https://a1b2c3d4-7890abcdef12-sqlite-1.eu-west-1.containers.hoody.icu/api/v1/sqlite/kv/session:42/history?db=app.db&limit=20"

Reconstruct the value of a key as it appeared at a specific operation number. Combine with the history endpoint to inspect any past state without rolling back.

NameInTypeRequiredDescription
keypathstringYesKey name
dbquerystringYesDatabase file path
tablequerystringNoCustom table name. Default: "kv_store".
op_numberqueryintegerYesOperation number to reconstruct from
Terminal window
curl "https://a1b2c3d4-7890abcdef12-sqlite-1.eu-west-1.containers.hoody.icu/api/v1/sqlite/kv/session:42/snapshot?db=app.db&op_number=215"

Reconstruct the entire KV table state at a given Unix timestamp. Useful for restoring environments to a known-good point.

NameInTypeRequiredDescription
dbquerystringYesDatabase file path
tablequerystringNoCustom table name. Default: "kv_store".
timestampqueryintegerYesUnix timestamp to reconstruct from
limitqueryintegerNoMaximum number of keys to return. Default: 100.
prefixquerystringNoFilter keys by prefix
Terminal window
curl "https://a1b2c3d4-7890abcdef12-sqlite-1.eu-west-1.containers.hoody.icu/api/v1/sqlite/kv/snapshot?db=app.db&timestamp=1719436000&limit=100&prefix=session:"

Compare the KV table between two Unix timestamps and report which keys were created, modified, or deleted.

NameInTypeRequiredDescription
dbquerystringYesDatabase file path
tablequerystringNoCustom table name. Default: "kv_store".
fromqueryintegerYesStarting timestamp (Unix)
toqueryintegerYesEnding timestamp (Unix)
keysquerystringNoComma-separated list of keys to compare (optional)
Terminal window
curl "https://a1b2c3d4-7890abcdef12-sqlite-1.eu-west-1.containers.hoody.icu/api/v1/sqlite/kv/diff?db=app.db&from=1719435900&to=1719436212&keys=session:42,session:43"

Roll a key back by undoing the last N recorded operations on it. The operation is reversible: you can replay it later using the history endpoint.

NameInTypeRequiredDescription
keypathstringYesKey name
dbquerystringYesDatabase file path
tablequerystringNoCustom table name. Default: "kv_store".
stepsqueryintegerNoNumber of operations to rollback. Default: 1.

This endpoint accepts no request body.

Terminal window
curl -X POST "https://a1b2c3d4-7890abcdef12-sqlite-1.eu-west-1.containers.hoody.icu/api/v1/sqlite/kv/session:42/rollback?db=app.db&steps=1"

Roll back an entire KV table to its state at a specific Unix timestamp. This is a destructive operation and requires explicit confirmation via the confirm=yes query parameter. Use dry_run=true first to preview the changes.

NameInTypeRequiredDescription
dbquerystringYesDatabase file path
tablequerystringNoCustom table name. Default: "kv_store".
to_timestampqueryintegerYesTarget timestamp to rollback to (Unix)
dry_runquerybooleanNoPreview changes without applying. Default: false.
confirmquerystringNoMust be 'yes' to execute actual rollback

This endpoint accepts an optional JSON body for filter fields (keys to include or exclude). The server-side schema is open-ended; pass any object you need, or omit the body entirely.

{}
Terminal window
curl -X POST "https://a1b2c3d4-7890abcdef12-sqlite-1.eu-west-1.containers.hoody.icu/api/v1/sqlite/kv/rollback?db=app.db&to_timestamp=1719436000&dry_run=true" \
-H "Content-Type: application/json" \
-d '{}'