Skip to content

The Script Management API lets you read, write, delete, list, and organize executable scripts and their associated metadata. Endpoints cover enumerating available exec contexts, reading and writing script source files, bulk and per-file magic-comment operations, and moving files within the script tree.

Use these endpoints to integrate script lifecycle management into your tooling: discover what scripts exist, inspect or modify their contents, manage declarative metadata (magic comments), and reorganize files programmatically.


List all exec IDs, including SDK- and custom-sourced scripts. Returns the catalog of executable contexts available in the current environment along with a summary of counts per type.

This endpoint takes no parameters.

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

Response statuses

Success.

{
"execIds": [
{
"id": "exec_5f8a3b2c9d1e4f7a",
"type": "sdk",
"source_url": "https://sdk.hoody.com/v1.2.0",
"files": 42
}
],
"total": 1,
"summary": {
"sdk": 1,
"custom": 0
}
}

Magic comments are inline directives placed at the top of a script that control execution behavior, logging, CORS, AI integration, and metadata. The endpoints below let you read, schema-inspect, and update these directives on a per-file or bulk basis.

Read the parsed magic comments for a single script. Sensitive values such as tokens are redacted in the response.

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

Response statuses

Success.

{
"path": "scripts/hello.ts",
"comments": {
"mode": "sync",
"timeout": 30000
}
}

Retrieve the schema document describing every supported magic comment directive, including field types, defaults per context, enums, ranges, and categorizations.

This endpoint takes no parameters.

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

Response statuses

Success.


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

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

Update magic comments across every script in a directory in a single request. Supports a dry_run mode that previews the affected files and proposed changes without modifying them.

This endpoint takes no parameters.

Request body

NameTypeRequiredDefaultDescription
directorystringNoDirectory
execIdstringNoExec Id
commentsstringNoComments
extensionstringNo".ts"Extension
recursivebooleanNotrueRecursive
dry_runbooleanNofalseDry_run
Terminal window
curl -X POST https://api.hoody.com/api/v1/exec/magic-comments/bulk-update \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"directory": "scripts/handlers",
"execId": "exec_5f8a3b2c9d1e4f7a",
"comments": "@hoody-mode async\n@hoody-timeout 60000",
"extension": ".ts",
"recursive": true,
"dry_run": true
}'

Response statuses

Success. The discriminator is the message field: "Preview only - set dry_run=false to apply changes" indicates a dry run, while "Magic comments updated successfully" indicates an applied change.


Update the magic comments block of a single script file. Supports a dry_run mode that returns the current and proposed states plus a list of change keys without writing.

This endpoint takes no parameters.

Request body

NameTypeRequiredDefaultDescription
pathstringYesPath
commentsstringNoComments
dry_runbooleanNofalseDry_run
Terminal window
curl -X PUT https://api.hoody.com/api/v1/exec/magic-comments/update \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"path": "scripts/handlers/a.ts",
"comments": "@hoody-mode async\n@hoody-timeout 60000",
"dry_run": true
}'

Response statuses

Success. The discriminator is the message field: "Preview only - set dry_run=false to apply changes" indicates a dry run, while "Magic comments updated successfully" indicates an applied change.


The script file operations cover the full lifecycle: discover files, read their contents and metadata, create or update them, move them within the tree, and delete them.

List scripts in a directory. Supports filtering by label, tag, mode, enabled state, websocket usage, and includes an option to recurse into subdirectories and parse magic comments for each entry.

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/api/v1/exec/scripts/list?dir=scripts/handlers&recursive=true&include_comments=true" \
-H "Authorization: Bearer <token>"

Response statuses

Success. The response shape depends on the request: filtered/recursive listing returns the rich shape with filters and isDirectory flags; a minimal listing returns only directory, count, and scripts.


Read the full content of a script along with its parsed magic comments, resolved absolute path, 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://api.hoody.com/api/v1/exec/scripts/read?path=scripts/handlers/a.ts" \
-H "Authorization: Bearer <token>"

Response statuses

Success.


Create a new script or overwrite an existing one. By default, missing parent directories are created automatically and the script is validated before being persisted. The response includes a schedule object describing any scheduling action that should follow (for example, enabling a new script in the exec environment).

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.

Request body

NameTypeRequiredDefaultDescription
pathstringYesPath
contentstringYesContent
createDirsbooleanNotrueCreate Dirs
validatebooleanNotrueValidate
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/api/v1/exec/scripts/write" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"path": "scripts/handlers/a.ts",
"content": "export default async function handler(req) {\n return { ok: true };\n}\n",
"createDirs": true,
"validate": true
}'

Response statuses

Success.


Delete a script from the file system. The confirm flag can be supplied to assert intent for safety; without it, the server may reject the request depending on policy.

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

Response statuses

Success.


Rename or relocate a script within the file tree. Returns both the requested and resolved source/destination paths along with the file size.

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.

Request body

NameTypeRequiredDefaultDescription
fromstringYesFrom
tostringYesTo
overwritebooleanNofalseOverwrite
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/api/v1/exec/scripts/move" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"from": "scripts/handlers/a.ts",
"to": "scripts/handlers/renamed/a.ts",
"overwrite": false
}'

Response statuses

Success.


Get a hierarchical tree representation of the script directory. Depth and per-node metadata are controllable.

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.

Request body

NameTypeRequiredDefaultDescription
baseDirstringNo""Base Dir
maxDepthintegerNo10Max Depth
includeMetadatabooleanNofalseInclude Metadata
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/api/v1/exec/scripts/tree" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"baseDir": "scripts/handlers",
"maxDepth": 5,
"includeMetadata": true
}'

Response statuses

Success.