The KV store maintains a full operation log so you can inspect how your data changed, reconstruct the state at any past point, and roll back unwanted mutations. Use these endpoints to audit, debug, and recover from accidental writes. Two surfaces are exposed: general query history for any SQLite database, and KV store time-travel for inspecting and rewinding specific keys or entire tables.
Inspect, summarize, and manage the SQL query history recorded for each database file.
Retrieve query execution history for a database with optional limit.
Name In Type Required Description dbquery string Yes Database file path limitquery integer No Maximum number of entries to return (default 100)
curl -G " https://api.hoody.com/api/v1/sqlite/history " \
-H " Authorization: Bearer <token> " \
--data-urlencode " db=app.db " \
--data-urlencode " limit=50 "
const { data , error } = await client . sqlite . history . list ( {
"sql" : " SELECT id, name FROM users WHERE active = 1 " ,
"sql" : " UPDATE users SET last_seen = 1700000000 " ,
"message" : " Invalid database 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 about query execution history.
Name In Type Required Description dbquery string Yes Database file path
curl -G " https://api.hoody.com/api/v1/sqlite/history/stats " \
-H " Authorization: Bearer <token> " \
--data-urlencode " db=app.db "
const { data , error } = await client . sqlite . history . getStats ( {
"oldest_timestamp" : 1690000000 ,
"newest_timestamp" : 1700000000 ,
"message" : " Invalid database 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" : " An internal error occurred "
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 all query history entries for a database.
Name In Type Required Description dbquery string Yes Database file path
curl -X DELETE " https://api.hoody.com/api/v1/sqlite/history?db=app.db " \
-H " Authorization: Bearer <token> "
const { data , error } = await client . sqlite . history . clear ( {
"message" : " Invalid database 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" : " An internal error occurred "
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 specific query history entry by ID.
Name In Type Required Description indexpath integer Yes History entry ID dbquery string Yes Database file path
curl -X DELETE " https://api.hoody.com/api/v1/sqlite/history/42?db=app.db " \
-H " Authorization: Bearer <token> "
const { data , error } = await client . sqlite . history . deleteEntry ( {
"message" : " Invalid index "
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" : " An internal error occurred "
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 past key/table states, compare snapshots across time windows, and rewind changes for individual keys or entire tables.
Retrieve the operation history for a specific key showing all changes over time.
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 → default 50, clamped to maximum 1000) (default 50)
curl -G " https://api.hoody.com/api/v1/sqlite/kv/user:1234/history " \
-H " Authorization: Bearer <token> " \
--data-urlencode " db=app.db " \
--data-urlencode " limit=50 "
const { data , error } = await client . sqlite . kvStore . getHistory ( {
"value" : " { \" name \" : \" Ada \" , \" score \" :0} " ,
"value" : " { \" name \" : \" Ada \" , \" score \" :42} " ,
"message" : " Invalid request parameters (e.g. negative limit, malformed integer) "
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" : " An internal error occurred "
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 was at a specific operation number.
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 -G " https://api.hoody.com/api/v1/sqlite/kv/user:1234/snapshot " \
-H " Authorization: Bearer <token> " \
--data-urlencode " db=app.db " \
--data-urlencode " op_number=1 "
const { data , error } = await client . sqlite . kvStore . getSnapshot ( {
"value" : " { \" name \" : \" Ada \" , \" score \" :0} " ,
"message" : " Invalid request 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" : " Key or operation 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" : " An internal error occurred "
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 as it was at a specific timestamp.
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 -G " https://api.hoody.com/api/v1/sqlite/kv/snapshot " \
-H " Authorization: Bearer <token> " \
--data-urlencode " db=app.db " \
--data-urlencode " timestamp=1700000000 " \
--data-urlencode " limit=100 " \
--data-urlencode " prefix=user: "
const { data , error } = await client . sqlite . kvStore . getTableSnapshot ( {
"value" : " { \" name \" : \" Ada \" , \" score \" :42} " ,
"value" : " { \" name \" : \" Linus \" , \" score \" :7} " ,
"candidate_truncated" : false
"message" : " Invalid request 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" : " An internal error occurred "
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 "
Compare the KV table state between two timestamps showing created, modified, and deleted keys.
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 -G " https://api.hoody.com/api/v1/sqlite/kv/diff " \
-H " Authorization: Bearer <token> " \
--data-urlencode " db=app.db " \
--data-urlencode " from=1700000000 " \
--data-urlencode " to=1700010000 " \
--data-urlencode " keys=user:1234,user:5678 "
const { data , error } = await client . sqlite . kvStore . compareSnapshots ( {
keys: " user:1234,user:5678 " ,
"value" : " { \" name \" : \" Linus \" , \" score \" :7} "
"from" : " { \" name \" : \" Ada \" , \" score \" :0} " ,
"to" : " { \" name \" : \" Ada \" , \" score \" :42} "
"candidate_truncated" : false
"message" : " Invalid request 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" : " An internal error occurred "
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) "
Rollback a key to its previous state by undoing the last N operations.
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)
curl -X POST " https://api.hoody.com/api/v1/sqlite/kv/user:1234/rollback?db=app.db&steps=1 " \
-H " Authorization: Bearer <token> "
const { data , error } = await client . sqlite . kvStore . rollback ( {
"value" : " { \" name \" : \" Ada \" , \" score \" :0} " ,
"message" : " Invalid request 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 "
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" : " An internal error occurred "
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
Rollback the entire KV table to a specific timestamp.
Danger
This is a destructive bulk operation. Always run with dry_run=true first to preview the changes, and pass confirm=yes to actually execute. A 409 indicates a gap in the time-travel chain, which means the rollback cannot be performed deterministically — do not retry without first inspecting history.
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
The request body schema for this endpoint is empty — no body fields are defined.
curl -X POST " https://api.hoody.com/api/v1/sqlite/kv/rollback?db=app.db&to_timestamp=1700000000&dry_run=true " \
-H " Authorization: Bearer <token> "
curl -X POST " https://api.hoody.com/api/v1/sqlite/kv/rollback?db=app.db&to_timestamp=1700000000&confirm=yes " \
-H " Authorization: Bearer <token> "
const preview = await client . sqlite . kvStore . rollbackTable ( {
to_timestamp: 1700000000 ,
const { data , error } = await client . sqlite . kvStore . rollbackTable ( {
to_timestamp: 1700000000 ,
"to_timestamp" : 1700000000 ,
"message" : " Invalid request parameters or missing confirmation "
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" : " Time-travel chain gap (cannot rollback deterministically) "
"error" : " Internal Server Error " ,
"message" : " An internal error occurred "
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