# Dependency Management

**Page:** api/exec/dependencies

[Download Raw Markdown](./api/exec/dependencies.md)

---

{/* AUTO-GENERATED — Do not edit manually. Regenerate with: npm run docs:api:generate */}



## Dependency Management

The Dependency Management API lets you inspect which npm packages ship with the Hoody execution environment, audit a script's `require`/`import` statements against that manifest, and install additional modules on demand. Use these endpoints to bootstrap scripts that rely on third-party libraries or to verify coverage before running untrusted code.

## List Bundled Dependencies

### `GET /api/v1/exec/dependencies/bundled`

Returns the full catalog of npm modules that are pre-installed in the execution environment, along with an aggregate availability flag.

This endpoint takes no parameters.



```bash
curl -X GET "https://api.hoody.com/api/v1/exec/dependencies/bundled" \
  -H "Authorization: Bearer <token>"
```


```ts
const result = await client.exec.dependencies.listBundled();
```


```json
{
  "total": 42,
  "packages": ["lodash", "axios", "dayjs", "uuid"],
  "allAvailable": true
}
```


```json
{
  "error": "VALIDATION_ERROR",
  "code": "VALIDATION_ERROR",
  "timestamp": "2025-01-15T12:00:00.000Z"
}
```

| Error Code | Title | Description | Resolution |
|------------|-------|-------------|------------|
| `VALIDATION_ERROR` | Invalid input | Request parameters failed validation | Check parameter format and requirements |


```json
{
  "error": "Internal server error",
  "code": "ERROR_500",
  "timestamp": "2025-01-15T12:00:00.000Z"
}
```



## Check Dependencies

### `POST /api/v1/exec/dependencies/check`

Parses the supplied source code (or an explicit list of module specifiers) and reports which referenced modules are already bundled and which are missing. No modules are installed.

This endpoint takes no path, query, or header parameters.

### Request Body

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `code` | string | No | Source code to scan for `require`/`import` references |
| `modules` | string | No | Explicit module specifier or comma-separated list to check |



```bash
curl -X POST "https://api.hoody.com/api/v1/exec/dependencies/check" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "code": "const axios = require(\"axios\");\nconst _ = require(\"lodash\");"
  }'
```


```ts
const result = await client.exec.dependencies.check({
  code: "const axios = require(\"axios\");\nconst _ = require(\"lodash\");"
});
```


```json
{
  "total": 2,
  "installed": ["axios"],
  "missing": ["lodash"],
  "message": "1 module(s) missing"
}
```


```json
{
  "error": "VALIDATION_ERROR",
  "code": "VALIDATION_ERROR",
  "timestamp": "2025-01-15T12:00:00.000Z"
}
```

| Error Code | Title | Description | Resolution |
|------------|-------|-------------|------------|
| `VALIDATION_ERROR` | Invalid input | Request parameters failed validation | Check parameter format and requirements |


```json
{
  "error": "Internal server error",
  "code": "ERROR_500",
  "timestamp": "2025-01-15T12:00:00.000Z"
}
```




  The 200 response is polymorphic. When the request was inferred from `code`, the response includes a human-readable `message` field. When the request was an explicit list of `modules`, the response includes a `details` array with per-module information.


## Install Dependencies

### `POST /api/v1/exec/dependencies/install`

Installs one or more npm modules into the execution environment. Modules that are already present are reported as such unless `force` is set to `true`.

This endpoint takes no path, query, or header parameters.

### Request Body

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `modules` | string \| string[] | 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`. |



```bash
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.0"],
    "force": false
  }'
```


```ts
const result = await client.exec.dependencies.install({
  modules: ["lodash", "axios@1.6.0"],
  force: false
});
```


```json
{
  "total": 2,
  "installed": 2,
  "failed": 0,
  "installedModules": ["lodash", "axios@1.6.0"],
  "failedModules": [],
  "details": [
    { "module": "lodash", "status": "installed", "version": "4.17.21" },
    { "module": "axios@1.6.0", "status": "installed", "version": "1.6.0" }
  ]
}
```


```json
{
  "error": "VALIDATION_ERROR",
  "code": "VALIDATION_ERROR",
  "timestamp": "2025-01-15T12:00:00.000Z"
}
```

| Error Code | Title | Description | Resolution |
|------------|-------|-------------|------------|
| `VALIDATION_ERROR` | Invalid input | Request parameters failed validation | Check parameter format and requirements |


```json
{
  "error": "Internal server error",
  "code": "ERROR_500",
  "timestamp": "2025-01-15T12:00:00.000Z"
}
```




  Installed modules persist for the lifetime of the execution environment. If a module is already present and `force` is `false`, it is included in `installedModules` with a status of `already-installed` and is not reinstalled.