Skip to content

Clear VM execution caches and manage hostname-scoped shared state values that persist across scripts. VM cache entries are keyed by hostname; shared state values are scoped per hostname (and optionally per path) and accept arbitrary JSON. Use these endpoints during development to reset cached executions, and at runtime to coordinate values between scripts.

Clear the VM execution cache and (optionally) the shared state for a hostname.

FieldTypeRequiredDefaultDescription
hostnamestringNoHostname key for the cache entry to clear.
scriptPathstringNoDeprecated. Returns HTTP 400 if supplied.
clearVmbooleanNotrueClear the VM execution cache.
clearStatebooleanNofalseAlso clear shared state for the hostname.
clearAllbooleanNofalseClear both VM cache and shared state for the hostname.

Success.

{
"cleared": true,
"vmCache": {
"cleared": 3,
"remaining": 0
},
"sharedState": {
"cleared": 0,
"remaining": 0
}
}
await client.exec.cache.clear({
hostname: "example.com",
clearVm: true,
clearState: false,
clearAll: false,
});

Shared state is a persistent, hostname-scoped JSON store. Values are arbitrary JSON, addressed by hostname and (optionally) a path. Use clearAll: true to wipe all paths under a hostname.

Remove one or all shared state values for a hostname.

FieldTypeRequiredDefaultDescription
hostnamestringYesHostname key for the shared state.
pathstringNoSpecific state path to clear. Ignored when clearAll: true.
clearAllbooleanNofalseClear all shared state for the hostname.

Success.

{
"cleared": true,
"count": 4,
"remaining": 0
}
await client.exec.state.clear({
hostname: "example.com",
path: "/user/profile",
clearAll: false,
});

Read the current shared state value for a hostname and (optionally) a path.

FieldTypeRequiredDefaultDescription
hostnamestringYesHostname key for the shared state.
pathstringNoSpecific state path to read.

Success. The response shape depends on whether the state exists.

When state exists at the requested path:

{
"hostname": "example.com",
"path": "/user/profile",
"exists": true,
"state": {
"name": "Ada Lovelace",
"score": 42
},
"size": 42
}

When state does not exist at the requested path:

{
"hostname": "example.com",
"path": "/user/missing",
"exists": false,
"state": null
}
const { exists, state } = await client.exec.state.get({
hostname: "example.com",
path: "/user/profile",
});

Write (or merge into) the shared state value at a hostname and (optionally) a path.

FieldTypeRequiredDefaultDescription
hostnamestringYesHostname key for the shared state.
pathstringNoSpecific state path to write to.
valuestringYesArbitrary JSON value to store.
mergebooleanNofalseMerge the supplied value into the existing object at path instead of replacing it.

Success.

{
"hostname": "example.com",
"path": "/user/profile",
"updated": true,
"merged": false,
"size": 256
}
await client.exec.state.set({
hostname: "example.com",
path: "/user/profile",
value: { name: "Ada Lovelace", score: 42 },
merge: true,
});