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.
curl -X GET " https://proj-abc123-cont-xyz789-exec-1.eu-west-1.containers.hoody.icu/api/v1/exec/list "
const result = await client . exec . ids . list ();
" id " : " 01HXYZ1234567890ABCDEFGHJ " ,
" source_url " : " https://github.com/example/sdk-scripts " ,
" id " : " 01HXYZ9876543210ZYXWVUTSR " ,
" error " : " VALIDATION_ERROR " ,
" code " : " VALIDATION_ERROR " ,
" timestamp " : " 2025-01-20T14:30:00.000Z " ,
" message " : " Invalid parameter format "
Error Code Title Description Resolution VALIDATION_ERRORInvalid input Request parameters failed validation Check parameter format and requirements
" error " : " Internal server error " ,
" timestamp " : " 2025-01-20T14:30:00.000Z "
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.
curl -X GET " https://proj-abc123-cont-xyz789-exec-1.eu-west-1.containers.hoody.icu/api/v1/exec/magic-comments/schema "
const schema = await client . exec . magic . getSchema ();
" schema_version " : " 1.0.0 " ,
" parse_window_lines " : 30 ,
" unknown_keys_behavior " : " ignored " ,
" when_omitted " : " fallback to runtime defaults " ,
" runtime " : " see runtime_defaults section " ,
" sdk_import " : " see sdk_import_defaults section "
" interface " : " MagicCommentMap " ,
" parser " : " src/lib/magicComments/parser.ts " ,
" runtime_defaults " : " src/lib/magicComments/defaults.ts " ,
" sdk_import_defaults " : " sdk/src/magicComments/defaults.ts "
" execution " : [ " enable-webhooks " , " webhook-url " ],
" logging " : [ " log-level " ],
" cors " : [ " cors-origins " ],
" metadata " : [ " description " , " author " ]
" key " : " enable-webhooks " ,
" directive " : " @enable-webhooks " ,
" enum_values " : [ " true " , " false " ],
" description " : " Enable webhook execution mode for the script " ,
" examples " : [ " @enable-webhooks true " ]
" error " : " VALIDATION_ERROR " ,
" code " : " VALIDATION_ERROR " ,
" timestamp " : " 2025-01-20T14:30:00.000Z " ,
" message " : " Invalid parameter format "
Error Code Title Description Resolution VALIDATION_ERRORInvalid input Request parameters failed validation Check parameter format and requirements
" error " : " Internal server error " ,
" timestamp " : " 2025-01-20T14:30:00.000Z "
Parse and return the magic comments block at the top of a given script. Tokens are redacted in the response.
Name In Type Required Description pathquery string Yes Path query parameter
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 "
const comments = await client . exec . magic . read ({ path : ' default/hello-world.ts ' });
" path " : " default/hello-world.ts " ,
" @enable-webhooks " : " true " ,
" @webhook-url " : " https://example.com/hook " ,
" @required-env-vars " : " API_KEY,API_SECRET " ,
" @description " : " Example webhook handler "
" error " : " VALIDATION_ERROR " ,
" code " : " VALIDATION_ERROR " ,
" timestamp " : " 2025-01-20T14:30:00.000Z " ,
" message " : " Invalid parameter format "
Error Code Title Description Resolution VALIDATION_ERRORInvalid input Request parameters failed validation Check parameter format and requirements
" timestamp " : " 2025-01-20T14:30:00.000Z " ,
" message " : " Access denied "
Error Code Title Description Resolution FORBIDDENAccess denied Insufficient permissions for this operation Contact administrator for access
" timestamp " : " 2025-01-20T14:30:00.000Z " ,
" message " : " Resource not found "
Error Code Title Description Resolution NOT_FOUNDResource not found The requested resource does not exist Verify the resource identifier
" error " : " Internal server error " ,
" timestamp " : " 2025-01-20T14:30:00.000Z "
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.
Field Type Required Default Description pathstring Yes - Path of the script to update commentsstring No - Comments payload (raw magic-comment block) dry_runboolean No falseWhen true, returns a preview without modifying the file
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 " \
"path": "default/hello-world.ts",
"comments": "@enable-webhooks true\n@webhook-url https://example.com/hook\n",
const result = await client . exec . magic . updateHandler ({
path : ' default/hello-world.ts ' ,
comments : ' @enable-webhooks true \n @webhook-url https://example.com/hook \n ' ,
" path " : " default/hello-world.ts " ,
" @enable-webhooks " : " false "
" @enable-webhooks " : " true " ,
" @webhook-url " : " https://example.com/hook "
" message " : " Magic comments updated successfully "
" error " : " VALIDATION_ERROR " ,
" code " : " VALIDATION_ERROR " ,
" timestamp " : " 2025-01-20T14:30:00.000Z " ,
" message " : " Invalid parameter format "
Error Code Title Description Resolution VALIDATION_ERRORInvalid input Request parameters failed validation Check parameter format and requirements
" timestamp " : " 2025-01-20T14:30:00.000Z " ,
" message " : " Access denied "
Error Code Title Description Resolution FORBIDDENAccess denied Insufficient permissions for this operation Contact administrator for access
" timestamp " : " 2025-01-20T14:30:00.000Z " ,
" message " : " Resource not found "
Error Code Title Description Resolution NOT_FOUNDResource not found The requested resource does not exist Verify the resource identifier
" error " : " Internal server error " ,
" timestamp " : " 2025-01-20T14:30:00.000Z "
Update the magic comments block across every script in a directory. Supports a dry_run preview and recursive traversal.
This endpoint takes no parameters.
Field Type Required Default Description directorystring No - Target directory (relative to SCRIPT_DIR). execIdstring No - Execution scope; resolves under default/{execId}/ unless subdomain is also set. commentsstring No - Raw magic-comment block to apply to each file. extensionstring No ".ts"File extension to consider when scanning. recursiveboolean No trueRecurse into subdirectories. dry_runboolean No falseWhen true, returns a preview without modifying files.
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 " \
"execId": "01HXYZ1234567890ABCDEFGHJ",
"comments": "@enable-webhooks true\n@cors-origins *\n",
const preview = await client . exec . magic . bulkUpdate ({
execId : ' 01HXYZ1234567890ABCDEFGHJ ' ,
comments : ' @enable-webhooks true \n @cors-origins * \n ' ,
" execId " : " 01HXYZ1234567890ABCDEFGHJ " ,
" @enable-webhooks " : " true " ,
" file " : " default/hello-world.ts " ,
" current " : { " @enable-webhooks " : " false " },
" proposed " : { " @enable-webhooks " : " true " , " @cors-origins " : " * " },
" changes " : [ " add @enable-webhooks " , " add @cors-origins " ]
" file " : " default/utils/format.ts " ,
" error " : " Permission denied "
" message " : " Preview only - set dry_run=false to apply changes "
" error " : " VALIDATION_ERROR " ,
" code " : " VALIDATION_ERROR " ,
" timestamp " : " 2025-01-20T14:30:00.000Z " ,
" message " : " Invalid parameter format "
Error Code Title Description Resolution VALIDATION_ERRORInvalid input Request parameters failed validation Check parameter format and requirements
" timestamp " : " 2025-01-20T14:30:00.000Z " ,
" message " : " Access denied "
Error Code Title Description Resolution FORBIDDENAccess denied Insufficient permissions for this operation Contact administrator for access
" timestamp " : " 2025-01-20T14:30:00.000Z " ,
" message " : " Resource not found "
Error Code Title Description Resolution NOT_FOUNDResource not found The requested resource does not exist Verify the resource identifier
" error " : " Internal server error " ,
" timestamp " : " 2025-01-20T14:30:00.000Z "
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.
Name In Type Required Description dirquery string No Dir query parameter filterquery string No Filter query parameter metadataquery string No Metadata query parameter labelquery string No Label query parameter tagsquery string No Tags query parameter modequery string No Mode query parameter enabledquery string No Enabled query parameter websocketquery string No Websocket query parameter recursivequery string No Recursive query parameter include_commentsquery string No Include_comments query parameter execIdquery string No Optional execution scope. When provided, relative paths resolve under default/{execId}/ unless subdomain is also set. Query value takes precedence over body. exec_idquery string No Alias for execId (snake_case). subdomainquery string No Optional subdomain namespace used with execId for path resolution.
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 "
const listing = await client . exec . scripts . list ({
execId : ' 01HXYZ1234567890ABCDEFGHJ '
" name " : " hello-world.ts " ,
" path " : " default/hello-world.ts " ,
" error " : " VALIDATION_ERROR " ,
" code " : " VALIDATION_ERROR " ,
" timestamp " : " 2025-01-20T14:30:00.000Z " ,
" message " : " Invalid parameter format "
Error Code Title Description Resolution VALIDATION_ERRORInvalid input Request parameters failed validation Check parameter format and requirements
" timestamp " : " 2025-01-20T14:30:00.000Z " ,
" message " : " Access denied "
Error Code Title Description Resolution FORBIDDENAccess denied Insufficient permissions for this operation Contact administrator for access
" timestamp " : " 2025-01-20T14:30:00.000Z " ,
" message " : " Resource not found "
Error Code Title Description Resolution NOT_FOUNDResource not found The requested resource does not exist Verify the resource identifier
" error " : " Internal server error " ,
" timestamp " : " 2025-01-20T14:30:00.000Z "
Read a single script file and return its content together with parsed magic comments and filesystem metadata.
Name In Type Required Description pathquery string Yes Path query parameter execIdquery string No Optional execution scope. When provided, relative paths resolve under default/{execId}/ unless subdomain is also set. Query value takes precedence over body. exec_idquery string No Alias for execId (snake_case). subdomainquery string No Optional subdomain namespace used with execId for path resolution.
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 "
const script = await client . exec . scripts . read ({
path : ' default/hello-world.ts '
" path " : " default/hello-world.ts " ,
" resolvedPath " : " /scripts/default/hello-world.ts " ,
" content " : " export default async function handler(req, res) { \n res.json({ ok: true }); \n } \n " ,
" @enable-webhooks " : " true " ,
" @description " : " Example webhook handler "
" created " : " 2025-01-10T08:00:00.000Z " ,
" modified " : " 2025-01-20T14:30:00.000Z " ,
" error " : " VALIDATION_ERROR " ,
" code " : " VALIDATION_ERROR " ,
" timestamp " : " 2025-01-20T14:30:00.000Z " ,
" message " : " Invalid parameter format "
Error Code Title Description Resolution VALIDATION_ERRORInvalid input Request parameters failed validation Check parameter format and requirements
" timestamp " : " 2025-01-20T14:30:00.000Z " ,
" message " : " Access denied "
Error Code Title Description Resolution FORBIDDENAccess denied Insufficient permissions for this operation Contact administrator for access
" timestamp " : " 2025-01-20T14:30:00.000Z " ,
" message " : " Resource not found "
Error Code Title Description Resolution NOT_FOUNDResource not found The requested resource does not exist Verify the resource identifier
" error " : " Internal server error " ,
" timestamp " : " 2025-01-20T14:30:00.000Z "
Create or overwrite a script file. Validates the script content and optionally creates missing parent directories.
Name In Type Required Description execIdquery string No Optional execution scope. When provided, relative paths resolve under default/{execId}/ unless subdomain is also set. Query value takes precedence over body. exec_idquery string No Alias for execId (snake_case). subdomainquery string No Optional subdomain namespace used with execId for path resolution.
Field Type Required Default Description pathstring Yes - Path of the script to write. contentstring Yes - Script source content. createDirsboolean No trueCreate parent directories if they do not exist. validateboolean No trueValidate script content before writing. execIdstring No - Optional execution scope in the request body. Query execId/exec_id takes precedence when both are provided. exec_idstring No - Alias for execId (snake_case). subdomainstring No - Optional subdomain namespace used with execId for path resolution.
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 " \
"path": "default/hello-world.ts",
"content": "export default async function handler(req, res) {\n res.json({ ok: true });\n}\n",
const result = await client . exec . scripts . write ({
path : ' default/hello-world.ts ' ,
content : ' export default async function handler(req, res) { \n res.json({ ok: true }); \n } \n ' ,
" path " : " default/hello-world.ts " ,
" resolvedPath " : " /scripts/default/hello-world.ts " ,
" modified " : " 2025-01-20T14:30:00.000Z " ,
" API_KEY " : { " required " : true , " type " : " string " }
" reason " : " No changes required "
" error " : " VALIDATION_ERROR " ,
" code " : " VALIDATION_ERROR " ,
" timestamp " : " 2025-01-20T14:30:00.000Z " ,
" message " : " Invalid parameter format "
Error Code Title Description Resolution VALIDATION_ERRORInvalid input Request parameters failed validation Check parameter format and requirements
" timestamp " : " 2025-01-20T14:30:00.000Z " ,
" message " : " Access denied "
Error Code Title Description Resolution FORBIDDENAccess denied Insufficient permissions for this operation Contact administrator for access
" error " : " Internal server error " ,
" timestamp " : " 2025-01-20T14:30:00.000Z "
Rename or move a script from one path to another. Returns a conflict if the destination already exists and overwrite is false.
Name In Type Required Description execIdquery string No Optional execution scope. When provided, relative paths resolve under default/{execId}/ unless subdomain is also set. Query value takes precedence over body. exec_idquery string No Alias for execId (snake_case). subdomainquery string No Optional subdomain namespace used with execId for path resolution.
Field Type Required Default Description fromstring Yes - Source path tostring Yes - Destination path overwriteboolean No falseOverwrite the destination if it already exists execIdstring No - Optional execution scope in the request body. Query execId/exec_id takes precedence when both are provided. exec_idstring No - Alias for execId (snake_case). subdomainstring No - Optional subdomain namespace used with execId for path resolution.
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 " \
"from": "old-folder/script.ts",
"to": "new-folder/script.ts",
const result = await client . exec . scripts . move ({
from : ' old-folder/script.ts ' ,
to : ' new-folder/script.ts ' ,
" from " : " old-folder/script.ts " ,
" to " : " new-folder/script.ts " ,
" resolvedFrom " : " /scripts/old-folder/script.ts " ,
" resolvedTo " : " /scripts/new-folder/script.ts " ,
" error " : " VALIDATION_ERROR " ,
" code " : " VALIDATION_ERROR " ,
" timestamp " : " 2025-01-20T14:30:00.000Z " ,
" message " : " Invalid parameter format "
Error Code Title Description Resolution VALIDATION_ERRORInvalid input Request parameters failed validation Check parameter format and requirements
" timestamp " : " 2025-01-20T14:30:00.000Z " ,
" message " : " Access denied "
Error Code Title Description Resolution FORBIDDENAccess denied Insufficient permissions for this operation Contact administrator for access
" timestamp " : " 2025-01-20T14:30:00.000Z " ,
" message " : " Resource not found "
Error Code Title Description Resolution NOT_FOUNDResource not found The requested resource does not exist Verify the resource identifier
" timestamp " : " 2025-01-20T14:30:00.000Z " ,
" message " : " Resource already exists "
Error Code Title Description Resolution CONFLICTResource conflict Operation conflicts with existing resource state Check resource state and retry
" error " : " Internal server error " ,
" timestamp " : " 2025-01-20T14:30:00.000Z "
Return a hierarchical tree view of the script directory, with configurable depth and optional file metadata.
Name In Type Required Description execIdquery string No Optional execution scope. When provided, relative paths resolve under default/{execId}/ unless subdomain is also set. Query value takes precedence over body. exec_idquery string No Alias for execId (snake_case). subdomainquery string No Optional subdomain namespace used with execId for path resolution.
Field Type Required Default Description baseDirstring No ""Root directory for the tree maxDepthinteger No 10Maximum recursion depth includeMetadataboolean No falseInclude per-entry metadata in the tree execIdstring No - Optional execution scope in the request body. Query execId/exec_id takes precedence when both are provided. exec_idstring No - Alias for execId (snake_case). subdomainstring No - Optional subdomain namespace used with execId for path resolution.
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 " \
const tree = await client . exec . scripts . getTree ({
" baseDir " : " /scripts/default " ,
" path " : " /scripts/default/scripts " ,
" name " : " hello-world.ts " ,
" path " : " /scripts/default/scripts/hello-world.ts " ,
" path " : " /scripts/default/scripts/utils " ,
" error " : " VALIDATION_ERROR " ,
" code " : " VALIDATION_ERROR " ,
" timestamp " : " 2025-01-20T14:30:00.000Z " ,
" message " : " Invalid parameter format "
Error Code Title Description Resolution VALIDATION_ERRORInvalid input Request parameters failed validation Check parameter format and requirements
" timestamp " : " 2025-01-20T14:30:00.000Z " ,
" message " : " Access denied "
Error Code Title Description Resolution FORBIDDENAccess denied Insufficient permissions for this operation Contact administrator for access
" timestamp " : " 2025-01-20T14:30:00.000Z " ,
" message " : " Resource not found "
Error Code Title Description Resolution NOT_FOUNDResource not found The requested resource does not exist Verify the resource identifier
" error " : " Internal server error " ,
" timestamp " : " 2025-01-20T14:30:00.000Z "
Delete a script file. Pass confirm=true to bypass safety checks.
Name In Type Required Description pathquery string Yes Path of the script to delete confirmquery string No Confirm query parameter execIdquery string No Optional execution scope. When provided, relative paths resolve under default/{execId}/ unless subdomain is also set. Query value takes precedence over body. exec_idquery string No Alias for execId (snake_case). subdomainquery string No Optional subdomain namespace used with execId for path resolution.
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 "
const result = await client . exec . scripts . delete ({
path : ' default/hello-world.ts ' ,
" path " : " default/hello-world.ts " ,
" resolvedPath " : " /scripts/default/hello-world.ts " ,
" error " : " VALIDATION_ERROR " ,
" code " : " VALIDATION_ERROR " ,
" timestamp " : " 2025-01-20T14:30:00.000Z " ,
" message " : " Invalid parameter format "
Error Code Title Description Resolution VALIDATION_ERRORInvalid input Request parameters failed validation Check parameter format and requirements
" timestamp " : " 2025-01-20T14:30:00.000Z " ,
" message " : " Access denied "
Error Code Title Description Resolution FORBIDDENAccess denied Insufficient permissions for this operation Contact administrator for access
" timestamp " : " 2025-01-20T14:30:00.000Z " ,
" message " : " Resource not found "
Error Code Title Description Resolution NOT_FOUNDResource not found The requested resource does not exist Verify the resource identifier
" error " : " Internal server error " ,
" timestamp " : " 2025-01-20T14:30:00.000Z "