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.
curl -X GET " https://{projectId}-{containerId}-exec-1.{server}.containers.hoody.com/api/v1/exec/list " \
-H " Authorization: Bearer $HOODY_TOKEN "
import { HoodyClient } from ' hoody-sdk ' ;
const client = new HoodyClient ({ baseURL : ' https://{projectId}-{containerId}-exec-1.{server}.containers.hoody.com ' , token : process . env . HOODY_TOKEN });
await client . exec . ids . list ();
" source_url " : " https://github.com/hoody/sdk-scripts " ,
" error " : " Invalid parameter format " ,
" code " : " VALIDATION_ERROR " ,
" timestamp " : " 2025-01-15T10:30:00.000Z "
Error Code Title Description Resolution VALIDATION_ERRORInvalid input Request parameters failed validation Check parameter format and requirements
" error " : " Internal server error " ,
" timestamp " : " 2025-01-15T10:30:00.000Z "
Parse and return the magic comments declared at the top of a script.
Name In Type Required Description pathquery string Yes Path query parameter
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 "
import { HoodyClient } from ' hoody-sdk ' ;
const client = new HoodyClient ({ baseURL : ' https://{projectId}-{containerId}-exec-1.{server}.containers.hoody.com ' , token : process . env . HOODY_TOKEN });
await client . exec . magic . read ({ path : ' deploy.ts ' });
" path " : " default/1/deploy.ts " ,
" error " : " Invalid parameter format " ,
" code " : " VALIDATION_ERROR " ,
" timestamp " : " 2025-01-15T10:30:00.000Z "
Error Code Title Description Resolution VALIDATION_ERRORInvalid input Request parameters failed validation Check parameter format and requirements
" error " : " Access denied " ,
" timestamp " : " 2025-01-15T10:30:00.000Z "
Error Code Title Description Resolution FORBIDDENAccess denied Insufficient permissions for this operation Contact administrator for access
" error " : " Resource not found " ,
" timestamp " : " 2025-01-15T10:30:00.000Z "
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-15T10:30:00.000Z "
Return the schema document that describes every magic-comment key, its directive, allowed values, and defaults.
This endpoint takes no parameters.
curl -X GET " https://{projectId}-{containerId}-exec-1.{server}.containers.hoody.com/api/v1/exec/magic-comments/schema " \
-H " Authorization: Bearer $HOODY_TOKEN "
import { HoodyClient } from ' hoody-sdk ' ;
const client = new HoodyClient ({ baseURL : ' https://{projectId}-{containerId}-exec-1.{server}.containers.hoody.com ' , token : process . env . HOODY_TOKEN });
await client . exec . magic . getSchema ();
" schema_version " : " 1.0.0 " ,
" parse_window_lines " : 50 ,
" unknown_keys_behavior " : " ignore " ,
" when_omitted " : " fall back to runtime default " ,
" runtime " : " config/hoody-exec.runtime.json " ,
" sdk_import " : " config/hoody-exec.sdk-defaults.json "
" interface " : " exec_MagicCommentInterface " ,
" parser " : " exec_MagicCommentParser " ,
" runtime_defaults " : " exec_MagicCommentRuntimeDefaults " ,
" sdk_import_defaults " : " exec_MagicCommentSdkDefaults "
" execution " : [ " mode " , " timeout " , " schedule " ],
" cors " : [ " origins " , " methods " ],
" ai " : [ " model " , " prompt " ],
" metadata " : [ " author " , " version " ]
" error " : " Invalid parameter format " ,
" code " : " VALIDATION_ERROR " ,
" timestamp " : " 2025-01-15T10:30:00.000Z "
Error Code Title Description Resolution VALIDATION_ERRORInvalid input Request parameters failed validation Check parameter format and requirements
" error " : " Internal server error " ,
" timestamp " : " 2025-01-15T10:30:00.000Z "
Apply the same magic-comment block to every script in a directory (or preview the changes with dry_run: true).
Field Type Required Default Description directorystring No - Directory execIdstring No - Exec Id commentsstring No - Comments extensionstring No ".ts"Extension recursiveboolean No trueRecursive dry_runboolean No falseDry_run
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 " \
"directory": "default/1",
"comments": "/* @mode on_demand\n @timeout 30000 */",
import { HoodyClient } from ' hoody-sdk ' ;
const client = new HoodyClient ({ baseURL : ' https://{projectId}-{containerId}-exec-1.{server}.containers.hoody.com ' , token : process . env . HOODY_TOKEN });
await client . exec . magic . bulkUpdate ({
comments : ' /* @mode on_demand \n @timeout 30000 */ ' ,
" directory " : " default/1 " ,
" updated " : [ " default/1/deploy.ts " , " default/1/jobs/cleanup.ts " ],
" message " : " Magic comments updated successfully "
" error " : " Invalid parameter format " ,
" code " : " VALIDATION_ERROR " ,
" timestamp " : " 2025-01-15T10:30:00.000Z "
Error Code Title Description Resolution VALIDATION_ERRORInvalid input Request parameters failed validation Check parameter format and requirements
" error " : " Access denied " ,
" timestamp " : " 2025-01-15T10:30:00.000Z "
Error Code Title Description Resolution FORBIDDENAccess denied Insufficient permissions for this operation Contact administrator for access
" error " : " Resource not found " ,
" timestamp " : " 2025-01-15T10:30:00.000Z "
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-15T10:30:00.000Z "
Update the magic comments on a single script (or preview the diff with dry_run: true).
Field Type Required Default Description pathstring Yes - Path commentsstring No - Comments dry_runboolean No falseDry_run
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 " \
"comments": "/* @mode scheduled\n @timeout 60000\n @cors true */",
import { HoodyClient } from ' hoody-sdk ' ;
const client = new HoodyClient ({ baseURL : ' https://{projectId}-{containerId}-exec-1.{server}.containers.hoody.com ' , token : process . env . HOODY_TOKEN });
await client . exec . magic . updateHandler ({
comments : ' /* @mode scheduled \n @timeout 60000 \n @cors true */ ' ,
" message " : " Magic comments updated successfully "
" error " : " Invalid parameter format " ,
" code " : " VALIDATION_ERROR " ,
" timestamp " : " 2025-01-15T10:30:00.000Z "
Error Code Title Description Resolution VALIDATION_ERRORInvalid input Request parameters failed validation Check parameter format and requirements
" error " : " Access denied " ,
" timestamp " : " 2025-01-15T10:30:00.000Z "
Error Code Title Description Resolution FORBIDDENAccess denied Insufficient permissions for this operation Contact administrator for access
" error " : " Resource not found " ,
" timestamp " : " 2025-01-15T10:30:00.000Z "
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-15T10:30:00.000Z "
List the scripts in a directory with optional filtering by label, tags, mode, enabled state, and websocket binding.
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://{projectId}-{containerId}-exec-1.{server}.containers.hoody.com/api/v1/exec/scripts/list?recursive=false " \
-H " Authorization: Bearer $HOODY_TOKEN "
import { HoodyClient } from ' hoody-sdk ' ;
const client = new HoodyClient ({ baseURL : ' https://{projectId}-{containerId}-exec-1.{server}.containers.hoody.com ' , token : process . env . HOODY_TOKEN });
await client . exec . scripts . list ({ recursive : ' false ' });
" directory " : " default/1 " ,
" path " : " default/1/deploy.ts " ,
" path " : " default/1/jobs " ,
" path " : " default/1/cleanup.ts " ,
" error " : " Invalid parameter format " ,
" code " : " VALIDATION_ERROR " ,
" timestamp " : " 2025-01-15T10:30:00.000Z "
Error Code Title Description Resolution VALIDATION_ERRORInvalid input Request parameters failed validation Check parameter format and requirements
" error " : " Access denied " ,
" timestamp " : " 2025-01-15T10:30:00.000Z "
Error Code Title Description Resolution FORBIDDENAccess denied Insufficient permissions for this operation Contact administrator for access
" error " : " Resource not found " ,
" timestamp " : " 2025-01-15T10:30:00.000Z "
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-15T10:30:00.000Z "
Read the contents of a single script along with its parsed magic comments and file 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://{projectId}-{containerId}-exec-1.{server}.containers.hoody.com/api/v1/exec/scripts/read?path=deploy.ts " \
-H " Authorization: Bearer $HOODY_TOKEN "
import { HoodyClient } from ' hoody-sdk ' ;
const client = new HoodyClient ({ baseURL : ' https://{projectId}-{containerId}-exec-1.{server}.containers.hoody.com ' , token : process . env . HOODY_TOKEN });
await client . exec . scripts . read ({ path : ' deploy.ts ' });
" resolvedPath " : " default/1/deploy.ts " ,
" content " : " // @mode on_demand \n // @timeout 30000 \n export default async function main() { \n console.log( \" deploying... \" ); \n } \n " ,
" created " : " 2025-01-10T08:00:00.000Z " ,
" modified " : " 2025-01-15T10:30:00.000Z " ,
" error " : " Invalid parameter format " ,
" code " : " VALIDATION_ERROR " ,
" timestamp " : " 2025-01-15T10:30:00.000Z "
Error Code Title Description Resolution VALIDATION_ERRORInvalid input Request parameters failed validation Check parameter format and requirements
" error " : " Access denied " ,
" timestamp " : " 2025-01-15T10:30:00.000Z "
Error Code Title Description Resolution FORBIDDENAccess denied Insufficient permissions for this operation Contact administrator for access
" error " : " Resource not found " ,
" timestamp " : " 2025-01-15T10:30:00.000Z "
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-15T10:30:00.000Z "
Create or update a script. By default, missing parent directories are created and the script is validated before it is persisted.
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 contentstring Yes - Content createDirsboolean No trueCreate Dirs validateboolean No trueValidate execIdstring No - Optional execution scope in 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://{projectId}-{containerId}-exec-1.{server}.containers.hoody.com/api/v1/exec/scripts/write " \
-H " Authorization: Bearer $HOODY_TOKEN " \
-H " Content-Type: application/json " \
"path": "jobs/cleanup.ts",
"content": "// @mode on_demand\nexport default async function main() {\n console.log(\"cleaning up...\");\n}\n",
import { HoodyClient } from ' hoody-sdk ' ;
const client = new HoodyClient ({ baseURL : ' https://{projectId}-{containerId}-exec-1.{server}.containers.hoody.com ' , token : process . env . HOODY_TOKEN });
await client . exec . scripts . write ({
content : ' // @mode on_demand \n export default async function main() { \n console.log("cleaning up..."); \n } \n ' ,
" path " : " jobs/cleanup.ts " ,
" resolvedPath " : " default/1/jobs/cleanup.ts " ,
" modified " : " 2025-01-15T10:30:00.000Z " ,
" reason " : " First write to this path "
" error " : " Invalid parameter format " ,
" code " : " VALIDATION_ERROR " ,
" timestamp " : " 2025-01-15T10:30:00.000Z "
Error Code Title Description Resolution VALIDATION_ERRORInvalid input Request parameters failed validation Check parameter format and requirements
" error " : " Access denied " ,
" timestamp " : " 2025-01-15T10:30:00.000Z "
Error Code Title Description Resolution FORBIDDENAccess denied Insufficient permissions for this operation Contact administrator for access
" error " : " Internal server error " ,
" timestamp " : " 2025-01-15T10:30:00.000Z "
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.
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 - From tostring Yes - To overwriteboolean No falseOverwrite execIdstring No - Optional execution scope in 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://{projectId}-{containerId}-exec-1.{server}.containers.hoody.com/api/v1/exec/scripts/move " \
-H " Authorization: Bearer $HOODY_TOKEN " \
-H " Content-Type: application/json " \
import { HoodyClient } from ' hoody-sdk ' ;
const client = new HoodyClient ({ baseURL : ' https://{projectId}-{containerId}-exec-1.{server}.containers.hoody.com ' , token : process . env . HOODY_TOKEN });
await client . exec . scripts . move ({
" resolvedFrom " : " default/1/deploy.ts " ,
" resolvedTo " : " default/1/jobs/deploy.ts " ,
" error " : " Invalid parameter format " ,
" code " : " VALIDATION_ERROR " ,
" timestamp " : " 2025-01-15T10:30:00.000Z "
Error Code Title Description Resolution VALIDATION_ERRORInvalid input Request parameters failed validation Check parameter format and requirements
" error " : " Access denied " ,
" timestamp " : " 2025-01-15T10:30:00.000Z "
Error Code Title Description Resolution FORBIDDENAccess denied Insufficient permissions for this operation Contact administrator for access
" error " : " Resource not found " ,
" timestamp " : " 2025-01-15T10:30:00.000Z "
Error Code Title Description Resolution NOT_FOUNDResource not found The requested resource does not exist Verify the resource identifier
" error " : " Resource already exists " ,
" timestamp " : " 2025-01-15T10:30:00.000Z "
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-15T10:30:00.000Z "
Walk a directory and return a nested tree of scripts and subdirectories, capped at maxDepth.
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 ""Base Dir maxDepthinteger No 10Max Depth includeMetadataboolean No falseInclude Metadata execIdstring No - Optional execution scope in 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://{projectId}-{containerId}-exec-1.{server}.containers.hoody.com/api/v1/exec/scripts/tree " \
-H " Authorization: Bearer $HOODY_TOKEN " \
-H " Content-Type: application/json " \
import { HoodyClient } from ' hoody-sdk ' ;
const client = new HoodyClient ({ baseURL : ' https://{projectId}-{containerId}-exec-1.{server}.containers.hoody.com ' , token : process . env . HOODY_TOKEN });
await client . exec . scripts . getTree ({
" path " : " default/1/deploy.ts " ,
" path " : " default/1/jobs " ,
" path " : " default/1/jobs/cleanup.ts " ,
" error " : " Invalid parameter format " ,
" code " : " VALIDATION_ERROR " ,
" timestamp " : " 2025-01-15T10:30:00.000Z "
Error Code Title Description Resolution VALIDATION_ERRORInvalid input Request parameters failed validation Check parameter format and requirements
" error " : " Access denied " ,
" timestamp " : " 2025-01-15T10:30:00.000Z "
Error Code Title Description Resolution FORBIDDENAccess denied Insufficient permissions for this operation Contact administrator for access
" error " : " Resource not found " ,
" timestamp " : " 2025-01-15T10:30:00.000Z "
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-15T10:30:00.000Z "
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.
Name In Type Required Description pathquery string Yes Path query parameter 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://{projectId}-{containerId}-exec-1.{server}.containers.hoody.com/api/v1/exec/scripts/delete?path=deploy.ts " \
-H " Authorization: Bearer $HOODY_TOKEN "
import { HoodyClient } from ' hoody-sdk ' ;
const client = new HoodyClient ({ baseURL : ' https://{projectId}-{containerId}-exec-1.{server}.containers.hoody.com ' , token : process . env . HOODY_TOKEN });
await client . exec . scripts . delete ({ path : ' deploy.ts ' });
" resolvedPath " : " default/1/deploy.ts " ,
" error " : " Invalid parameter format " ,
" code " : " VALIDATION_ERROR " ,
" timestamp " : " 2025-01-15T10:30:00.000Z "
Error Code Title Description Resolution VALIDATION_ERRORInvalid input Request parameters failed validation Check parameter format and requirements
" error " : " Access denied " ,
" timestamp " : " 2025-01-15T10:30:00.000Z "
Error Code Title Description Resolution FORBIDDENAccess denied Insufficient permissions for this operation Contact administrator for access
" error " : " Resource not found " ,
" timestamp " : " 2025-01-15T10:30:00.000Z "
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-15T10:30:00.000Z "