The KV Store keeps a complete operation log for every key and table, enabling point-in-time reconstruction, change inspection, and rollback. Use these endpoints to audit query and key history, take snapshots at specific operation numbers or Unix timestamps, diff states across windows, and restore previous values. All endpoints require a database path via the db query parameter; custom tables are selected with table (default kv_store).
Retrieve query execution history for a database with an optional entry limit.
Name In Type Required Description dbquery string Yes Database file path limitquery integer No Maximum number of entries to return. Default: 100
" query " : " SELECT id, name FROM users WHERE active = 1 " ,
" query " : " UPDATE users SET last_seen = 1700000000 " ,
" code " : " INVALID_DB_PATH " ,
" message " : " Database path 'app.db' could not be resolved "
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
import { HoodyClient } from ' hoody-sdk ' ;
const client = new HoodyClient ({ baseURL : ' https://{projectId}-{containerId}-sqlite-1.{server}.containers.hoody.com ' , token : process . env . HOODY_TOKEN });
await client . sqlite . history . list ({ db : ' app.db ' , limit : 100 });
curl -X GET ' https://{projectId}-{containerId}-sqlite-1.{server}.containers.hoody.com/api/v1/sqlite/history?db=app.db&limit=100 ' \
-H ' Authorization: Bearer <token> '
Retrieve aggregated statistics about query execution history for a database.
Name In Type Required Description dbquery string Yes Database file path
" total_duration_ms " : 84320 ,
" first_query_at " : 1699000000 ,
" last_query_at " : 1700000500
" code " : " INVALID_PARAMETERS " ,
" message " : " Missing required parameter: db "
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 " ,
" code " : " DATABASE_ERROR " ,
" message " : " An internal database 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
import { HoodyClient } from ' hoody-sdk ' ;
const client = new HoodyClient ({ baseURL : ' https://{projectId}-{containerId}-sqlite-1.{server}.containers.hoody.com ' , token : process . env . HOODY_TOKEN });
await client . sqlite . history . getStats ({ db : ' app.db ' });
curl -X GET ' https://{projectId}-{containerId}-sqlite-1.{server}.containers.hoody.com/api/v1/sqlite/history/stats?db=app.db ' \
-H ' Authorization: Bearer <token> '
Delete all query history entries for a database.
Name In Type Required Description dbquery string Yes Database file path
" code " : " INVALID_DB_PATH " ,
" message " : " Database path 'app.db' could not be resolved "
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 " ,
" code " : " DATABASE_ERROR " ,
" message " : " An internal database 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
import { HoodyClient } from ' hoody-sdk ' ;
const client = new HoodyClient ({ baseURL : ' https://{projectId}-{containerId}-sqlite-1.{server}.containers.hoody.com ' , token : process . env . HOODY_TOKEN });
await client . sqlite . history . clear ({ db : ' app.db ' });
curl -X DELETE ' https://{projectId}-{containerId}-sqlite-1.{server}.containers.hoody.com/api/v1/sqlite/history?db=app.db ' \
-H ' Authorization: Bearer <token> '
Delete a specific query history entry by its numeric ID.
Name In Type Required Description indexpath integer Yes History entry ID dbquery string Yes Database file path
" code " : " INVALID_PARAMETERS " ,
" message " : " index must be a positive 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
" 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 " ,
" code " : " DATABASE_ERROR " ,
" message " : " An internal database 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
import { HoodyClient } from ' hoody-sdk ' ;
const client = new HoodyClient ({ baseURL : ' https://{projectId}-{containerId}-sqlite-1.{server}.containers.hoody.com ' , token : process . env . HOODY_TOKEN });
await client . sqlite . history . deleteEntry ( 42 , { db : ' app.db ' });
curl -X DELETE ' https://{projectId}-{containerId}-sqlite-1.{server}.containers.hoody.com/api/v1/sqlite/history/42?db=app.db ' \
-H ' Authorization: Bearer <token> '
Retrieve the operation history for a specific key, showing every change 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
" value " : " { \" name \" : \" alice \" } " ,
" value " : " { \" name \" : \" bob \" } " ,
" code " : " INVALID_PARAMETERS " ,
" message " : " limit must be a non-negative 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 " ,
" code " : " DATABASE_ERROR " ,
" message " : " An internal database 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
import { HoodyClient } from ' hoody-sdk ' ;
const client = new HoodyClient ({ baseURL : ' https://{projectId}-{containerId}-sqlite-1.{server}.containers.hoody.com ' , token : process . env . HOODY_TOKEN });
await client . sqlite . kvStore . getHistory ( ' user:42 ' , { db : ' app.db ' , limit : 50 });
curl -X GET ' https://{projectId}-{containerId}-sqlite-1.{server}.containers.hoody.com/api/v1/sqlite/kv/user:42/history?db=app.db&limit=50 ' \
-H ' Authorization: Bearer <token> '
Reconstruct the value of a key as it existed 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
" value " : " { \" name \" : \" alice \" } " ,
" reconstructed_at " : 1700000500
" code " : " INVALID_PARAMETERS " ,
" message " : " op_number must be a positive 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
" message " : " Key 'user:42' has no operation 4 "
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 " ,
" code " : " DATABASE_ERROR " ,
" message " : " An internal database 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
import { HoodyClient } from ' hoody-sdk ' ;
const client = new HoodyClient ({ baseURL : ' https://{projectId}-{containerId}-sqlite-1.{server}.containers.hoody.com ' , token : process . env . HOODY_TOKEN });
await client . sqlite . kvStore . getSnapshot ( ' user:42 ' , { db : ' app.db ' , op_number : 4 });
curl -X GET ' https://{projectId}-{containerId}-sqlite-1.{server}.containers.hoody.com/api/v1/sqlite/kv/user:42/snapshot?db=app.db&op_number=4 ' \
-H ' Authorization: Bearer <token> '
Reconstruct the entire KV table state as it was at a specific Unix 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
" session:abc " : " { \" token \" : \" xyz \" } "
" candidate_truncated " : false
" code " : " INVALID_PARAMETERS " ,
" message " : " timestamp must be a positive Unix timestamp "
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 " ,
" code " : " DATABASE_ERROR " ,
" message " : " An internal database 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 "
import { HoodyClient } from ' hoody-sdk ' ;
const client = new HoodyClient ({ baseURL : ' https://{projectId}-{containerId}-sqlite-1.{server}.containers.hoody.com ' , token : process . env . HOODY_TOKEN });
await client . sqlite . kvStore . getTableSnapshot ({ db : ' app.db ' , timestamp : 1700000000 , limit : 100 , prefix : ' user: ' });
curl -X GET ' https://{projectId}-{containerId}-sqlite-1.{server}.containers.hoody.com/api/v1/sqlite/kv/snapshot?db=app.db×tamp=1700000000&limit=100&prefix=user: ' \
-H ' Authorization: Bearer <token> '
Compare the KV table state between two Unix timestamps, surfacing 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)
" deleted " : [ " session:old " ],
" candidate_truncated " : false
" code " : " INVALID_PARAMETERS " ,
" message " : " from must be <= to "
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 " ,
" code " : " DATABASE_ERROR " ,
" message " : " An internal database 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) "
import { HoodyClient } from ' hoody-sdk ' ;
const client = new HoodyClient ({ baseURL : ' https://{projectId}-{containerId}-sqlite-1.{server}.containers.hoody.com ' , token : process . env . HOODY_TOKEN });
await client . sqlite . kvStore . compareSnapshots ({ db : ' app.db ' , from : 1699999000 , to : 1700000000 , keys : ' user:42,user:43 ' });
curl -X GET ' https://{projectId}-{containerId}-sqlite-1.{server}.containers.hoody.com/api/v1/sqlite/kv/diff?db=app.db&from=1699999000&to=1700000000&keys=user:42,user:43 ' \
-H ' Authorization: Bearer <token> '
Roll a key back to a 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
" current_value " : " alice " ,
" code " : " INVALID_PARAMETERS " ,
" message " : " steps must be a positive 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
" message " : " Key 'user:42' has no history to rollback "
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 " ,
" code " : " DATABASE_ERROR " ,
" message " : " An internal database 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
import { HoodyClient } from ' hoody-sdk ' ;
const client = new HoodyClient ({ baseURL : ' https://{projectId}-{containerId}-sqlite-1.{server}.containers.hoody.com ' , token : process . env . HOODY_TOKEN });
await client . sqlite . kvStore . rollback ( ' user:42 ' , { db : ' app.db ' , steps : 1 });
curl -X POST ' https://{projectId}-{containerId}-sqlite-1.{server}.containers.hoody.com/api/v1/sqlite/kv/user:42/rollback?db=app.db&steps=1 ' \
-H ' Authorization: Bearer <token> '
Roll the entire KV table back to a specific Unix timestamp. The endpoint requires confirm=yes and an explicit to_timestamp to execute; use dry_run=true to preview the affected keys without applying 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
Optional filters that limit the rollback to a subset of keys. The body schema is empty; no body fields are required.
" to_timestamp " : 1700000000 ,
" affected_keys " : [ " user:42 " , " user:43 " ]
" code " : " INVALID_PARAMETERS " ,
" message " : " confirm=yes is required to execute the rollback "
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 " : " Payload Too Large " ,
" message " : " keys or exclude_keys array exceeds the 10000-entry cap "
" error " : " Internal Server Error " ,
" code " : " DATABASE_ERROR " ,
" message " : " An internal database 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
import { HoodyClient } from ' hoody-sdk ' ;
const client = new HoodyClient ({ baseURL : ' https://{projectId}-{containerId}-sqlite-1.{server}.containers.hoody.com ' , token : process . env . HOODY_TOKEN });
await client . sqlite . kvStore . rollbackTable (
{ db : ' app.db ' , to_timestamp : 1700000000 , dry_run : false , confirm : ' yes ' }
curl -X POST ' https://{projectId}-{containerId}-sqlite-1.{server}.containers.hoody.com/api/v1/sqlite/kv/rollback?db=app.db&to_timestamp=1700000000&confirm=yes ' \
-H ' Authorization: Bearer <token> ' \
-H ' Content-Type: application/json ' \