Skip to content
Hoody.com

The Script Management API provides endpoints for reading, writing, deleting, listing, and organizing scripts stored in the execution service. Use these endpoints to manage SDK-sourced scripts and custom scripts, manipulate magic comments that control script behavior, and navigate the script directory tree.

All endpoints in this section are scoped to a specific container, so the base URL follows the per-container pattern shown under each operation.


List every exec ID available in the container, grouped by type (SDK or custom), with a summary count.

This endpoint takes no parameters.

Terminal window
curl -X GET "https://proj-abc123-cont-xyz789-exec-1.eu-west-1.containers.hoody.icu/api/v1/exec/list"

Magic comments are directives embedded at the top of script files that configure runtime behavior (for example, enabling webhooks, declaring required env vars, or setting CORS origins). The endpoints below let you read, validate, and update them in bulk or per file.

Returns the canonical schema describing every supported magic comment directive, including defaults and source-of-truth metadata.

This endpoint takes no parameters.

Terminal window
curl -X GET "https://proj-abc123-cont-xyz789-exec-1.eu-west-1.containers.hoody.icu/api/v1/exec/magic-comments/schema"

Parse and return the magic comments block at the top of a given script. Tokens are redacted in the response.

NameInTypeRequiredDescription
pathquerystringYesPath query parameter
Terminal window
curl -X GET "https://proj-abc123-cont-xyz789-exec-1.eu-west-1.containers.hoody.icu/api/v1/exec/magic-comments/read?path=default%2Fhello-world.ts"

Update the magic comments block on a single script. Set dry_run to true to preview changes without writing to disk.

This endpoint takes no parameters.

FieldTypeRequiredDefaultDescription
pathstringYes-Path of the script to update
commentsstringNo-Comments payload (raw magic-comment block)
dry_runbooleanNofalseWhen true, returns a preview without modifying the file
Terminal window
curl -X PUT "https://proj-abc123-cont-xyz789-exec-1.eu-west-1.containers.hoody.icu/api/v1/exec/magic-comments/update" \
-H "Content-Type: application/json" \
-d '{
"path": "default/hello-world.ts",
"comments": "@enable-webhooks true\n@webhook-url https://example.com/hook\n",
"dry_run": false
}'

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

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

Update the magic comments block across every script in a directory. Supports a dry_run preview and recursive traversal.

This endpoint takes no parameters.

FieldTypeRequiredDefaultDescription
directorystringNo-Target directory (relative to SCRIPT_DIR).
execIdstringNo-Execution scope; resolves under default/{execId}/ unless subdomain is also set.
commentsstringNo-Raw magic-comment block to apply to each file.
extensionstringNo".ts"File extension to consider when scanning.
recursivebooleanNotrueRecurse into subdirectories.
dry_runbooleanNofalseWhen true, returns a preview without modifying files.
Terminal window
curl -X POST "https://proj-abc123-cont-xyz789-exec-1.eu-west-1.containers.hoody.icu/api/v1/exec/magic-comments/bulk-update" \
-H "Content-Type: application/json" \
-d '{
"directory": "default",
"execId": "01HXYZ1234567890ABCDEFGHJ",
"comments": "@enable-webhooks true\n@cors-origins *\n",
"extension": ".ts",
"recursive": true,
"dry_run": true
}'

The script endpoints manage file-level operations: listing, reading, writing, moving, deleting, and visualizing the directory tree.

List scripts in a directory. Supports filtering by metadata (label, tags, mode, enabled, websocket) and optional recursion.

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://proj-abc123-cont-xyz789-exec-1.eu-west-1.containers.hoody.icu/api/v1/exec/scripts/list?dir=default&recursive=true&execId=01HXYZ1234567890ABCDEFGHJ"

Read a single script file and return its content together with parsed magic comments and filesystem 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://proj-abc123-cont-xyz789-exec-1.eu-west-1.containers.hoody.icu/api/v1/exec/scripts/read?path=default%2Fhello-world.ts"

Create or overwrite a script file. Validates the script content and optionally creates missing parent directories.

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 of the script to write.
contentstringYes-Script source content.
createDirsbooleanNotrueCreate parent directories if they do not exist.
validatebooleanNotrueValidate script content before writing.
execIdstringNo-Optional execution scope in the 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://proj-abc123-cont-xyz789-exec-1.eu-west-1.containers.hoody.icu/api/v1/exec/scripts/write" \
-H "Content-Type: application/json" \
-d '{
"path": "default/hello-world.ts",
"content": "export default async function handler(req, res) {\n res.json({ ok: true });\n}\n",
"createDirs": true,
"validate": true
}'

Rename or move a script from one path to another. Returns a conflict if the destination already exists and overwrite is false.

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-Source path
tostringYes-Destination path
overwritebooleanNofalseOverwrite the destination if it already exists
execIdstringNo-Optional execution scope in the 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://proj-abc123-cont-xyz789-exec-1.eu-west-1.containers.hoody.icu/api/v1/exec/scripts/move" \
-H "Content-Type: application/json" \
-d '{
"from": "old-folder/script.ts",
"to": "new-folder/script.ts",
"overwrite": false
}'

Return a hierarchical tree view of the script directory, with configurable depth and optional file metadata.

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""Root directory for the tree
maxDepthintegerNo10Maximum recursion depth
includeMetadatabooleanNofalseInclude per-entry metadata in the tree
execIdstringNo-Optional execution scope in the 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://proj-abc123-cont-xyz789-exec-1.eu-west-1.containers.hoody.icu/api/v1/exec/scripts/tree" \
-H "Content-Type: application/json" \
-d '{
"baseDir": "default",
"maxDepth": 5,
"includeMetadata": false
}'

Delete a script file. Pass confirm=true to bypass safety checks.

NameInTypeRequiredDescription
pathquerystringYesPath of the script to delete
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://proj-abc123-cont-xyz789-exec-1.eu-west-1.containers.hoody.icu/api/v1/exec/scripts/delete?path=default%2Fhello-world.ts&confirm=true"