Skip to content
Hoody.com

Read, write, delete, list, and organize scripts that the exec service manages on a container. All file operations act on the scripts root at /hoody/storage/hoody-exec/scripts on disk. Caller-supplied path values are normally instance-relative (for example deploy.ts or jobs/cleanup.ts); the service resolves them under the scope prefix <subdomain>/<execId>, where <subdomain> is the literal string default whenever the request host carries no subdomain. A complete prefix such as default/1/deploy.ts or a full absolute path is also accepted and left untouched. The fields resolvedPath, resolvedFrom, and resolvedTo returned by these endpoints are always scripts-root-relative.

List every exec instance ID available on this container, grouped by source (sdk vs custom).

This endpoint takes no parameters.

Terminal window
curl -X GET "https://{projectId}-{containerId}-exec-1.{server}.containers.hoody.com/api/v1/exec/list" \
-H "Authorization: Bearer $HOODY_TOKEN"

Parse and return the magic comments declared at the top of a script.

NameInTypeRequiredDescription
pathquerystringYesPath query parameter
Terminal window
curl -X GET "https://{projectId}-{containerId}-exec-1.{server}.containers.hoody.com/api/v1/exec/magic-comments/read?path=deploy.ts" \
-H "Authorization: Bearer $HOODY_TOKEN"

Return the schema document that describes every magic-comment key, its directive, allowed values, and defaults.

This endpoint takes no parameters.

Terminal window
curl -X GET "https://{projectId}-{containerId}-exec-1.{server}.containers.hoody.com/api/v1/exec/magic-comments/schema" \
-H "Authorization: Bearer $HOODY_TOKEN"

POST /api/v1/exec/magic-comments/bulk-update

Section titled “POST /api/v1/exec/magic-comments/bulk-update”

Apply the same magic-comment block to every script in a directory (or preview the changes with dry_run: true).

FieldTypeRequiredDefaultDescription
directorystringNo-Directory
execIdstringNo-Exec Id
commentsstringNo-Comments
extensionstringNo".ts"Extension
recursivebooleanNotrueRecursive
dry_runbooleanNofalseDry_run
Terminal window
curl -X POST "https://{projectId}-{containerId}-exec-1.{server}.containers.hoody.com/api/v1/exec/magic-comments/bulk-update" \
-H "Authorization: Bearer $HOODY_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"directory": "default/1",
"execId": "1",
"comments": "/* @mode on_demand\n @timeout 30000 */",
"extension": ".ts",
"recursive": true,
"dry_run": false
}'

Update the magic comments on a single script (or preview the diff with dry_run: true).

FieldTypeRequiredDefaultDescription
pathstringYes-Path
commentsstringNo-Comments
dry_runbooleanNofalseDry_run
Terminal window
curl -X PUT "https://{projectId}-{containerId}-exec-1.{server}.containers.hoody.com/api/v1/exec/magic-comments/update" \
-H "Authorization: Bearer $HOODY_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"path": "deploy.ts",
"comments": "/* @mode scheduled\n @timeout 60000\n @cors true */",
"dry_run": false
}'

List the scripts in a directory with optional filtering by label, tags, mode, enabled state, and websocket binding.

NameInTypeRequiredDescription
dirquerystringNoDir query parameter
filterquerystringNoFilter query parameter
metadataquerystringNoMetadata query parameter
labelquerystringNoLabel query parameter
tagsquerystringNoTags query parameter
modequerystringNoMode query parameter
enabledquerystringNoEnabled query parameter
websocketquerystringNoWebsocket query parameter
recursivequerystringNoRecursive query parameter
include_commentsquerystringNoInclude_comments query parameter
execIdquerystringNoOptional execution scope. When provided, relative paths resolve under default/{execId}/ unless subdomain is also set. Query value takes precedence over body.
exec_idquerystringNoAlias for execId (snake_case).
subdomainquerystringNoOptional subdomain namespace used with execId for path resolution.
Terminal window
curl -X GET "https://{projectId}-{containerId}-exec-1.{server}.containers.hoody.com/api/v1/exec/scripts/list?recursive=false" \
-H "Authorization: Bearer $HOODY_TOKEN"

Read the contents of a single script along with its parsed magic comments and file metadata.

