The Hoody KV Store records every query and every key mutation, making it possible to audit history, reconstruct past states, and roll back changes. Use these endpoints to list query executions, inspect per-key operation logs, snapshot the store at any timestamp, diff two snapshots, and safely undo changes.
Note
All query and history parameters use Unix timestamps. Responses may include has_gaps, gap_keys, and candidate_truncated flags when the candidate set was too large or individual keys were excluded from history recording — narrow the request with prefix or keys to get a complete view.
Retrieve query execution history for a database with optional limit.
GET /api/v1/sqlite/history
Name In Type Required Description dbquery string Yes Database file path limitquery integer No Maximum number of entries to return (default: 100)
curl -X GET " https://proj-a1b2c3-cont-x9y8z7-sqlite-1.eu-west-1.containers.hoody.com/api/v1/sqlite/history?db=app.db&limit=50 " \
-H " Authorization: Bearer $HOODY_TOKEN "
import { HoodyClient } from ' hoody-sdk ' ;
const client = new HoodyClient ({ baseURL : ' https://proj-a1b2c3-cont-x9y8z7-sqlite-1.eu-west-1.containers.hoody.com ' , token : process . env . HOODY_TOKEN });
await client . sqlite . history . list ({ db : ' app.db ' , limit : 50 });
" query " : " SELECT id, name FROM users WHERE active = 1 " ,
" query " : " UPDATE users SET active = 0 WHERE last_login < 1700000000 " ,
" error " : " INVALID_DB_PATH " ,
" message " : " Invalid database path: /hoody/databases/missing.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
Retrieve aggregated statistics about query execution history.
GET /api/v1/sqlite/history/stats
Name In Type Required Description dbquery string Yes Database file path
curl -X GET " https://proj-a1b2c3-cont-x9y8z7-sqlite-1.eu-west-1.containers.hoody.com/api/v1/sqlite/history/stats?db=app.db " \
-H " Authorization: Bearer $HOODY_TOKEN "
import { HoodyClient } from ' hoody-sdk ' ;
const client = new HoodyClient ({ baseURL : ' https://proj-a1b2c3-cont-x9y8z7-sqlite-1.eu-west-1.containers.hoody.com ' , token : process . env . HOODY_TOKEN });
await client . sqlite . history . getStats ({ db : ' app.db ' });
" first_entry_timestamp " : 1698000000 ,
" last_entry_timestamp " : 1700000000 ,
" total_duration_ms " : 18432 ,
" error " : " INVALID_DB_PATH " ,
" message " : " Invalid database path: /hoody/databases/missing.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 " : " DATABASE_ERROR " ,
" message " : " Failed to read history metadata "
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.
DELETE /api/v1/sqlite/history
Name In Type Required Description dbquery string Yes Database file path
curl -X DELETE " https://proj-a1b2c3-cont-x9y8z7-sqlite-1.eu-west-1.containers.hoody.com/api/v1/sqlite/history?db=app.db " \
-H " Authorization: Bearer $HOODY_TOKEN "
import { HoodyClient } from ' hoody-sdk ' ;
const client = new HoodyClient ({ baseURL : ' https://proj-a1b2c3-cont-x9y8z7-sqlite-1.eu-west-1.containers.hoody.com ' , token : process . env . HOODY_TOKEN });
await client . sqlite . history . clear ({ db : ' app.db ' });
" error " : " INVALID_DB_PATH " ,
" message " : " Invalid database path: /hoody/databases/missing.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 " : " DATABASE_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 specific query history entry by ID.
DELETE /api/v1/sqlite/history/{index}
Name In Type Required Description indexpath integer Yes History entry ID dbquery string Yes Database file path
curl -X DELETE " https://proj-a1b2c3-cont-x9y8z7-sqlite-1.eu-west-1.containers.hoody.com/api/v1/sqlite/history/42?db=app.db " \
-H " Authorization: Bearer $HOODY_TOKEN "
import { HoodyClient } from ' hoody-sdk ' ;
const client = new HoodyClient ({ baseURL : ' https://proj-a1b2c3-cont-x9y8z7-sqlite-1.eu-west-1.containers.hoody.com ' , token : process . env . HOODY_TOKEN });
await client . sqlite . history . deleteEntry ( 42 , { db : ' app.db ' });
" error " : " INVALID_DB_PATH " ,
" message " : " Invalid database path: /hoody/databases/missing.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 " : " KEY_NOT_FOUND " ,
" message " : " History entry 42 not found in app.db "
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 " : " DATABASE_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
Retrieve the operation history for a specific key showing all changes over time.
GET /api/v1/sqlite/kv/{key}/history
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 -X GET " https://proj-a1b2c3-cont-x9y8z7-sqlite-1.eu-west-1.containers.hoody.com/api/v1/sqlite/kv/user:1001/history?db=app.db&limit=50 " \
-H " Authorization: Bearer $HOODY_TOKEN "
import { HoodyClient } from ' hoody-sdk ' ;
const client = new HoodyClient ({ baseURL : ' https://proj-a1b2c3-cont-x9y8z7-sqlite-1.eu-west-1.containers.hoody.com ' , token : process . env . HOODY_TOKEN });
await client . sqlite . kvStore . getHistory ( ' user:1001 ' , { db : ' app.db ' , limit : 50 });
" value " : " { \" name \" : \" Ada \" , \" email \" : \" [email protected] \" } "
" value " : " { \" name \" : \" Ada \" } "
" error " : " 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 " : " DATABASE_ERROR " ,
" message " : " Failed to load key 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 was at a specific operation number.
GET /api/v1/sqlite/kv/{key}/snapshot
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 -X GET " https://proj-a1b2c3-cont-x9y8z7-sqlite-1.eu-west-1.containers.hoody.com/api/v1/sqlite/kv/user:1001/snapshot?db=app.db&op_number=87 " \
-H " Authorization: Bearer $HOODY_TOKEN "
import { HoodyClient } from ' hoody-sdk ' ;
const client = new HoodyClient ({ baseURL : ' https://proj-a1b2c3-cont-x9y8z7-sqlite-1.eu-west-1.containers.hoody.com ' , token : process . env . HOODY_TOKEN });
await client . sqlite . kvStore . getSnapshot ( ' user:1001 ' , { db : ' app.db ' , op_number : 87 });
" value " : " { \" name \" : \" Ada \" } " ,
" error " : " 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
" error " : " KEY_NOT_FOUND " ,
" message " : " Key 'user:1001' 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 " : " DATABASE_ERROR " ,
" message " : " Failed to reconstruct key 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 as it was at a specific timestamp.
GET /api/v1/sqlite/kv/snapshot
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 -X GET " https://proj-a1b2c3-cont-x9y8z7-sqlite-1.eu-west-1.containers.hoody.com/api/v1/sqlite/kv/snapshot?db=app.db×tamp=1700000000&limit=100&prefix=user: " \
-H " Authorization: Bearer $HOODY_TOKEN "
import { HoodyClient } from ' hoody-sdk ' ;
const client = new HoodyClient ({ baseURL : ' https://proj-a1b2c3-cont-x9y8z7-sqlite-1.eu-west-1.containers.hoody.com ' , token : process . env . HOODY_TOKEN });
await client . sqlite . kvStore . getTableSnapshot ({ db : ' app.db ' , timestamp : 1700000000 , limit : 100 , prefix : ' user: ' });
" candidate_truncated " : false ,
" value " : " { \" name \" : \" Ada \" , \" email \" : \" [email protected] \" } " ,
" value " : " { \" name \" : \" Linus \" , \" email \" : \" [email protected] \" } " ,
" error " : " INVALID_PARAMETERS " ,
" message " : " timestamp must be a Unix timestamp in seconds "
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 " : " DATABASE_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 " : " DEADLINE_EXCEEDED " ,
" message " : " Request deadline exceeded before commit "
Compare the KV table state between two timestamps showing created, modified, and deleted keys.
GET /api/v1/sqlite/kv/diff
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 -X GET " https://proj-a1b2c3-cont-x9y8z7-sqlite-1.eu-west-1.containers.hoody.com/api/v1/sqlite/kv/diff?db=app.db&from=1700000000&to=1700100000&keys=user:1001,user:1002 " \
-H " Authorization: Bearer $HOODY_TOKEN "
import { HoodyClient } from ' hoody-sdk ' ;
const client = new HoodyClient ({ baseURL : ' https://proj-a1b2c3-cont-x9y8z7-sqlite-1.eu-west-1.containers.hoody.com ' , token : process . env . HOODY_TOKEN });
await client . sqlite . kvStore . compareSnapshots ({ db : ' app.db ' , from : 1700000000 , to : 1700100000 , keys : ' user:1001,user:1002 ' });
" candidate_truncated " : false ,
" value " : " { \" user \" : \" user:1002 \" } "
" from_value " : " { \" name \" : \" Ada \" } " ,
" to_value " : " { \" name \" : \" Ada \" , \" email \" : \" [email protected] \" } "
" value " : " { \" name \" : \" Legacy \" } "
" error " : " 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 " : " DATABASE_ERROR " ,
" message " : " Failed to compute snapshot 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 " : " DEADLINE_EXCEEDED " ,
" message " : " Request deadline exceeded before commit "
Rollback a key to its previous state by undoing the last N operations.
POST /api/v1/sqlite/kv/{key}/rollback
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://proj-a1b2c3-cont-x9y8z7-sqlite-1.eu-west-1.containers.hoody.com/api/v1/sqlite/kv/user:1001/rollback?db=app.db&steps=2 " \
-H " Authorization: Bearer $HOODY_TOKEN "
import { HoodyClient } from ' hoody-sdk ' ;
const client = new HoodyClient ({ baseURL : ' https://proj-a1b2c3-cont-x9y8z7-sqlite-1.eu-west-1.containers.hoody.com ' , token : process . env . HOODY_TOKEN });
await client . sqlite . kvStore . rollback ( ' user:1001 ' , { db : ' app.db ' , steps : 2 });
" current_value " : " { \" name \" : \" Ada \" } " ,
" error " : " 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
" error " : " KEY_NOT_FOUND " ,
" message " : " No history found for key 'user:1001' "
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 " : " DATABASE_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
Rollback the entire KV table to a specific timestamp. Pass dry_run=true to preview changes, or confirm=yes to execute.
POST /api/v1/sqlite/kv/rollback
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 to scope the rollback to a subset of keys.
Name Type Required Description keysarray of string No Keys to roll back. Omit or leave empty to roll back the whole table. At most 10000 entries; more is rejected with 413. exclude_keysarray of string No Keys to leave untouched. Applied after keys. At most 10000 entries; more is rejected with 413.
curl -X POST " https://proj-a1b2c3-cont-x9y8z7-sqlite-1.eu-west-1.containers.hoody.com/api/v1/sqlite/kv/rollback?db=app.db&to_timestamp=1700000000&dry_run=false&confirm=yes " \
-H " Authorization: Bearer $HOODY_TOKEN " \
-H " Content-Type: application/json " \
"keys": ["user:1001", "user:1002"],
"exclude_keys": ["user:1002"]
import { HoodyClient } from ' hoody-sdk ' ;
const client = new HoodyClient ({ baseURL : ' https://proj-a1b2c3-cont-x9y8z7-sqlite-1.eu-west-1.containers.hoody.com ' , token : process . env . HOODY_TOKEN });
await client . sqlite . kvStore . rollbackTable (
keys : [ ' user:1001 ' , ' user:1002 ' ],
exclude_keys : [ ' user:1002 ' ],
{ db : ' app.db ' , to_timestamp : 1700000000 , dry_run : false , confirm : ' yes ' }
" to_timestamp " : 1700000000 ,
" from_value " : " { \" name \" : \" Ada \" , \" email \" : \" [email protected] \" } " ,
" to_value " : " { \" name \" : \" Ada \" } "
" error " : " INVALID_PARAMETERS " ,
" message " : " confirm must be 'yes' to execute 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
" error " : " TIME_TRAVEL_GAP " ,
" message " : " Time-travel chain gap: cannot rollback deterministically "
" error " : " KEY_LIST_TOO_LARGE " ,
" message " : " keys array exceeds the 10000-entry cap "
" error " : " DATABASE_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