Skip to content

Script Management lets you discover, read, write, organize, and inspect executable scripts and their magic-comment metadata. Use these endpoints to browse exec IDs, list and traverse script directories, read or modify script content, move or delete files, and manage magic-comment directives used by the runtime.

Returns the IDs of all available exec scopes (SDK and custom) along with a summary count.

This endpoint takes no parameters.

Terminal window
curl -X GET https://api.hoody.com/v1/exec/list \
-H "Authorization: Bearer <token>"

Magic comments are parsed directives embedded at the top of a script that control runtime behavior, logging, CORS, AI features, and metadata. The endpoints below let you read them, inspect their schema, and update them.

Parses and returns the magic-comment directives found at the top of a script file. Tokens are redacted in the response.

NameInTypeRequiredDescription
pathquerystringYesPath query parameter
Terminal window
curl -X GET "https://api.hoody.com/v1/exec/magic-comments/read?path=scripts/translate.ts" \
-H "Authorization: Bearer <token>"

Returns the canonical schema describing every supported magic-comment directive, including categories, default values, and accepted ranges.

This endpoint takes no parameters.

Terminal window
curl -X GET https://api.hoody.com/v1/exec/magic-comments/schema \
-H "Authorization: Bearer <token>"

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

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

Applies or previews a batch of magic-comment changes across every script in a directory. Supports dry_run to preview the diff before writing.

This endpoint takes no path, query, or header parameters.

NameTypeRequiredDefaultDescription
directorystringNoTarget directory to scan
execIdstringNoExecution scope for path resolution
commentsstringNoNew magic-comment block to apply
extensionstringNo".ts"File extension filter
recursivebooleanNotrueRecurse into subdirectories
dry_runbooleanNofalseWhen true, returns a preview without writing
Terminal window
curl -X POST https://api.hoody.com/v1/exec/magic-comments/bulk-update \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"directory": "scripts",
"comments": "// @hoody.comtime node22\n// @hoody.timeout 30000",
"extension": ".ts",
"recursive": true,
"dry_run": true
}'

Updates the magic comments of a single script file. Supports dry_run to preview changes before applying them.

This endpoint takes no path, query, or header parameters.

NameTypeRequiredDefaultDescription
pathstringYesPath of the script to update
commentsstringNoNew magic-comment block
dry_runbooleanNofalseWhen true, returns a preview without writing
Terminal window
curl -X PUT https://api.hoody.com/v1/exec/magic-comments/update \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"path": "scripts/translate.ts",
"comments": "// @hoody.comtime node22",
"dry_run": true
}'

These endpoints operate on script files within an exec scope: listing, reading, writing, moving, traversing, and deleting.

Lists scripts and directories within a target folder, with optional filters for label, tags, mode, enabled state, and WebSocket usage.

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://api.hoody.com/v1/exec/scripts/list?dir=scripts&recursive=true&label=ai" \
-H "Authorization: Bearer <token>"

Reads the raw content of a script, 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://api.hoody.com/v1/exec/scripts/read?path=scripts/translate.ts" \
-H "Authorization: Bearer <token>"

Creates or overwrites a script file. Optionally validates the content and creates intermediate 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.
NameTypeRequiredDefaultDescription
pathstringYesTarget path for the script
contentstringYesFull script content to write
createDirsbooleanNotrueCreate intermediate directories if missing
validatebooleanNotrueValidate the script before persisting
execIdstringNoOptional execution scope in request body. Query execId/exec_id takes precedence when both are provided.
exec_idstringNoAlias for execId (snake_case).
subdomainstringNoOptional subdomain namespace used with execId for path resolution.
Terminal window
curl -X POST https://api.hoody.com/v1/exec/scripts/write \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"path": "scripts/translate.ts",
"content": "// @hoody.comtime node22\nexport default async () => \"ok\";\n",
"createDirs": true,
"validate": true
}'

Renames or relocates a script within an exec scope. Returns a 409 Conflict when 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.
NameTypeRequiredDefaultDescription
fromstringYesSource path of the script
tostringYesDestination path
overwritebooleanNofalseAllow replacing an existing destination
execIdstringNoOptional execution scope in request body. Query execId/exec_id takes precedence when both are provided.
exec_idstringNoAlias for execId (snake_case).
subdomainstringNoOptional subdomain namespace used with execId for path resolution.
Terminal window
curl -X POST https://api.hoody.com/v1/exec/scripts/move \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"from": "scripts/draft/translate.ts",
"to": "scripts/translate.ts",
"overwrite": false
}'

Returns a hierarchical tree of scripts and folders rooted at the requested base directory.

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.
NameTypeRequiredDefaultDescription
baseDirstringNo""Root directory to traverse
maxDepthintegerNo10Maximum tree depth
includeMetadatabooleanNofalseAttach metadata to each node
execIdstringNoOptional execution scope in request body. Query execId/exec_id takes precedence when both are provided.
exec_idstringNoAlias for execId (snake_case).
subdomainstringNoOptional subdomain namespace used with execId for path resolution.
Terminal window
curl -X POST https://api.hoody.com/v1/exec/scripts/tree \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"baseDir": "scripts",
"maxDepth": 5,
"includeMetadata": false
}'

Permanently removes a script file. A confirm token is recommended to guard against accidental deletion.

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://api.hoody.com/v1/exec/scripts/delete?path=scripts/translate.ts&confirm=true" \
-H "Authorization: Bearer <token>"