The execution API exposes two complementary state surfaces: a VM cache keyed by hostname that accelerates script execution, and a shared state store that scripts can read, write, merge, and clear across runs. Use these endpoints to invalidate cached VMs, reset persistent state between deployments, or coordinate values that multiple scripts on the same hostname must share.
Invalidate the VM cache for a hostname and optionally wipe its associated shared state. By default, the VM cache is cleared and shared state is preserved.
Field Type Required Default Description hostnamestring No — Hostname whose VM cache entry should be cleared. scriptPathstring No — Deprecated. scriptPath-based clear returns HTTP 400. VM cache is keyed by hostname. Use hostname or clearAll=true instead.clearVmboolean No trueClear the VM cache for the given hostname. clearStateboolean No falseAlso clear shared state for the given hostname. clearAllboolean No falseClear VM cache and shared state for every hostname.
curl -X POST https://api.hoody.com/v1/exec/cache/clear \
-H " Authorization: Bearer <token> " \
-H " Content-Type: application/json " \
"hostname": "api.example.com",
await client . exec . cache . clear ({
hostname: " api.example.com " ,
"error" : " Invalid input: scriptPath is no longer supported " ,
"code" : " VALIDATION_ERROR " ,
"timestamp" : " 2026-01-15T10:42:13.214Z " ,
Error Code Title Description Resolution VALIDATION_ERRORInvalid input Request parameters failed validation (e.g. supplying the deprecated scriptPath field) Check parameter format and requirements; use hostname or clearAll=true instead of scriptPath
"error" : " Failed to clear cache " ,
"timestamp" : " 2026-01-15T10:42:13.214Z " ,
"reason" : " storage backend unavailable "
Write a value into the shared state store for a given hostname and path. When merge is true, the value is shallow-merged into the existing state object instead of replacing it. The value field accepts an arbitrary JSON value (object, array, string, number, boolean, or null).
Field Type Required Default Description hostnamestring Yes — Hostname that owns the state entry. pathstring No — Dot-notation path under which the value is stored. valueany Yes — Arbitrary JSON value to store (object, array, string, number, boolean, or null). mergeboolean No falseWhen true, shallow-merge value into the existing state at path instead of replacing it.
curl -X POST https://api.hoody.com/v1/exec/shared-state/set \
-H " Authorization: Bearer <token> " \
-H " Content-Type: application/json " \
"hostname": "api.example.com",
"lastSha": "a1b2c3d4e5f6",
"timestamp": "2026-01-15T10:30:00Z"
await client . exec . state . set ({
hostname: " api.example.com " ,
timestamp: " 2026-01-15T10:30:00Z " ,
"hostname" : " api.example.com " ,
"error" : " Missing required field: value " ,
"code" : " VALIDATION_ERROR " ,
"timestamp" : " 2026-01-15T10:42:13.214Z " ,
Error Code Title Description Resolution VALIDATION_ERRORInvalid input Request parameters failed validation Check parameter format and requirements; ensure hostname and value are present
"error" : " Failed to persist shared state " ,
"timestamp" : " 2026-01-15T10:42:13.214Z " ,
"reason" : " storage backend unavailable "
Retrieve a value from the shared state store. The response shape depends on whether the requested entry exists: a missing entry returns exists: false with a null state; a present entry returns exists: true, the stored state, and its size in bytes.
Field Type Required Default Description hostnamestring Yes — Hostname that owns the state entry. pathstring No — Dot-notation path of the value to read. When omitted, the entire hostname state is returned.
curl -X POST https://api.hoody.com/v1/exec/shared-state/get \
-H " Authorization: Bearer <token> " \
-H " Content-Type: application/json " \
"hostname": "api.example.com",
const result = await client . exec . state . get ( {
hostname: " api.example.com " ,
"hostname" : " api.example.com " ,
"path" : " deploy.lastSha " ,
"hostname" : " api.example.com " ,
"path" : " deploy.missing " ,
"error" : " Missing required field: hostname " ,
"code" : " VALIDATION_ERROR " ,
"timestamp" : " 2026-01-15T10:42:13.214Z " ,
Error Code Title Description Resolution VALIDATION_ERRORInvalid input Request parameters failed validation Check parameter format and requirements; ensure hostname is present
"error" : " Failed to read shared state " ,
"timestamp" : " 2026-01-15T10:42:13.214Z " ,
"reason" : " storage backend unavailable "
Remove a value, a subtree, or every entry from a hostname’s shared state store. By default, the value at the supplied path is cleared; pass clearAll: true to wipe the entire hostname state.
Field Type Required Default Description hostnamestring Yes — Hostname whose shared state should be cleared. pathstring No — Dot-notation path of the value to clear. Ignored when clearAll is true. clearAllboolean No falseClear all shared state entries for the given hostname.
curl -X POST https://api.hoody.com/v1/exec/shared-state/clear \
-H " Authorization: Bearer <token> " \
-H " Content-Type: application/json " \
"hostname": "api.example.com",
"path": "deploy.lastSha",
await client . exec . state . clear ({
hostname: " api.example.com " ,
"error" : " Missing required field: hostname " ,
"code" : " VALIDATION_ERROR " ,
"timestamp" : " 2026-01-15T10:42:13.214Z " ,
Error Code Title Description Resolution VALIDATION_ERRORInvalid input Request parameters failed validation Check parameter format and requirements; ensure hostname is present
"error" : " Failed to clear shared state " ,
"timestamp" : " 2026-01-15T10:42:13.214Z " ,
"reason" : " storage backend unavailable "