Skip to content

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.

FieldTypeRequiredDefaultDescription
hostnamestringNoHostname whose VM cache entry should be cleared.
scriptPathstringNoDeprecated. scriptPath-based clear returns HTTP 400. VM cache is keyed by hostname. Use hostname or clearAll=true instead.
clearVmbooleanNotrueClear the VM cache for the given hostname.
clearStatebooleanNofalseAlso clear shared state for the given hostname.
clearAllbooleanNofalseClear VM cache and shared state for every hostname.
Terminal window
curl -X POST https://api.hoody.com/v1/exec/cache/clear \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"hostname": "api.example.com",
"clearVm": true,
"clearState": false
}'

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).

FieldTypeRequiredDefaultDescription
hostnamestringYesHostname that owns the state entry.
pathstringNoDot-notation path under which the value is stored.
valueanyYesArbitrary JSON value to store (object, array, string, number, boolean, or null).
mergebooleanNofalseWhen true, shallow-merge value into the existing state at path instead of replacing it.
Terminal window
curl -X POST https://api.hoody.com/v1/exec/shared-state/set \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"hostname": "api.example.com",
"path": "deploy",
"value": {
"lastSha": "a1b2c3d4e5f6",
"timestamp": "2026-01-15T10:30:00Z"
},
"merge": false
}'

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.

FieldTypeRequiredDefaultDescription
hostnamestringYesHostname that owns the state entry.
pathstringNoDot-notation path of the value to read. When omitted, the entire hostname state is returned.
Terminal window
curl -X POST https://api.hoody.com/v1/exec/shared-state/get \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"hostname": "api.example.com",
"path": "deploy.lastSha"
}'

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.

FieldTypeRequiredDefaultDescription
hostnamestringYesHostname whose shared state should be cleared.
pathstringNoDot-notation path of the value to clear. Ignored when clearAll is true.
clearAllbooleanNofalseClear all shared state entries for the given hostname.
Terminal window
curl -X POST https://api.hoody.com/v1/exec/shared-state/clear \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"hostname": "api.example.com",
"path": "deploy.lastSha",
"clearAll": false
}'