The Script Templates API exposes the container’s template engine: list available templates (built-in and custom), preview a template with variable substitution, generate executable code from a template, and create, update, or delete custom user-supplied templates stored in _hoody/templates/. Use these endpoints when integrating template-driven automation or building tooling that needs to inspect or extend the available script scaffolds.
Returns the set of available templates. Built-in and custom templates are both included by default; pass query parameters to narrow the result set by category or to exclude either source.
Name In Type Required Description categoryquery string No Filter templates to a single metadata category (e.g. api, utility). Omit to list all categories. includeBuiltinquery boolean No Include built-in templates in the result set. Default true. Accepts true/false/1/0. includeCustomquery boolean No Include user-supplied templates (from _hoody/templates/) in the result set. Default true.
curl -X GET " https://{projectId}-{containerId}-exec-1.{server}.containers.hoody.icu/api/v1/exec/templates/list?includeBuiltin=true&includeCustom=true "
await client . exec . templates . list ({ includeBuiltin : true , includeCustom : true })
" description " : " Fetch a JSON resource via curl and jq. " ,
" tags " : [ " http " , " curl " ],
" params " : [ " url " , " method " ],
" description " : " Apply SQL migrations against a Postgres database. " ,
" tags " : [ " postgres " , " sql " ],
" error " : " VALIDATION_ERROR " ,
" code " : " VALIDATION_ERROR " ,
" timestamp " : " 2026-01-15T12:34:56.789Z " ,
" parameter " : " includeBuiltin "
Error Code Title Description Resolution VALIDATION_ERRORInvalid input Request parameters failed validation Check parameter format and requirements
" error " : " Internal server error " ,
" timestamp " : " 2026-01-15T12:34:56.789Z "
Renders a template with optional variable substitution and returns both the substituted and original source. Useful for previewing what a generated script will look like before invoking the generate endpoint.
Name In Type Required Description namequery string Yes Name of the template to preview. variablesquery string No JSON-encoded object of variables to substitute into the template body.
curl -X GET " https://{projectId}-{containerId}-exec-1.{server}.containers.hoody.icu/api/v1/exec/templates/preview?name=api-fetch&variables=%7B%22url%22%3A%22https%3A%2F%2Fapi.example.com%22%7D "
await client . exec . templates . preview ({ name : ' api-fetch ' , variables : ' {"url":"https://api.example.com"} ' })
" description " : " Fetch a JSON resource via curl and jq. " ,
" tags " : [ " http " , " curl " ],
" params " : [ " url " , " method " ],
" code " : " curl -sS -X GET https://api.example.com | jq . " ,
" originalCode " : " curl -sS -X {{method}} {{url}} | jq . " ,
" error " : " VALIDATION_ERROR " ,
" code " : " VALIDATION_ERROR " ,
" timestamp " : " 2026-01-15T12:34:56.789Z "
Error Code Title Description Resolution VALIDATION_ERRORInvalid input Request parameters failed validation Check parameter format and requirements
" error " : " Template not found " ,
" timestamp " : " 2026-01-15T12:34:56.789Z "
Error Code Title Description Resolution NOT_FOUNDResource not found The requested resource does not exist Verify the resource identifier
" error " : " Internal server error " ,
" timestamp " : " 2026-01-15T12:34:56.789Z "
Creates a new custom template in the container’s _hoody/templates/ directory. The endpoint returns the persisted metadata so the caller can confirm what was written.
This endpoint accepts a JSON request payload. The body schema is intentionally open-ended by the server and does not define specific fields.
curl -X POST " https://{projectId}-{containerId}-exec-1.{server}.containers.hoody.icu/api/v1/exec/templates/create-custom " \
-H " Content-Type: application/json " \
await client . exec . templates . createCustom ({})
" path " : " _hoody/templates/log-rotator " ,
" tags " : [ " logs " , " cleanup " ],
" description " : " Delete log files older than N days. " ,
" params " : [ " logDir " , " days " ],
" error " : " VALIDATION_ERROR " ,
" code " : " VALIDATION_ERROR " ,
" timestamp " : " 2026-01-15T12:34:56.789Z "
Error Code Title Description Resolution VALIDATION_ERRORInvalid input Request parameters failed validation Check parameter format and requirements
" error " : " Access denied " ,
" timestamp " : " 2026-01-15T12:34:56.789Z "
Error Code Title Description Resolution FORBIDDENAccess denied Insufficient permissions for this operation Contact administrator for access
" error " : " Template already exists " ,
" timestamp " : " 2026-01-15T12:34:56.789Z "
Error Code Title Description Resolution CONFLICTResource conflict Operation conflicts with existing resource state Check resource state and retry
" error " : " Internal server error " ,
" timestamp " : " 2026-01-15T12:34:56.789Z "
Generates executable code from a named template by substituting the supplied variables. Optionally writes the result to disk if saveFile is true.
Name Type Required Description namestring Yes Name of the template to generate. variablesobject No Variable values to substitute into the template. outputPathstring No Filesystem path to write the generated code to when saveFile is true. saveFileboolean No When true, persists the generated code to outputPath. Default false.
curl -X POST " https://{projectId}-{containerId}-exec-1.{server}.containers.hoody.icu/api/v1/exec/templates/generate " \
-H " Content-Type: application/json " \
"url": "https://api.example.com/users",
"outputPath": "/tmp/fetch.sh",
await client . exec . templates . generate ({
url : ' https://api.example.com/users ' ,
outputPath : ' /tmp/fetch.sh ' ,
" code " : " curl -sS -X GET https://api.example.com/users | jq . " ,
" url " : " https://api.example.com/users " ,
" error " : " VALIDATION_ERROR " ,
" code " : " VALIDATION_ERROR " ,
" timestamp " : " 2026-01-15T12:34:56.789Z "
Error Code Title Description Resolution VALIDATION_ERRORInvalid input Request parameters failed validation Check parameter format and requirements
" error " : " Access denied " ,
" timestamp " : " 2026-01-15T12:34:56.789Z "
Error Code Title Description Resolution FORBIDDENAccess denied Insufficient permissions for this operation Contact administrator for access
" error " : " Template not found " ,
" timestamp " : " 2026-01-15T12:34:56.789Z "
Error Code Title Description Resolution NOT_FOUNDResource not found The requested resource does not exist Verify the resource identifier
" error " : " Internal server error " ,
" timestamp " : " 2026-01-15T12:34:56.789Z "
Updates an existing custom template. The supplied metadata object is merged with the existing metadata; supply code to replace the template source.
Name In Type Required Description namepath string Yes Name of the custom template to update.
Name Type Required Description codestring No New template source. Omit to leave unchanged. metadataobject No Metadata fields to merge into the existing template metadata.
curl -X PUT " https://{projectId}-{containerId}-exec-1.{server}.containers.hoody.icu/api/v1/exec/templates/update-custom/log-rotator " \
-H " Content-Type: application/json " \
"code": "find {{logDir}} -name \"*.log\" -mtime +{{days}} -exec rm {} \\;",
"description": "Delete log files older than N days (safe rm)."
await client . exec . templates . updateCustom ( ' log-rotator ' , {
code : ' find {{logDir}} -name "*.log" -mtime +{{days}} -exec rm {} \\ ; ' ,
description : ' Delete log files older than N days (safe rm). '
" tags " : [ " logs " , " cleanup " ],
" description " : " Delete log files older than N days (safe rm). " ,
" params " : [ " logDir " , " days " ],
" error " : " VALIDATION_ERROR " ,
" code " : " VALIDATION_ERROR " ,
" timestamp " : " 2026-01-15T12:34:56.789Z "
Error Code Title Description Resolution VALIDATION_ERRORInvalid input Request parameters failed validation Check parameter format and requirements
" error " : " Template not found " ,
" timestamp " : " 2026-01-15T12:34:56.789Z "
Error Code Title Description Resolution NOT_FOUNDResource not found The requested resource does not exist Verify the resource identifier
" error " : " Internal server error " ,
" timestamp " : " 2026-01-15T12:34:56.789Z "
Removes a custom template from _hoody/templates/. Built-in templates cannot be deleted through this endpoint.
Name In Type Required Description namepath string Yes Name of the custom template to delete.
curl -X DELETE " https://{projectId}-{containerId}-exec-1.{server}.containers.hoody.icu/api/v1/exec/templates/delete-custom/log-rotator "
await client . exec . templates . deleteCustom ( ' log-rotator ' )
" error " : " VALIDATION_ERROR " ,
" code " : " VALIDATION_ERROR " ,
" timestamp " : " 2026-01-15T12:34:56.789Z "
Error Code Title Description Resolution VALIDATION_ERRORInvalid input Request parameters failed validation Check parameter format and requirements
" error " : " Template not found " ,
" timestamp " : " 2026-01-15T12:34:56.789Z "
Error Code Title Description Resolution NOT_FOUNDResource not found The requested resource does not exist Verify the resource identifier
" error " : " Internal server error " ,
" timestamp " : " 2026-01-15T12:34:56.789Z "