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.
Name In Type Required Description dbquery string Yes Database file path limitquery integer No Maximum number of entries to return. Default: 100.
curl " https://a1b2c3d4-7890abcdef12-sqlite-1.eu-west-1.containers.hoody.icu/api/v1/sqlite/history?db=app.db&limit=50 "
await client . sqlite . history . list ({ db : " app.db " , limit : 50 });
" sql " : " INSERT INTO kv_store (key, value) VALUES ('session:42', '{ \" user \" : \" alice \" }') " ,
" sql " : " SELECT value FROM kv_store WHERE key = 'session:42' " ,
" message " : " Invalid db parameter " ,
" code " : " INVALID_DB_PATH "
Error Code Title Description Resolution INVALID_DB_PATHInvalid database path The provided database path is invalid or inaccessible Provide a valid absolute path, or use bare name / ./name shorthand (resolved to /hoody/databases/*.db) INVALID_PARAMETERSInvalid request parameters One or more request parameters are invalid or malformed Check parameter types and values against the API specification INVALID_SQLITE_HEADERNot a valid SQLite database The file exists but is not a valid SQLite database Ensure the file is a valid SQLite database with proper header PATH_IS_DIRECTORYPath is a directory Expected a .db file but got a directory (use table parameter for directory mode) Use a .db file path or add table parameter for directory mode KV store
Retrieve aggregated statistics over the query history of a database — totals, average durations, top patterns, and error counts.
Name In Type Required Description dbquery string Yes Database file path
curl " https://a1b2c3d4-7890abcdef12-sqlite-1.eu-west-1.containers.hoody.icu/api/v1/sqlite/history/stats?db=app.db "
await client . sqlite . history . getStats ({ db : " app.db " });
" first_entry_at " : 1719000000 ,
" last_entry_at " : 1719436212 ,
" average_duration_ms " : 2.7 ,
{ " table " : " kv_store " , " hits " : 120 },
{ " table " : " kv_sessions " , " hits " : 22 }
" message " : " Invalid db parameter " ,
" code " : " INVALID_DB_PATH "
Error Code Title Description Resolution INVALID_DB_PATHInvalid database path The provided database path is invalid or inaccessible Provide a valid absolute path, or use bare name / ./name shorthand (resolved to /hoody/databases/*.db) INVALID_PARAMETERSInvalid request parameters One or more request parameters are invalid or malformed Check parameter types and values against the API specification INVALID_SQLITE_HEADERNot a valid SQLite database The file exists but is not a valid SQLite database Ensure the file is a valid SQLite database with proper header PATH_IS_DIRECTORYPath is a directory Expected a .db file but got a directory (use table parameter for directory mode) Use a .db file path or add table parameter for directory mode KV store
" error " : " Internal Server Error " ,
" message " : " Failed to compute statistics " ,
Error Code Title Description Resolution DATABASE_ERRORDatabase operation failed An internal database error occurred Check server logs for details. Database may be corrupted or locked. FILE_SYSTEM_ERRORFile system error Failed to read or write filesystem in directory mode Check file permissions and disk space
Remove every query history entry associated with a database. This action is irreversible.
Name In Type Required Description dbquery string Yes Database file path
curl -X DELETE " https://a1b2c3d4-7890abcdef12-sqlite-1.eu-west-1.containers.hoody.icu/api/v1/sqlite/history?db=app.db "
await client . sqlite . history . clear ({ db : " app.db " });
" message " : " Invalid db parameter " ,
" code " : " INVALID_DB_PATH "
Error Code Title Description Resolution INVALID_DB_PATHInvalid database path The provided database path is invalid or inaccessible Provide a valid absolute path, or use bare name / ./name shorthand (resolved to /hoody/databases/*.db) INVALID_PARAMETERSInvalid request parameters One or more request parameters are invalid or malformed Check parameter types and values against the API specification INVALID_SQLITE_HEADERNot a valid SQLite database The file exists but is not a valid SQLite database Ensure the file is a valid SQLite database with proper header PATH_IS_DIRECTORYPath is a directory Expected a .db file but got a directory (use table parameter for directory mode) Use a .db file path or add table parameter for directory mode KV store
" error " : " Internal Server Error " ,
" message " : " Failed to clear history " ,
Error Code Title Description Resolution DATABASE_ERRORDatabase operation failed An internal database error occurred Check server logs for details. Database may be corrupted or locked. FILE_SYSTEM_ERRORFile system error Failed to read or write filesystem in directory mode Check file permissions and disk space
Delete a single query history entry identified by its integer ID.
Name In Type Required Description indexpath integer Yes History entry ID dbquery string Yes Database file path
curl -X DELETE " https://a1b2c3d4-7890abcdef12-sqlite-1.eu-west-1.containers.hoody.icu/api/v1/sqlite/history/142?db=app.db "
await client . sqlite . history . deleteEntry ( 142 , { db : " app.db " });
" message " : " Invalid db parameter " ,
" code " : " INVALID_DB_PATH "
Error Code Title Description Resolution INVALID_DB_PATHInvalid database path The provided database path is invalid or inaccessible Provide a valid absolute path, or use bare name / ./name shorthand (resolved to /hoody/databases/*.db) INVALID_PARAMETERSInvalid request parameters One or more request parameters are invalid or malformed Check parameter types and values against the API specification INVALID_SQLITE_HEADERNot a valid SQLite database The file exists but is not a valid SQLite database Ensure the file is a valid SQLite database with proper header PATH_IS_DIRECTORYPath is a directory Expected a .db file but got a directory (use table parameter for directory mode) Use a .db file path or add table parameter for directory mode KV store
" message " : " History entry not found " ,
Error Code Title Description Resolution KEY_NOT_FOUNDKey not found The requested key does not exist in the KV store Verify the key name and database/table parameters DATABASE_NOT_FOUNDDatabase file does not exist The specified database file was not found Check the file path or use create_db_if_missing=true to create it KEY_EXPIREDKey expired The key existed but has expired due to TTL The key was automatically deleted. Store a new value if needed.
" error " : " Internal Server Error " ,
" message " : " Failed to delete history entry " ,
Error Code Title Description Resolution DATABASE_ERRORDatabase operation failed An internal database error occurred Check server logs for details. Database may be corrupted or locked. FILE_SYSTEM_ERRORFile system error Failed to read or write filesystem in directory mode Check file permissions and disk space
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.
Name In Type Required Description keypath string Yes Key name dbquery string Yes Database file path tablequery string No Custom table name. Default: "kv_store". limitquery integer No Maximum number of operations to return (0 resolves to default 50, clamped to maximum 1000). Default: 50.
curl " https://a1b2c3d4-7890abcdef12-sqlite-1.eu-west-1.containers.hoody.icu/api/v1/sqlite/kv/session:42/history?db=app.db&limit=20 "
await client . sqlite . kvStore . getHistory ( " session:42 " , { db : " app.db " , limit : 20 });
" value " : " { \" user \" : \" alice \" , \" token \" : \" abc123 \" } " ,
" value " : " { \" user \" : \" alice \" } " ,
" message " : " limit must be a positive integer " ,
" code " : " INVALID_PARAMETERS "
Error Code Title Description Resolution INVALID_DB_PATHInvalid database path The provided database path is invalid or inaccessible Provide a valid absolute path, or use bare name / ./name shorthand (resolved to /hoody/databases/*.db) INVALID_PARAMETERSInvalid request parameters One or more request parameters are invalid or malformed (e.g. negative limit, malformed integer) Check parameter types and values against the API specification INVALID_SQLITE_HEADERNot a valid SQLite database The file exists but is not a valid SQLite database Ensure the file is a valid SQLite database with proper header PATH_IS_DIRECTORYPath is a directory Expected a .db file but got a directory (use table parameter for directory mode) Use a .db file path or add table parameter for directory mode KV store
" error " : " Internal Server Error " ,
" message " : " Failed to read history " ,
Error Code Title Description Resolution DATABASE_ERRORDatabase operation failed An internal database error occurred Check server logs for details. Database may be corrupted or locked. FILE_SYSTEM_ERRORFile system error Failed to read or write filesystem in directory mode Check file permissions and disk space
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.
Name In Type Required Description keypath string Yes Key name dbquery string Yes Database file path tablequery string No Custom table name. Default: "kv_store". op_numberquery integer Yes Operation number to reconstruct from
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 "
await client . sqlite . kvStore . getSnapshot ( " session:42 " , { db : " app.db " , op_number : 215 });
" reconstructed_at " : 1719436001 ,
" value " : " { \" user \" : \" alice \" } " ,
" message " : " op_number is required " ,
" code " : " INVALID_PARAMETERS "
Error Code Title Description Resolution INVALID_DB_PATHInvalid database path The provided database path is invalid or inaccessible Provide a valid absolute path, or use bare name / ./name shorthand (resolved to /hoody/databases/*.db) INVALID_PARAMETERSInvalid request parameters One or more request parameters are invalid or malformed Check parameter types and values against the API specification INVALID_SQLITE_HEADERNot a valid SQLite database The file exists but is not a valid SQLite database Ensure the file is a valid SQLite database with proper header PATH_IS_DIRECTORYPath is a directory Expected a .db file but got a directory (use table parameter for directory mode) Use a .db file path or add table parameter for directory mode KV store
" message " : " Operation 215 does not exist for this key " ,
Error Code Title Description Resolution KEY_NOT_FOUNDKey not found The requested key does not exist in the KV store Verify the key name and database/table parameters DATABASE_NOT_FOUNDDatabase file does not exist The specified database file was not found Check the file path or use create_db_if_missing=true to create it KEY_EXPIREDKey expired The key existed but has expired due to TTL The key was automatically deleted. Store a new value if needed.
" error " : " Internal Server Error " ,
" message " : " Failed to reconstruct snapshot " ,
Error Code Title Description Resolution DATABASE_ERRORDatabase operation failed An internal database error occurred Check server logs for details. Database may be corrupted or locked. FILE_SYSTEM_ERRORFile system error Failed to read or write filesystem in directory mode Check file permissions and disk space
Reconstruct the entire KV table state at a given Unix timestamp. Useful for restoring environments to a known-good point.
Name In Type Required Description dbquery string Yes Database file path tablequery string No Custom table name. Default: "kv_store". timestampquery integer Yes Unix timestamp to reconstruct from limitquery integer No Maximum number of keys to return. Default: 100. prefixquery string No Filter keys by prefix
curl " https://a1b2c3d4-7890abcdef12-sqlite-1.eu-west-1.containers.hoody.icu/api/v1/sqlite/kv/snapshot?db=app.db×tamp=1719436000&limit=100&prefix=session: "
await client . sqlite . kvStore . getTableSnapshot ({
" value " : " { \" user \" : \" alice \" } " ,
" value " : " { \" user \" : \" bob \" } " ,
" candidate_truncated " : false
" message " : " timestamp must be a Unix epoch integer " ,
" code " : " INVALID_PARAMETERS "
Error Code Title Description Resolution INVALID_DB_PATHInvalid database path The provided database path is invalid or inaccessible Provide a valid absolute path, or use bare name / ./name shorthand (resolved to /hoody/databases/*.db) INVALID_PARAMETERSInvalid request parameters One or more request parameters are invalid or malformed Check parameter types and values against the API specification INVALID_SQLITE_HEADERNot a valid SQLite database The file exists but is not a valid SQLite database Ensure the file is a valid SQLite database with proper header PATH_IS_DIRECTORYPath is a directory Expected a .db file but got a directory (use table parameter for directory mode) Use a .db file path or add table parameter for directory mode KV store
" error " : " Internal Server Error " ,
" message " : " Failed to reconstruct table snapshot " ,
Error Code Title Description Resolution DATABASE_ERRORDatabase operation failed An internal database error occurred Check server logs for details. Database may be corrupted or locked. FILE_SYSTEM_ERRORFile system error Failed to read or write filesystem in directory mode Check file permissions and disk space
" error " : " Service Unavailable " ,
" message " : " Request deadline exceeded before commit "
Note
The response includes has_gaps and gap_keys for any keys skipped due to history=false gaps, and candidate_truncated=true when the candidate set exceeded the internal scan cap. When candidate_truncated is true, narrow the request with prefix to obtain a complete view.
Compare the KV table between two Unix timestamps and report which keys were created, modified, or deleted.
Name In Type Required Description dbquery string Yes Database file path tablequery string No Custom table name. Default: "kv_store". fromquery integer Yes Starting timestamp (Unix) toquery integer Yes Ending timestamp (Unix) keysquery string No Comma-separated list of keys to compare (optional)
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 "
await client . sqlite . kvStore . compareSnapshots ({
keys : " session:42,session:43 "
" from_timestamp " : 1719435900 ,
" to_timestamp " : 1719436212 ,
" value " : " { \" user \" : \" bob \" } " ,
" from_value " : " { \" user \" : \" alice \" } " ,
" to_value " : " { \" user \" : \" alice \" , \" token \" : \" abc123 \" } "
" candidate_truncated " : false
" message " : " from must be <= to " ,
" code " : " INVALID_PARAMETERS "
Error Code Title Description Resolution INVALID_DB_PATHInvalid database path The provided database path is invalid or inaccessible Provide a valid absolute path, or use bare name / ./name shorthand (resolved to /hoody/databases/*.db) INVALID_PARAMETERSInvalid request parameters One or more request parameters are invalid or malformed Check parameter types and values against the API specification INVALID_SQLITE_HEADERNot a valid SQLite database The file exists but is not a valid SQLite database Ensure the file is a valid SQLite database with proper header PATH_IS_DIRECTORYPath is a directory Expected a .db file but got a directory (use table parameter for directory mode) Use a .db file path or add table parameter for directory mode KV store
" error " : " Internal Server Error " ,
" message " : " Failed to compute diff " ,
Error Code Title Description Resolution DATABASE_ERRORDatabase operation failed An internal database error occurred Check server logs for details. Database may be corrupted or locked. FILE_SYSTEM_ERRORFile system error Failed to read or write filesystem in directory mode Check file permissions and disk space
" error " : " Service Unavailable " ,
" message " : " Request deadline exceeded before commit (large candidate set or heavy maintenance contention) "
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.
Name In Type Required Description keypath string Yes Key name dbquery string Yes Database file path tablequery string No Custom table name. Default: "kv_store". stepsquery integer No Number of operations to rollback. Default: 1.
This endpoint accepts no request body.
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 "
await client . sqlite . kvStore . rollback ( " session:42 " , { db : " app.db " , steps : 1 });
" current_value " : " { \" user \" : \" alice \" } " ,
" previous_value " : " { \" user \" : \" alice \" , \" token \" : \" abc123 \" } "
" message " : " steps must be >= 1 " ,
" code " : " INVALID_PARAMETERS "
Error Code Title Description Resolution INVALID_DB_PATHInvalid database path The provided database path is invalid or inaccessible Provide a valid absolute path, or use bare name / ./name shorthand (resolved to /hoody/databases/*.db) INVALID_PARAMETERSInvalid request parameters One or more request parameters are invalid or malformed Check parameter types and values against the API specification INVALID_SQLITE_HEADERNot a valid SQLite database The file exists but is not a valid SQLite database Ensure the file is a valid SQLite database with proper header PATH_IS_DIRECTORYPath is a directory Expected a .db file but got a directory (use table parameter for directory mode) Use a .db file path or add table parameter for directory mode KV store
" message " : " No history found for key " ,
Error Code Title Description Resolution KEY_NOT_FOUNDKey not found The requested key does not exist in the KV store Verify the key name and database/table parameters DATABASE_NOT_FOUNDDatabase file does not exist The specified database file was not found Check the file path or use create_db_if_missing=true to create it KEY_EXPIREDKey expired The key existed but has expired due to TTL The key was automatically deleted. Store a new value if needed.
" error " : " Internal Server Error " ,
" message " : " Failed to rollback key " ,
Error Code Title Description Resolution DATABASE_ERRORDatabase operation failed An internal database error occurred Check server logs for details. Database may be corrupted or locked. FILE_SYSTEM_ERRORFile system error Failed to read or write filesystem in directory mode Check file permissions and disk space
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.
Name In Type Required Description dbquery string Yes Database file path tablequery string No Custom table name. Default: "kv_store". to_timestampquery integer Yes Target timestamp to rollback to (Unix) dry_runquery boolean No Preview changes without applying. Default: false. confirmquery string No Must 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.
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 " \
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&confirm=yes " \
-H " Content-Type: application/json " \
await client . sqlite . kvStore . rollbackTable ({}, {
to_timestamp : 1719436000 ,
" to_timestamp " : 1719436000 ,
" created_keys_dropped " : 3 ,
" modified_keys_restored " : 9 ,
" deleted_keys_recreated " : 2 ,
" rollback_op_number " : 320
" message " : " confirm=yes is required to execute the rollback " ,
" code " : " INVALID_PARAMETERS "
Error Code Title Description Resolution INVALID_DB_PATHInvalid database path The provided database path is invalid or inaccessible Provide a valid absolute path, or use bare name / ./name shorthand (resolved to /hoody/databases/*.db) INVALID_PARAMETERSInvalid request parameters One or more request parameters are invalid or malformed, or confirm is missing for an execute call Check parameter types and values against the API specification; include confirm=yes to execute INVALID_SQLITE_HEADERNot a valid SQLite database The file exists but is not a valid SQLite database Ensure the file is a valid SQLite database with proper header PATH_IS_DIRECTORYPath is a directory Expected a .db file but got a directory (use table parameter for directory mode) Use a .db file path or add table parameter for directory mode KV store
" message " : " Time-travel chain gap (cannot rollback deterministically) "
" error " : " Internal Server Error " ,
" message " : " Failed to rollback table " ,
Error Code Title Description Resolution DATABASE_ERRORDatabase operation failed An internal database error occurred Check server logs for details. Database may be corrupted or locked. FILE_SYSTEM_ERRORFile system error Failed to read or write filesystem in directory mode Check file permissions and disk space