Skip to content
Hoody.com

The KV (key-value) store provides a simple, high-level interface over SQLite for storing and retrieving values by key. Use these endpoints for caching, counters, configuration, and lightweight session state. All operations support optional time-to-live (TTL), JSON path access, and history tracking.

All endpoints share the same container-scoped base URL and respond with the stored value or a structured error object.

GET /api/v1/sqlite/kv/{key}

Retrieve a value from the KV store. The response body contains the raw stored value. JSON-path extraction and time-travel queries are supported via query parameters.

NameInTypeRequiredDescription
keypathstringYesKey name (supports / for hierarchical keys)
dbquerystringYesDatabase file path or directory
tablequerystringNoCustom table name (default: kv_store)
pathquerystringNoJSON path for nested value extraction
at_timestampqueryintegerNoUnix timestamp for time-travel query (selects handleKVAtTimestamp)
rebuildquerybooleanNoRebuild cache (directory mode only)
Terminal window
curl -X GET "https://{projectId}-{containerId}-sqlite-1.{server}.containers.hoody.com/api/v1/sqlite/kv/user:42?db=app.db&path=profile.email"
{
"statusCode": 400,
"error": "Bad Request",
"message": "Invalid db parameter"
}
Error CodeTitleDescriptionResolution
INVALID_DB_PATHInvalid database pathThe provided database path is invalid or inaccessibleProvide a valid absolute path, or use bare name / ./name shorthand (resolved to /hoody/databases/*.db)
INVALID_PARAMETERSInvalid request parametersOne or more request parameters are invalid or malformedCheck parameter types and values against the API specification
INVALID_SQLITE_HEADERNot a valid SQLite databaseThe file exists but is not a valid SQLite databaseEnsure the file is a valid SQLite database with proper header
PATH_IS_DIRECTORYPath is a directoryExpected 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

PUT /api/v1/sqlite/kv/{key}

Store or update a value in the KV store. The body carries the value to store. Supports an optional path for partial JSON updates, an optional ttl for time-to-live, and an optional if_match value for compare-and-swap semantics.

NameInTypeRequiredDescription
keypathstringYesKey name
dbquerystringYesDatabase file path
tablequerystringNoCustom table name (default: kv_store)
pathquerystringNoJSON path for nested value update
ttlqueryintegerNoTime-to-live in seconds
if_matchquerystringNoCurrent value for compare-and-swap
historyquerybooleanNoEnable history tracking (default: true)
create_db_if_missingquerybooleanNoCreate database file if it is missing (default: false)

The request body carries the raw value to store. It accepts either application/octet-stream or application/json.

"{\"name\":\"Ada\",\"score\":42}"
Terminal window
curl -X PUT "https://{projectId}-{containerId}-sqlite-1.{server}.containers.hoody.com/api/v1/sqlite/kv/user:42?db=app.db&ttl=3600" \
-H "Content-Type: application/json" \
-d '{"name":"Ada","score":42}'
{
"statusCode": 400,
"error": "Bad Request",
"message": "Invalid db parameter"
}
Error CodeTitleDescriptionResolution
INVALID_DB_PATHInvalid database pathThe provided database path is invalid or inaccessibleProvide a valid absolute path, or use bare name / ./name shorthand (resolved to /hoody/databases/*.db)
INVALID_PARAMETERSInvalid request parametersOne or more request parameters are invalid or malformedCheck parameter types and values against the API specification
INVALID_SQLITE_HEADERNot a valid SQLite databaseThe file exists but is not a valid SQLite databaseEnsure the file is a valid SQLite database with proper header
PATH_IS_DIRECTORYPath is a directoryExpected 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

DELETE /api/v1/sqlite/kv/{key}

Remove a key-value pair from the store. Returns 200 on success even if the key did not exist, unless the underlying database or directory is missing.

NameInTypeRequiredDescription
keypathstringYesKey name
dbquerystringYesDatabase file path or directory
tablequerystringNoCustom table name (default: kv_store)
historyquerybooleanNoEnable history tracking (default: true)
Terminal window
curl -X DELETE "https://{projectId}-{containerId}-sqlite-1.{server}.containers.hoody.com/api/v1/sqlite/kv/user:42?db=app.db"
{
"statusCode": 400,
"error": "Bad Request",
"message": "Invalid db parameter"
}
Error CodeTitleDescriptionResolution
INVALID_DB_PATHInvalid database pathThe provided database path is invalid or inaccessibleProvide a valid absolute path, or use bare name / ./name shorthand (resolved to /hoody/databases/*.db)
INVALID_PARAMETERSInvalid request parametersOne or more request parameters are invalid or malformedCheck parameter types and values against the API specification
INVALID_SQLITE_HEADERNot a valid SQLite databaseThe file exists but is not a valid SQLite databaseEnsure the file is a valid SQLite database with proper header
PATH_IS_DIRECTORYPath is a directoryExpected 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

HEAD /api/v1/sqlite/kv/{key}

Check whether a key exists without retrieving its value. A 200 OK response indicates the key exists; a 404 indicates it does not (or has expired).

NameInTypeRequiredDescription
keypathstringYesKey name
dbquerystringYesDatabase file path or directory
tablequerystringNoCustom table name (default: kv_store)
Terminal window
curl -I "https://{projectId}-{containerId}-sqlite-1.{server}.containers.hoody.com/api/v1/sqlite/kv/user:42?db=app.db"
{
"statusCode": 400,
"error": "Bad Request",
"message": "Invalid db parameter"
}
Error CodeTitleDescriptionResolution
INVALID_DB_PATHInvalid database pathThe provided database path is invalid or inaccessibleProvide a valid absolute path, or use bare name / ./name shorthand (resolved to /hoody/databases/*.db)
INVALID_PARAMETERSInvalid request parametersOne or more request parameters are invalid or malformedCheck parameter types and values against the API specification
INVALID_SQLITE_HEADERNot a valid SQLite databaseThe file exists but is not a valid SQLite databaseEnsure the file is a valid SQLite database with proper header
PATH_IS_DIRECTORYPath is a directoryExpected 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

POST /api/v1/sqlite/kv/{key}/incr

Atomically increment a numeric value stored under the key. If the key does not exist, it is created with value delta. Use the optional path parameter to increment a nested numeric field inside a JSON document.

NameInTypeRequiredDescription
keypathstringYesKey name
dbquerystringYesDatabase file path
tablequerystringNoCustom table name (default: kv_store)
deltaqueryintegerNoAmount to increment (default: 1)
pathquerystringNoJSON path to nested numeric value
historyquerybooleanNoEnable history tracking (default: true)
Terminal window
curl -X POST "https://{projectId}-{containerId}-sqlite-1.{server}.containers.hoody.com/api/v1/sqlite/kv/counter:visits/incr?db=app.db&delta=1"
{
"statusCode": 400,
"error": "Bad Request",
"message": "Stored value is not numeric"
}
Error CodeTitleDescriptionResolution
INVALID_DB_PATHInvalid database pathThe provided database path is invalid or inaccessibleProvide a valid absolute path, or use bare name / ./name shorthand (resolved to /hoody/databases/*.db)
INVALID_PARAMETERSInvalid request parametersOne or more request parameters are invalid or malformedCheck parameter types and values against the API specification
INVALID_SQLITE_HEADERNot a valid SQLite databaseThe file exists but is not a valid SQLite databaseEnsure the file is a valid SQLite database with proper header
PATH_IS_DIRECTORYPath is a directoryExpected 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

POST /api/v1/sqlite/kv/{key}/decr

Atomically decrement a numeric value stored under the key. If the key does not exist, it is created with value -delta. Use the optional path parameter to decrement a nested numeric field inside a JSON document.

NameInTypeRequiredDescription
keypathstringYesKey name
dbquerystringYesDatabase file path
tablequerystringNoCustom table name (default: kv_store)
deltaqueryintegerNoAmount to decrement (default: 1)
pathquerystringNoJSON path to nested numeric value
historyquerybooleanNoEnable history tracking (default: true)
Terminal window
curl -X POST "https://{projectId}-{containerId}-sqlite-1.{server}.containers.hoody.com/api/v1/sqlite/kv/counter:visits/decr?db=app.db&delta=1"
{
"statusCode": 400,
"error": "Bad Request",
"message": "Stored value is not numeric"
}
Error CodeTitleDescriptionResolution
INVALID_DB_PATHInvalid database pathThe provided database path is invalid or inaccessibleProvide a valid absolute path, or use bare name / ./name shorthand (resolved to /hoody/databases/*.db)
INVALID_PARAMETERSInvalid request parametersOne or more request parameters are invalid or malformedCheck parameter types and values against the API specification
INVALID_SQLITE_HEADERNot a valid SQLite databaseThe file exists but is not a valid SQLite databaseEnsure the file is a valid SQLite database with proper header
PATH_IS_DIRECTORYPath is a directoryExpected 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