Overview
Section titled “Overview”The Dependency Management endpoints let scripts inspect the packages that ship with the Hoody runtime, verify whether all required modules are available for a given script, and install missing npm packages on demand. Use these endpoints when a script needs to pre-flight its environment before execution or when the user wants to add libraries beyond the bundled set.
List Bundled Dependencies
Section titled “List Bundled Dependencies”GET /api/v1/exec/dependencies/bundled
Section titled “GET /api/v1/exec/dependencies/bundled”Returns the list of npm packages that ship with the Hoody runtime. Each entry reports whether the package is available so callers can decide whether to install additional modules or warn the user before execution.
This endpoint takes no parameters.
curl -X GET https://api.hoody.com/api/v1/exec/dependencies/bundled \ -H "Authorization: Bearer <token>"const result = await client.exec.dependencies.listBundled();{ "total": 42, "packages": [ { "name": "lodash", "version": "4.17.21", "available": true }, { "name": "axios", "version": "1.6.2", "available": true }, { "name": "dayjs", "version": "1.11.10", "available": true } ], "allAvailable": true}{ "error": "VALIDATION_ERROR", "code": "VALIDATION_ERROR", "timestamp": "2026-01-15T10:30:00Z", "details": {}}| Error Code | Title | Description | Resolution |
|---|---|---|---|
VALIDATION_ERROR | Invalid input | Request parameters failed validation | Check parameter format and requirements |
{ "error": "Internal server error", "code": "ERROR_500", "timestamp": "2026-01-15T10:30:00Z", "details": {}}Check Dependencies
Section titled “Check Dependencies”POST /api/v1/exec/dependencies/check
Section titled “POST /api/v1/exec/dependencies/check”Inspects a script’s source code or a comma-separated list of module names and reports which packages are already installed and which are missing. The response indicates whether additional installations are required before the script can run safely.
Request Body
Section titled “Request Body”| Name | Type | Required | Description |
|---|---|---|---|
code | string | No | Script source code to scan for require and import statements |
modules | string | No | Comma-separated list of module names to check (e.g. "lodash,axios,dayjs") |
curl -X POST https://api.hoody.com/api/v1/exec/dependencies/check \ -H "Authorization: Bearer <token>" \ -H "Content-Type: application/json" \ -d '{ "code": "const _ = require(\"lodash\");\nconst axios = require(\"axios\");", "modules": "lodash,axios,dayjs" }'const result = await client.exec.dependencies.check({ code: "const _ = require('lodash');\nconst axios = require('axios');", modules: "lodash,axios,dayjs"});{ "total": 3, "installed": ["lodash", "axios"], "missing": ["dayjs"], "message": "1 module(s) missing"}{ "error": "VALIDATION_ERROR", "code": "VALIDATION_ERROR", "timestamp": "2026-01-15T10:30:00Z", "details": {}}| Error Code | Title | Description | Resolution |
|---|---|---|---|
VALIDATION_ERROR | Invalid input | Request parameters failed validation | Check parameter format and requirements |
{ "error": "Internal server error", "code": "ERROR_500", "timestamp": "2026-01-15T10:30:00Z", "details": {}}Install Dependencies
Section titled “Install Dependencies”POST /api/v1/exec/dependencies/install
Section titled “POST /api/v1/exec/dependencies/install”Installs one or more npm modules into the script runtime. Pass a single spec ("lodash" or "axios@1.6.2") or an array of specs to install several packages in sequence. Use the force flag to reinstall modules that are already present instead of having them reported as already-installed.
Request Body
Section titled “Request Body”| Name | Type | Required | Description |
|---|---|---|---|
modules | string | array | Yes | One npm module spec (e.g. "lodash", "axios@1.2.3") or an array of specs. Array form installs every module in sequence. |
force | boolean | No | When true, reinstall modules that are already present instead of reporting them as already-installed. Default: false. |
curl -X POST https://api.hoody.com/api/v1/exec/dependencies/install \ -H "Authorization: Bearer <token>" \ -H "Content-Type: application/json" \ -d '{ "modules": ["lodash", "axios@1.6.2", "dayjs"], "force": false }'const result = await client.exec.dependencies.install({ modules: ["lodash", "axios@1.6.2", "dayjs"], force: false});{ "total": 3, "installed": 2, "failed": 1, "installedModules": ["lodash", "axios@1.6.2"], "failedModules": ["dayjs"], "details": [ { "module": "lodash", "status": "installed", "version": "4.17.21" }, { "module": "axios@1.6.2", "status": "installed", "version": "1.6.2" }, { "module": "dayjs", "status": "failed", "error": "Package not found in registry" } ]}{ "error": "VALIDATION_ERROR", "code": "VALIDATION_ERROR", "timestamp": "2026-01-15T10:30:00Z", "details": {}}| Error Code | Title | Description | Resolution |
|---|---|---|---|
VALIDATION_ERROR | Invalid input | Request parameters failed validation | Check parameter format and requirements |
{ "error": "Internal server error", "code": "ERROR_500", "timestamp": "2026-01-15T10:30:00Z", "details": {}}