Skip to content
Hoody.com

Manage execution-side caching and the shared state store that lets scripts persist and share data across executions. Use these endpoints to clear cached VM state, inspect or update shared state scoped to a hostname, or wipe state on demand during debugging or test teardown.

Clear cached VM state and/or shared state for a hostname. By default, only the VM cache is cleared; pass clearAll=true to wipe both caches in one call.

This endpoint takes no parameters.

NameTypeRequiredDescription
hostnamestringNoHostname whose cache should be cleared.
scriptPathstringNoNot accepted - a scriptPath-based clear returns HTTP 400. The VM cache is keyed by hostname, so use hostname or clearAll=true.
clearVmbooleanNoWhether to clear the VM cache. Default: true.
clearStatebooleanNoWhether to clear shared state. Default: false.
clearAllbooleanNoWhether to clear both VM cache and shared state. Default: false.
{
"cleared": true,
"vmCache": {
"cleared": 3,
"remaining": 0
},
"sharedState": {
"cleared": 0,
"remaining": 2
}
}
Terminal window
curl -X POST "https://{projectId}-{containerId}-exec-1.{server}.containers.hoody.com/api/v1/exec/cache/clear" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <token>" \
-d '{
"hostname": "shop.example.com",
"clearAll": true
}'

Shared state is a hostname-scoped key-value store that persists across script executions. The four endpoints below cover the full lifecycle: read, write, and wipe.

Read the current shared state for a hostname. Returns the value at a specific path, or the entire state object when no path is supplied.

This endpoint takes no parameters.

NameTypeRequiredDescription
hostnamestringYesHostname whose shared state should be returned.
pathstringNoPath within the state object. Omit to return the entire state.
{
"hostname": "shop.example.com",
"path": "cart.items",
"exists": true,
"state": [
{ "sku": "ABC-001", "qty": 2 },
{ "sku": "ABC-014", "qty": 1 }
],
"size": 84
}
Terminal window
curl -X POST "https://{projectId}-{containerId}-exec-1.{server}.containers.hoody.com/api/v1/exec/shared-state/get" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <token>" \
-d '{
"hostname": "shop.example.com",
"path": "cart.items"
}'

Write or update the shared state for a hostname. Pass merge=true to deep-merge the incoming value into the existing state rather than replacing it.

This endpoint takes no parameters.

NameTypeRequiredDescription
hostnamestringYesHostname whose shared state should be written.
pathstringNoPath within the state object. Omit to set the entire state.
valueany (JSON)YesArbitrary JSON value to store. May be an object, array, number, boolean, string, or null.
mergebooleanNoWhen true, deep-merge value into the existing state instead of replacing it. Default: false.
{
"hostname": "shop.example.com",
"path": "cart.items",
"updated": true,
"merged": false,
"size": 124
}
Terminal window
curl -X POST "https://{projectId}-{containerId}-exec-1.{server}.containers.hoody.com/api/v1/exec/shared-state/set" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <token>" \
-d '{
"hostname": "shop.example.com",
"path": "cart.items",
"value": [
{ "sku": "ABC-001", "qty": 2 }
],
"merge": false
}'

Remove a path from shared state, or wipe the entire state for a hostname when clearAll=true. The response shape differs depending on whether a single path was cleared or the full state was wiped.

This endpoint takes no parameters.

NameTypeRequiredDescription
hostnamestringYesHostname whose shared state should be cleared.
pathstringNoPath within the state object to remove. Required unless clearAll=true.
clearAllbooleanNoWhen true, wipe all shared state for the hostname. Default: false.
{
"hostname": "shop.example.com",
"path": "cart.items",
"cleared": true,
"reason": "path-removed"
}

When clearAll=true, the response shape changes to a summary:

{
"cleared": true,
"count": 7,
"remaining": 0
}
Terminal window
curl -X POST "https://{projectId}-{containerId}-exec-1.{server}.containers.hoody.com/api/v1/exec/shared-state/clear" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <token>" \
-d '{
"hostname": "shop.example.com",
"path": "cart.items"
}'