Skip to content
Hoody.com

The exec service caches compiled V8 isolates per hostname and exposes a small shared state document scoped to each hostname. The endpoints on this page let you invalidate that cache and read, write, or clear shared state that survives across script invocations.

Use cache/clear when a script’s shape has changed and the cached VM is stale, or when you want to reset the shared state for a hostname. Use the shared-state/* endpoints to coordinate lightweight values between scripts running against the same hostname.

Clears the cached V8 isolate and, optionally, the shared state document for a hostname. The cache is keyed by hostname, not by script path, so passing scriptPath is deprecated and returns HTTP 400.

NameTypeRequiredDefaultDescription
hostnamestringNoHostname whose cached VM and shared state should be cleared
execIdstringNoAlternative to hostname: scopes the clear to a specific exec deployment
scriptPathstringNoDeprecated. Passing scriptPath returns HTTP 400. The VM cache is keyed by hostname, so use hostname or clearAll=true instead
clearVmbooleanNotrueClear the cached V8 VM for the selector
clearStatebooleanNofalseClear the shared state document for the selector
clearAllbooleanNofalseClear every cache and shared state entry across all hostnames

Summary of what was cleared, including the selector that was matched and how many entries were removed from each store.

{
"cleared": true,
"selector": "example.com",
"matched": 1,
"vmCache": {
"cleared": 1,
"remaining": 0
},
"sharedState": {
"cleared": 0,
"remaining": 1
}
}
Terminal window
curl -X POST https://{projectId}-{containerId}-exec-1.{server}.containers.hoody.com/api/v1/exec/cache/clear \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"hostname": "example.com",
"clearVm": true,
"clearState": false,
"clearAll": false
}'

Reads the shared state document for a hostname, optionally narrowed to a specific path. Returns exists: false when the document or path is not present.

NameTypeRequiredDefaultDescription
hostnamestringYesHostname that owns the shared state document
execIdstringNoAlternative to hostname: narrows the read to a specific exec deployment
pathstringNoPath within the state document (omit to read the root)

The shared state value at the requested path, or a not-found response when the path does not exist.

When the path exists, the response carries exists: true, the current value in state, and the serialized size in size:

{
"hostname": "example.com",
"path": "user/12345",
"exists": true,
"state": {
"lastSeen": "2026-03-15T10:30:00Z",
"score": 42
},
"size": 78
}

When the path is missing, the response carries exists: false and state: null:

{
"hostname": "example.com",
"path": "user/99999",
"exists": false,
"state": null
}
Terminal window
curl -X POST https://{projectId}-{containerId}-exec-1.{server}.containers.hoody.com/api/v1/exec/shared-state/get \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"hostname": "example.com",
"path": "user/12345"
}'

Writes a value into the shared state document for a hostname. By default, the value replaces the document at the target path. When merge: true, the incoming value is merged into the existing object at that path.

NameTypeRequiredDefaultDescription
hostnamestringYesHostname that owns the shared state document
execIdstringNoAlternative to hostname: narrows the write to a specific exec deployment
pathstringNoPath within the state document (omit to write to the root)
valueany (JSON)YesValue to store: object, array, number, boolean, string, or null
mergebooleanNofalseWhen true, merge the incoming value into the existing document. When false (default), replace the document at the target path

Confirmation that the document was written, along with the resolved key, the resulting size, and whether the value was merged.

{
"hostname": "example.com",
"key": "example.com",
"path": "user/12345",
"updated": true,
"merged": true,
"size": 78
}
Terminal window
curl -X POST https://{projectId}-{containerId}-exec-1.{server}.containers.hoody.com/api/v1/exec/shared-state/set \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"hostname": "example.com",
"path": "user/12345",
"value": {
"lastSeen": "2026-03-15T10:30:00Z",
"score": 42
},
"merge": true
}'

Clears a path within the shared state document for a hostname, or clears every entry across all hostnames when clearAll: true.

NameTypeRequiredDefaultDescription
hostnamestringNoHostname that owns the shared state document
execIdstringNoAlternative to hostname: narrows the clear to a specific exec deployment
pathstringNoPath within the state document to clear (omit with clearAll: true to wipe everything)
clearAllbooleanNofalseWhen true, clear every shared state entry across all hostnames; otherwise clear the path within hostname

Confirmation that the state was cleared. The shape differs depending on whether a single path was removed or clearAll was used.

When a specific path is removed, the response carries the hostname, path, selector, count, the cleared flag, and a reason:

{
"hostname": "example.com",
"selector": "example.com",
"path": "user/12345",
"cleared": true,
"count": 1,
"reason": "Path removed"
}

When clearAll: true is used, the response carries the number of entries removed, the selector, and how many remain:

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