NameInTypeRequiredDescription
pathquerystringYesPath query parameter
execIdquerystringNoOptional execution scope. When provided, relative paths resolve under default/{execId}/ unless subdomain is also set. Query value takes precedence over body.
exec_idquerystringNoAlias for execId (snake_case).
subdomainquerystringNoOptional subdomain namespace used with execId for path resolution.
Terminal window
curl -X GET "https://{projectId}-{containerId}-exec-1.{server}.containers.hoody.com/api/v1/exec/scripts/read?path=deploy.ts" \
-H "Authorization: Bearer $HOODY_TOKEN"

Create or update a script. By default, missing parent directories are created and the script is validated before it is persisted.

NameInTypeRequiredDescription
execIdquerystringNoOptional execution scope. When provided, relative paths resolve under default/{execId}/ unless subdomain is also set. Query value takes precedence over body.
exec_idquerystringNoAlias for execId (snake_case).
subdomainquerystringNoOptional subdomain namespace used with execId for path resolution.
FieldTypeRequiredDefaultDescription
pathstringYes-Path
contentstringYes-Content
createDirsbooleanNotrueCreate Dirs
validatebooleanNotrueValidate
execIdstringNo-Optional execution scope in request body. Query execId/exec_id takes precedence when both are provided.
exec_idstringNo-Alias for execId (snake_case).
subdomainstringNo-Optional subdomain namespace used with execId for path resolution.
Terminal window
curl -X POST "https://{projectId}-{containerId}-exec-1.{server}.containers.hoody.com/api/v1/exec/scripts/write" \
-H "Authorization: Bearer $HOODY_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"path": "jobs/cleanup.ts",
"content": "// @mode on_demand\nexport default async function main() {\n console.log(\"cleaning up...\");\n}\n",
"createDirs": true,
"validate": true
}'

Rename or relocate a script. Both from and to are accepted in the same instance-relative or fully-prefixed form as path elsewhere on this page.

NameInTypeRequiredDescription
execIdquerystringNoOptional execution scope. When provided, relative paths resolve under default/{execId}/ unless subdomain is also set. Query value takes precedence over body.
exec_idquerystringNoAlias for execId (snake_case).
subdomainquerystringNoOptional subdomain namespace used with execId for path resolution.
FieldTypeRequiredDefaultDescription
fromstringYes-From
tostringYes-To
overwritebooleanNofalseOverwrite
execIdstringNo-Optional execution scope in request body. Query execId/exec_id takes precedence when both are provided.
exec_idstringNo-Alias for execId (snake_case).
subdomainstringNo-Optional subdomain namespace used with execId for path resolution.
Terminal window
curl -X POST "https://{projectId}-{containerId}-exec-1.{server}.containers.hoody.com/api/v1/exec/scripts/move" \
-H "Authorization: Bearer $HOODY_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"from": "deploy.ts",
"to": "jobs/deploy.ts",
"overwrite": false
}'

Walk a directory and return a nested tree of scripts and subdirectories, capped at maxDepth.

NameInTypeRequiredDescription
execIdquerystringNoOptional execution scope. When provided, relative paths resolve under default/{execId}/ unless subdomain is also set. Query value takes precedence over body.
exec_idquerystringNoAlias for execId (snake_case).
subdomainquerystringNoOptional subdomain namespace used with execId for path resolution.
FieldTypeRequiredDefaultDescription
baseDirstringNo""Base Dir
maxDepthintegerNo10Max Depth
includeMetadatabooleanNofalseInclude Metadata
execIdstringNo-Optional execution scope in request body. Query execId/exec_id takes precedence when both are provided.
exec_idstringNo-Alias for execId (snake_case).
subdomainstringNo-Optional subdomain namespace used with execId for path resolution.
Terminal window
curl -X POST "https://{projectId}-{containerId}-exec-1.{server}.containers.hoody.com/api/v1/exec/scripts/tree" \
-H "Authorization: Bearer $HOODY_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"baseDir": "",
"maxDepth": 10,
"includeMetadata": false
}'

Delete a single script. The confirm query parameter is accepted as a safety check on the caller side but is not enforced by the server.

NameInTypeRequiredDescription
pathquerystringYesPath query parameter
confirmquerystringNoConfirm query parameter
execIdquerystringNoOptional execution scope. When provided, relative paths resolve under default/{execId}/ unless subdomain is also set. Query value takes precedence over body.
exec_idquerystringNoAlias for execId (snake_case).
subdomainquerystringNoOptional subdomain namespace used with execId for path resolution.
Terminal window
curl -X DELETE "https://{projectId}-{containerId}-exec-1.{server}.containers.hoody.com/api/v1/exec/scripts/delete?path=deploy.ts" \
-H "Authorization: Bearer $HOODY_TOKEN"