> ## Documentation Index
> Fetch the complete documentation index at: https://docs.corsair.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# E2B API reference

> API reference for the E2B plugin in Corsair: every `e2b.api.*` operation with its input and output types, taken from the plugin's Zod schemas.

> [!NOTE]
>
> **New to Corsair?** See [API access](https://docs.corsair.dev/concepts/api.md), [authentication](https://docs.corsair.dev/concepts/auth.md), and [error handling](https://docs.corsair.dev/concepts/error-handling).

## Envd

### getEnvironmentVariables

`envd.getEnvironmentVariables`

Environment variables

**Risk:** `read`

```ts theme={null}
await corsair.e2b.api.envd.getEnvironmentVariables({"headers":{"e2bSandboxId":"test","e2bSandboxPort":49983,"e2bAccessToken":"test-sandbox-access-token"}});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `headers` | `object` | Yes | — |

Requires an E2B sandbox access token; the response contains environment values and should be handled as sensitive data.

> [accordion] headers full type
>
> ```ts theme={null}
> {
>   e2bSandboxId: string,
>   e2bSandboxPort: number,
>   e2bAccessToken: string
> }
> ```

**Output:** *empty object*

***

### health

`envd.health`

Check the health of the service

**Risk:** `read`

```ts theme={null}
await corsair.e2b.api.envd.health({"headers":{"e2bSandboxId":"test","e2bSandboxPort":49983}});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `headers` | `object` | Yes | — |

> [accordion] headers full type
>
> ```ts theme={null}
> {
>   e2bSandboxId: string,
>   e2bSandboxPort: number
> }
> ```

**Output:** `void`

***

### metrics

`envd.metrics`

Service stats

**Risk:** `read`

```ts theme={null}
await corsair.e2b.api.envd.metrics({"headers":{"e2bSandboxId":"test","e2bSandboxPort":49983,"e2bAccessToken":"test-sandbox-access-token"}});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `headers` | `object` | Yes | — |

> [accordion] headers full type
>
> ```ts theme={null}
> {
>   e2bSandboxId: string,
>   e2bSandboxPort: number,
>   e2bAccessToken: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ts` | `number` | No | — |
| `cpu_count` | `number` | No | — |
| `cpu_possible` | `number` | No | — |
| `cpu_target` | `number` | No | — |
| `cpu_target_attempts` | `number` | No | — |
| `cpu_write_pending_ms` | `number` | No | — |
| `cpu_used_pct` | `number` | No | — |
| `mem_total` | `number` | No | — |
| `mem_used` | `number` | No | — |
| `mem_cache` | `number` | No | — |
| `disk_used` | `number` | No | — |
| `disk_total` | `number` | No | — |
| `oom_kills` | `object[]` | No | — |
| `mem_used_mib` | `number` | No | — |
| `mem_total_mib` | `number` | No | — |

> [accordion] oom\_kills full type
>
> ```ts theme={null}
> {
>   seq: number,
>   process: string
> }[]
> ```

***

## Events

### list

`events.list`

List events

**Risk:** `read`

```ts theme={null}
await corsair.e2b.api.events.list({"query":{"offset":0,"limit":10,"orderAsc":false,"types":["test"]}});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `query` | `object` | No | — |

> [accordion] query full type
>
> ```ts theme={null}
> {
>   offset?: number,
>   limit?: number,
>   orderAsc?: boolean,
>   types?: string[]
> }
> ```

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   id: string,
>   version: string,
>   type: string,
>   eventCategory?: string,
>   eventLabel?: string,
>   eventData?: {
>   } | null,
>   timestamp: string,
>   sandboxId: string,
>   sandboxExecutionId: string,
>   sandboxTemplateId: string,
>   sandboxBuildId: string,
>   sandboxTeamId: string
> }[]
> ```

***

### listBySandbox

`events.listBySandbox`

List sandbox events

**Risk:** `read`

```ts theme={null}
await corsair.e2b.api.events.listBySandbox({"path":{"sandboxID":"test"},"query":{"offset":0,"limit":10,"orderAsc":false,"types":["test"]}});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `path` | `object` | Yes | — |
| `query` | `object` | No | — |

> [accordion] path full type
>
> ```ts theme={null}
> {
>   sandboxID: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   offset?: number,
>   limit?: number,
>   orderAsc?: boolean,
>   types?: string[]
> }
> ```

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   id: string,
>   version: string,
>   type: string,
>   eventCategory?: string,
>   eventLabel?: string,
>   eventData?: {
>   } | null,
>   timestamp: string,
>   sandboxId: string,
>   sandboxExecutionId: string,
>   sandboxTemplateId: string,
>   sandboxBuildId: string,
>   sandboxTeamId: string
> }[]
> ```

***

## Filesystem

### createDir

`filesystem.createDir`

MakeDir

**Risk:** `write`

```ts theme={null}
await corsair.e2b.api.filesystem.createDir({"headers":{"e2bSandboxId":"test","e2bSandboxPort":49983,"e2bAccessToken":"test-sandbox-access-token"},"body":{"path":"/tmp/corsair-e2b"}});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `headers` | `object` | Yes | — |
| `body` | `object` | Yes | — |

> [accordion] headers full type
>
> ```ts theme={null}
> {
>   e2bSandboxId: string,
>   e2bSandboxPort: number,
>   connectTimeoutMs?: number,
>   e2bAccessToken: string
> }
> ```

> [accordion] body full type
>
> ```ts theme={null}
> {
>   path?: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `entry` | `object` | No | — |

> [accordion] entry full type
>
> ```ts theme={null}
> {
>   name?: string,
>   type?: FILE_TYPE_UNSPECIFIED | FILE_TYPE_FILE | FILE_TYPE_DIRECTORY | FILE_TYPE_SYMLINK | string,
>   path?: string,
>   size?: number | string,
>   mode?: number,
>   permissions?: string,
>   owner?: string,
>   group?: string,
>   modifiedTime?: string,
>   symlinkTarget?: string | null,
>   metadata?: {
>   },
>   isSymlink?: boolean
> }
> ```

***

### createWatcher

`filesystem.createWatcher`

CreateWatcher

**Risk:** `write`

```ts theme={null}
await corsair.e2b.api.filesystem.createWatcher({"headers":{"e2bSandboxId":"test","e2bSandboxPort":49983,"e2bAccessToken":"test-sandbox-access-token"},"body":{}});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `headers` | `object` | Yes | — |
| `body` | `object` | Yes | — |

This is the unary watcher-creation operation; streaming WatchDir remains out of scope.

> [accordion] headers full type
>
> ```ts theme={null}
> {
>   e2bSandboxId: string,
>   e2bSandboxPort: number,
>   connectTimeoutMs?: number,
>   e2bAccessToken: string
> }
> ```

> [accordion] body full type
>
> ```ts theme={null}
> {
>   path?: string,
>   recursive?: boolean,
>   includeEntry?: boolean,
>   allowNetworkMounts?: boolean
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `watcherId` | `string` | No | — |

***

### getWatcherEvents

`filesystem.getWatcherEvents`

GetWatcherEvents

**Risk:** `read`

```ts theme={null}
await corsair.e2b.api.filesystem.getWatcherEvents({"headers":{"e2bSandboxId":"test","e2bSandboxPort":49983,"e2bAccessToken":"test-sandbox-access-token"},"body":{}});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `headers` | `object` | Yes | — |
| `body` | `object` | Yes | — |

> [accordion] headers full type
>
> ```ts theme={null}
> {
>   e2bSandboxId: string,
>   e2bSandboxPort: number,
>   connectTimeoutMs?: number,
>   e2bAccessToken: string
> }
> ```

> [accordion] body full type
>
> ```ts theme={null}
> {
>   watcherId?: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `events` | `object[]` | No | — |

> [accordion] events full type
>
> ```ts theme={null}
> {
>   name?: string,
>   type?: EVENT_TYPE_UNSPECIFIED | EVENT_TYPE_CREATE | EVENT_TYPE_WRITE | EVENT_TYPE_REMOVE | EVENT_TYPE_RENAME | EVENT_TYPE_CHMOD | string,
>   entry?: {
>     name?: string,
>     type?: FILE_TYPE_UNSPECIFIED | FILE_TYPE_FILE | FILE_TYPE_DIRECTORY | FILE_TYPE_SYMLINK | string,
>     path?: string,
>     size?: number | string,
>     mode?: number,
>     permissions?: string,
>     owner?: string,
>     group?: string,
>     modifiedTime?: string,
>     symlinkTarget?: string | null,
>     metadata?: {
>     },
>     isSymlink?: boolean
>   } | null
> }[]
> ```

***

### listDir

`filesystem.listDir`

ListDir

**Risk:** `read`

```ts theme={null}
await corsair.e2b.api.filesystem.listDir({"headers":{"e2bSandboxId":"test","e2bSandboxPort":49983,"e2bAccessToken":"test-sandbox-access-token"},"body":{"path":"/tmp/corsair-e2b"}});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `headers` | `object` | Yes | — |
| `body` | `object` | Yes | — |

> [accordion] headers full type
>
> ```ts theme={null}
> {
>   e2bSandboxId: string,
>   e2bSandboxPort: number,
>   connectTimeoutMs?: number,
>   e2bAccessToken: string
> }
> ```

> [accordion] body full type
>
> ```ts theme={null}
> {
>   path?: string,
>   depth?: number
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `entries` | `object[]` | No | — |

> [accordion] entries full type
>
> ```ts theme={null}
> {
>   name?: string,
>   type?: FILE_TYPE_UNSPECIFIED | FILE_TYPE_FILE | FILE_TYPE_DIRECTORY | FILE_TYPE_SYMLINK | string,
>   path?: string,
>   size?: number | string,
>   mode?: number,
>   permissions?: string,
>   owner?: string,
>   group?: string,
>   modifiedTime?: string,
>   symlinkTarget?: string | null,
>   metadata?: {
>   },
>   isSymlink?: boolean
> }[]
> ```

***

### move

`filesystem.move`

Move

**Risk:** `write`

```ts theme={null}
await corsair.e2b.api.filesystem.move({"headers":{"e2bSandboxId":"test","e2bSandboxPort":49983,"e2bAccessToken":"test-sandbox-access-token"},"body":{"source":"/tmp/corsair-e2b/a.txt","destination":"/tmp/corsair-e2b/b.txt"}});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `headers` | `object` | Yes | — |
| `body` | `object` | Yes | — |

> [accordion] headers full type
>
> ```ts theme={null}
> {
>   e2bSandboxId: string,
>   e2bSandboxPort: number,
>   connectTimeoutMs?: number,
>   e2bAccessToken: string
> }
> ```

> [accordion] body full type
>
> ```ts theme={null}
> {
>   source?: string,
>   destination?: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `entry` | `object` | No | — |

> [accordion] entry full type
>
> ```ts theme={null}
> {
>   name?: string,
>   type?: FILE_TYPE_UNSPECIFIED | FILE_TYPE_FILE | FILE_TYPE_DIRECTORY | FILE_TYPE_SYMLINK | string,
>   path?: string,
>   size?: number | string,
>   mode?: number,
>   permissions?: string,
>   owner?: string,
>   group?: string,
>   modifiedTime?: string,
>   symlinkTarget?: string | null,
>   metadata?: {
>   },
>   isSymlink?: boolean
> }
> ```

***

### remove

`filesystem.remove`

Remove

**Risk:** `destructive`

```ts theme={null}
await corsair.e2b.api.filesystem.remove({"headers":{"e2bSandboxId":"test","e2bSandboxPort":49983,"e2bAccessToken":"test-sandbox-access-token"},"body":{"path":"/tmp/corsair-e2b"}});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `headers` | `object` | Yes | — |
| `body` | `object` | Yes | — |

> [accordion] headers full type
>
> ```ts theme={null}
> {
>   e2bSandboxId: string,
>   e2bSandboxPort: number,
>   connectTimeoutMs?: number,
>   e2bAccessToken: string
> }
> ```

> [accordion] body full type
>
> ```ts theme={null}
> {
>   path?: string
> }
> ```

**Output:** *empty object*

***

### removeWatcher

`filesystem.removeWatcher`

RemoveWatcher

**Risk:** `write`

```ts theme={null}
await corsair.e2b.api.filesystem.removeWatcher({"headers":{"e2bSandboxId":"test","e2bSandboxPort":49983,"e2bAccessToken":"test-sandbox-access-token"},"body":{}});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `headers` | `object` | Yes | — |
| `body` | `object` | Yes | — |

> [accordion] headers full type
>
> ```ts theme={null}
> {
>   e2bSandboxId: string,
>   e2bSandboxPort: number,
>   connectTimeoutMs?: number,
>   e2bAccessToken: string
> }
> ```

> [accordion] body full type
>
> ```ts theme={null}
> {
>   watcherId?: string
> }
> ```

**Output:** *empty object*

***

### stat

`filesystem.stat`

Stat

**Risk:** `read`

```ts theme={null}
await corsair.e2b.api.filesystem.stat({"headers":{"e2bSandboxId":"test","e2bSandboxPort":49983,"e2bAccessToken":"test-sandbox-access-token"},"body":{"path":"/tmp/corsair-e2b"}});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `headers` | `object` | Yes | — |
| `body` | `object` | Yes | — |

> [accordion] headers full type
>
> ```ts theme={null}
> {
>   e2bSandboxId: string,
>   e2bSandboxPort: number,
>   connectTimeoutMs?: number,
>   e2bAccessToken: string
> }
> ```

> [accordion] body full type
>
> ```ts theme={null}
> {
>   path?: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `entry` | `object` | No | — |

> [accordion] entry full type
>
> ```ts theme={null}
> {
>   name?: string,
>   type?: FILE_TYPE_UNSPECIFIED | FILE_TYPE_FILE | FILE_TYPE_DIRECTORY | FILE_TYPE_SYMLINK | string,
>   path?: string,
>   size?: number | string,
>   mode?: number,
>   permissions?: string,
>   owner?: string,
>   group?: string,
>   modifiedTime?: string,
>   symlinkTarget?: string | null,
>   metadata?: {
>   },
>   isSymlink?: boolean
> }
> ```

***

## Process

### closeStdin

`process.closeStdin`

CloseStdin

**Risk:** `write`

```ts theme={null}
await corsair.e2b.api.process.closeStdin({"headers":{"e2bSandboxId":"test","e2bSandboxPort":49983,"e2bAccessToken":"test-sandbox-access-token"},"body":{"process":{"pid":101}}});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `headers` | `object` | Yes | — |
| `body` | `object` | Yes | — |

> [accordion] headers full type
>
> ```ts theme={null}
> {
>   e2bSandboxId: string,
>   e2bSandboxPort: number,
>   connectTimeoutMs?: number,
>   e2bAccessToken: string
> }
> ```

> [accordion] body full type
>
> ```ts theme={null}
> {
>   process?: {
>     pid: number
>   } | {
>     tag: string
>   }
> }
> ```

**Output:** *empty object*

***

### list

`process.list`

List

**Risk:** `read`

```ts theme={null}
await corsair.e2b.api.process.list({"headers":{"e2bSandboxId":"test","e2bSandboxPort":49983,"e2bAccessToken":"test-sandbox-access-token"},"body":{}});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `headers` | `object` | Yes | — |
| `body` | `object` | Yes | — |

> [accordion] headers full type
>
> ```ts theme={null}
> {
>   e2bSandboxId: string,
>   e2bSandboxPort: number,
>   connectTimeoutMs?: number,
>   e2bAccessToken: string
> }
> ```

> [accordion] body full type
>
> ```ts theme={null}
> {
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `processes` | `object[]` | No | — |

> [accordion] processes full type
>
> ```ts theme={null}
> {
>   config?: {
>     cmd?: string,
>     args?: string[],
>     envs?: {
>     },
>     cwd?: string | null
>   },
>   pid?: number,
>   tag?: string | null
> }[]
> ```

***

### sendInput

`process.sendInput`

SendInput

**Risk:** `write`

```ts theme={null}
await corsair.e2b.api.process.sendInput({"headers":{"e2bSandboxId":"test","e2bSandboxPort":49983,"e2bAccessToken":"test-sandbox-access-token"},"body":{"process":{"pid":101},"input":{"stdin":"aGVsbG8="}}});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `headers` | `object` | Yes | — |
| `body` | `object` | Yes | — |

stdin and pty bytes use the Connect JSON base64 representation; encode the bytes before passing the string.

> [accordion] headers full type
>
> ```ts theme={null}
> {
>   e2bSandboxId: string,
>   e2bSandboxPort: number,
>   connectTimeoutMs?: number,
>   e2bAccessToken: string
> }
> ```

> [accordion] body full type
>
> ```ts theme={null}
> {
>   process?: {
>     pid: number
>   } | {
>     tag: string
>   },
>   input?: {
>     pty: string
>   } | {
>     stdin: string
>   }
> }
> ```

**Output:** *empty object*

***

### sendSignal

`process.sendSignal`

SendSignal

**Risk:** `destructive`

```ts theme={null}
await corsair.e2b.api.process.sendSignal({"headers":{"e2bSandboxId":"test","e2bSandboxPort":49983,"e2bAccessToken":"test-sandbox-access-token"},"body":{"process":{"pid":101},"signal":"SIGNAL_SIGTERM"}});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `headers` | `object` | Yes | — |
| `body` | `object` | Yes | — |

> [accordion] headers full type
>
> ```ts theme={null}
> {
>   e2bSandboxId: string,
>   e2bSandboxPort: number,
>   connectTimeoutMs?: number,
>   e2bAccessToken: string
> }
> ```

> [accordion] body full type
>
> ```ts theme={null}
> {
>   process?: {
>     pid: number
>   } | {
>     tag: string
>   },
>   signal?: SIGNAL_UNSPECIFIED | SIGNAL_SIGTERM | SIGNAL_SIGKILL
> }
> ```

**Output:** *empty object*

***

### update

`process.update`

Update

**Risk:** `write`

```ts theme={null}
await corsair.e2b.api.process.update({"headers":{"e2bSandboxId":"test","e2bSandboxPort":49983,"e2bAccessToken":"test-sandbox-access-token"},"body":{"process":{"pid":101},"pty":{"size":{"cols":80,"rows":24}}}});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `headers` | `object` | Yes | — |
| `body` | `object` | Yes | — |

> [accordion] headers full type
>
> ```ts theme={null}
> {
>   e2bSandboxId: string,
>   e2bSandboxPort: number,
>   connectTimeoutMs?: number,
>   e2bAccessToken: string
> }
> ```

> [accordion] body full type
>
> ```ts theme={null}
> {
>   process?: {
>     pid: number
>   } | {
>     tag: string
>   },
>   pty?: {
>     size?: {
>       cols?: number,
>       rows?: number
>     }
>   } | null
> }
> ```

**Output:** *empty object*

***

## Sandboxes

### connect

`sandboxes.connect`

Connect sandbox (v2)

**Risk:** `destructive`

```ts theme={null}
await corsair.e2b.api.sandboxes.connect({"path":{"sandboxID":"test"},"body":{}});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `path` | `object` | Yes | — |
| `body` | `object` | No | — |

> [accordion] path full type
>
> ```ts theme={null}
> {
>   sandboxID: string
> }
> ```

> [accordion] body full type
>
> ```ts theme={null}
> {
>   timeout?: number,
>   memory?: boolean
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `templateID` | `string` | Yes | — |
| `sandboxID` | `string` | Yes | — |
| `alias` | `string` | No | — |
| `clientID` | `string` | Yes | — |
| `envdVersion` | `string` | Yes | — |
| `envdAccessToken` | `string` | No | — |
| `trafficAccessToken` | `string \| null` | No | — |
| `domain` | `string \| null` | No | — |

***

### create

`sandboxes.create`

Create sandbox (v2)

**Risk:** `destructive`

```ts theme={null}
await corsair.e2b.api.sandboxes.create({"headers":{"idempotencyKey":"test"},"body":{"templateID":"test"}});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `headers` | `object` | No | — |
| `body` | `object` | Yes | — |

metadata and envVars are string maps; mcp is an extensible JSON object, as specified by E2B's OpenAPI.

> [accordion] headers full type
>
> ```ts theme={null}
> {
>   idempotencyKey?: string
> }
> ```

> [accordion] body full type
>
> ```ts theme={null}
> {
>   templateID: string,
>   timeout?: number,
>   cpuCount?: number,
>   autoPause?: boolean,
>   autoPauseMemory?: boolean,
>   autoResume?: {
>     enabled: boolean
>   },
>   allow_internet_access?: boolean,
>   network?: {
>     allowPublicTraffic?: boolean | null,
>     allowOut?: string[],
>     denyOut?: string[],
>     dnsServers?: string[],
>     egressProxy?: {
>       address: string,
>       username?: string,
>       password?: string,
>       tls?: {
>         enabled: boolean,
>         serverName?: string,
>         caCert?: string
>       } | null
>     } | null,
>     maskRequestHost?: string,
>     httpsPorts?: number[],
>     rules?: {
>     }
>   },
>   metadata?: {
>   },
>   envVars?: {
>   },
>   mcp?: {
>   } | null,
>   iam?: {
>     tokens?: {
>     }
>   },
>   volumeMounts?: {
>     name: string,
>     path: string
>   }[]
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `templateID` | `string` | Yes | — |
| `sandboxID` | `string` | Yes | — |
| `alias` | `string` | No | — |
| `clientID` | `string` | Yes | — |
| `envdVersion` | `string` | Yes | — |
| `envdAccessToken` | `string` | No | — |
| `trafficAccessToken` | `string \| null` | No | — |
| `domain` | `string \| null` | No | — |

***

### createSnapshot

`sandboxes.createSnapshot`

Create snapshot

**Risk:** `write`

```ts theme={null}
await corsair.e2b.api.sandboxes.createSnapshot({"path":{"sandboxID":"test"},"headers":{"idempotencyKey":"test"},"body":{}});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `path` | `object` | Yes | — |
| `headers` | `object` | No | — |
| `body` | `object` | Yes | — |

> [accordion] path full type
>
> ```ts theme={null}
> {
>   sandboxID: string
> }
> ```

> [accordion] headers full type
>
> ```ts theme={null}
> {
>   idempotencyKey?: string
> }
> ```

> [accordion] body full type
>
> ```ts theme={null}
> {
>   name?: string,
>   memory?: boolean
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `snapshotID` | `string` | Yes | — |
| `names` | `string[]` | Yes | — |

***

### fork

`sandboxes.fork`

Fork sandbox

**Risk:** `destructive`

```ts theme={null}
await corsair.e2b.api.sandboxes.fork({"path":{"sandboxID":"test"},"body":{}});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `path` | `object` | Yes | — |
| `body` | `object` | No | — |

> [accordion] path full type
>
> ```ts theme={null}
> {
>   sandboxID: string
> }
> ```

> [accordion] body full type
>
> ```ts theme={null}
> {
>   timeout?: number,
>   count?: number
> }
> ```

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   sandbox?: {
>     templateID: string,
>     sandboxID: string,
>     alias?: string,
>     clientID: string,
>     envdVersion: string,
>     envdAccessToken?: string,
>     trafficAccessToken?: string | null,
>     domain?: string | null
>   },
>   error?: {
>     code: number,
>     error_code?: string,
>     message: string
>   }
> }[]
> ```

***

### get

`sandboxes.get`

Get sandbox

**Risk:** `read`

```ts theme={null}
await corsair.e2b.api.sandboxes.get({"path":{"sandboxID":"test"}});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `path` | `object` | Yes | — |

> [accordion] path full type
>
> ```ts theme={null}
> {
>   sandboxID: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `templateID` | `string` | Yes | — |
| `alias` | `string` | No | — |
| `sandboxID` | `string` | Yes | — |
| `clientID` | `string` | Yes | — |
| `startedAt` | `string` | Yes | — |
| `endAt` | `string` | Yes | — |
| `envdVersion` | `string` | Yes | — |
| `envdUnresponsiveAtPause` | `boolean` | No | — |
| `envdAccessToken` | `string` | No | — |
| `allowInternetAccess` | `boolean \| null` | No | — |
| `domain` | `string \| null` | No | — |
| `cpuCount` | `number` | Yes | — |
| `memoryMB` | `number` | Yes | — |
| `diskSizeMB` | `number` | Yes | — |
| `metadata` | `object` | No | — |
| `state` | `running \| paused \| string` | Yes | — |
| `network` | `object` | No | — |
| `lifecycle` | `object` | No | — |
| `pauseMode` | `full \| filesystem \| string` | No | — |
| `volumeMounts` | `object[]` | No | — |

> [accordion] metadata full type
>
> ```ts theme={null}
> {
> }
> ```

> [accordion] network full type
>
> ```ts theme={null}
> {
>   allowPublicTraffic?: boolean | null,
>   allowOut?: string[],
>   denyOut?: string[],
>   dnsServers?: string[],
>   egressProxy?: {
>     address: string,
>     username?: string,
>     password?: string,
>     tls?: {
>       enabled: boolean,
>       serverName?: string,
>       caCert?: string
>     } | null
>   } | null,
>   maskRequestHost?: string,
>   httpsPorts?: number[],
>   rules?: {
>   }
> }
> ```

> [accordion] lifecycle full type
>
> ```ts theme={null}
> {
>   autoResume: boolean,
>   onTimeout: kill | pause | string
> }
> ```

> [accordion] volumeMounts full type
>
> ```ts theme={null}
> {
>   name: string,
>   path: string
> }[]
> ```

***

### getLogs

`sandboxes.getLogs`

Get sandbox logs (v2)

**Risk:** `read`

```ts theme={null}
await corsair.e2b.api.sandboxes.getLogs({"path":{"sandboxID":"test"},"query":{"cursor":0,"limit":1000,"direction":"forward","level":"test","search":"test"}});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `path` | `object` | Yes | — |
| `query` | `object` | No | — |

> [accordion] path full type
>
> ```ts theme={null}
> {
>   sandboxID: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   cursor?: number,
>   limit?: number,
>   direction?: forward | backward,
>   level?: string,
>   search?: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `logs` | `object[]` | Yes | — |

> [accordion] logs full type
>
> ```ts theme={null}
> {
>   timestamp: string,
>   message: string,
>   level: string,
>   fields: {
>   }
> }[]
> ```

***

### getMetrics

`sandboxes.getMetrics`

Get sandbox metrics

**Risk:** `read`

```ts theme={null}
await corsair.e2b.api.sandboxes.getMetrics({"path":{"sandboxID":"test"},"query":{"start":0,"end":0}});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `path` | `object` | Yes | — |
| `query` | `object` | No | — |

> [accordion] path full type
>
> ```ts theme={null}
> {
>   sandboxID: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   start?: number,
>   end?: number
> }
> ```

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   timestamp: string,
>   timestampUnix: number,
>   cpuCount: number,
>   cpuUsedPct: number,
>   memUsed: number,
>   memTotal: number,
>   memCache: number,
>   diskUsed: number,
>   diskTotal: number
> }[]
> ```

***

### kill

`sandboxes.kill`

Delete sandbox

**Risk:** `destructive`

```ts theme={null}
await corsair.e2b.api.sandboxes.kill({"path":{"sandboxID":"test"}});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `path` | `object` | Yes | — |

> [accordion] path full type
>
> ```ts theme={null}
> {
>   sandboxID: string
> }
> ```

**Output:** `void`

***

### list

`sandboxes.list`

List sandboxes (v2)

**Risk:** `read`

```ts theme={null}
await corsair.e2b.api.sandboxes.list({"query":{"metadata":"test","state":["running"],"order":"desc","startedAfter":"2026-01-01T00:00:00Z","template":"test","nextToken":"test","limit":100}});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `query` | `object` | No | — |

The v2 list operation accepts state as a comma-separated array and returns `{ items, nextToken?, totalRunning? }`; pass nextToken as query.nextToken to continue.

> [accordion] query full type
>
> ```ts theme={null}
> {
>   metadata?: string,
>   state?: (running | paused)[],
>   order?: asc | desc,
>   startedAfter?: string,
>   template?: string,
>   nextToken?: string,
>   limit?: number
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `items` | `object[]` | Yes | — |
| `nextToken` | `string` | No | — |
| `totalRunning` | `number` | No | — |

> [accordion] items full type
>
> ```ts theme={null}
> {
>   templateID: string,
>   alias?: string,
>   sandboxID: string,
>   clientID: string,
>   startedAt: string,
>   endAt: string,
>   cpuCount: number,
>   memoryMB: number,
>   diskSizeMB: number,
>   metadata?: {
>   },
>   state: running | paused | string,
>   envdVersion: string,
>   envdUnresponsiveAtPause?: boolean,
>   volumeMounts?: {
>     name: string,
>     path: string
>   }[]
> }[]
> ```

***

### listMetrics

`sandboxes.listMetrics`

List sandbox metrics

**Risk:** `read`

```ts theme={null}
await corsair.e2b.api.sandboxes.listMetrics({"query":{"sandbox_ids":["test"]}});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `query` | `object` | Yes | — |

> [accordion] query full type
>
> ```ts theme={null}
> {
>   sandbox_ids: string[]
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `sandboxes` | `object` | Yes | — |

> [accordion] sandboxes full type
>
> ```ts theme={null}
> {
> }
> ```

***

### listSnapshots

`sandboxes.listSnapshots`

List snapshots

**Risk:** `read`

```ts theme={null}
await corsair.e2b.api.sandboxes.listSnapshots({"query":{"sandboxID":"test","name":"test","limit":100,"nextToken":"test"}});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `query` | `object` | No | — |

Returns `{ items, nextToken? }`; pass X-Next-Token as query.nextToken to continue.

> [accordion] query full type
>
> ```ts theme={null}
> {
>   sandboxID?: string,
>   name?: string,
>   limit?: number,
>   nextToken?: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `items` | `object[]` | Yes | — |
| `nextToken` | `string` | No | — |

> [accordion] items full type
>
> ```ts theme={null}
> {
>   snapshotID: string,
>   names: string[]
> }[]
> ```

***

### pause

`sandboxes.pause`

Pause sandbox

**Risk:** `write`

```ts theme={null}
await corsair.e2b.api.sandboxes.pause({"path":{"sandboxID":"test"},"body":{}});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `path` | `object` | Yes | — |
| `body` | `object` | No | — |

> [accordion] path full type
>
> ```ts theme={null}
> {
>   sandboxID: string
> }
> ```

> [accordion] body full type
>
> ```ts theme={null}
> {
>   memory?: boolean,
>   requireHealthyGuest?: boolean
> }
> ```

**Output:** `void`

***

### refresh

`sandboxes.refresh`

Refresh sandbox

**Risk:** `destructive`

```ts theme={null}
await corsair.e2b.api.sandboxes.refresh({"path":{"sandboxID":"test"},"body":{}});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `path` | `object` | Yes | — |
| `body` | `object` | No | — |

> [accordion] path full type
>
> ```ts theme={null}
> {
>   sandboxID: string
> }
> ```

> [accordion] body full type
>
> ```ts theme={null}
> {
>   duration?: number
> }
> ```

**Output:** `void`

***

### setTimeout

`sandboxes.setTimeout`

Set sandbox timeout

**Risk:** `destructive`

```ts theme={null}
await corsair.e2b.api.sandboxes.setTimeout({"path":{"sandboxID":"test"},"body":{"timeout":0}});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `path` | `object` | Yes | — |
| `body` | `object` | No | — |

> [accordion] path full type
>
> ```ts theme={null}
> {
>   sandboxID: string
> }
> ```

> [accordion] body full type
>
> ```ts theme={null}
> {
>   timeout: number
> }
> ```

**Output:** `void`

***

### updateNetwork

`sandboxes.updateNetwork`

Update sandbox network

**Risk:** `write`

```ts theme={null}
await corsair.e2b.api.sandboxes.updateNetwork({"path":{"sandboxID":"test"},"body":{}});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `path` | `object` | Yes | — |
| `body` | `object` | Yes | — |

> [accordion] path full type
>
> ```ts theme={null}
> {
>   sandboxID: string
> }
> ```

> [accordion] body full type
>
> ```ts theme={null}
> {
>   allowOut?: string[],
>   denyOut?: string[],
>   dnsServers?: string[],
>   egressProxy?: {
>     address: string,
>     username?: string,
>     password?: string,
>     tls?: {
>       enabled: boolean,
>       serverName?: string,
>       caCert?: string
>     } | null
>   } | null,
>   rules?: {
>   },
>   allow_internet_access?: boolean
> }
> ```

**Output:** `void`

***

## Secrets

### create

`secrets.create`

Create secret

**Risk:** `write`

```ts theme={null}
await corsair.e2b.api.secrets.create({"body":{"name":"test","value":"test"}});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `body` | `object` | Yes | — |

Secret values are accepted only on create/update and are never returned by list/get operations.

> [accordion] body full type
>
> ```ts theme={null}
> {
>   name: string,
>   value: string,
>   metadata?: {
>   }
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `secretID` | `string` | Yes | — |
| `name` | `string` | Yes | — |
| `currentVersion` | `number` | Yes | — |
| `metadata` | `object` | Yes | — |
| `createdAt` | `string` | Yes | — |
| `updatedAt` | `string` | Yes | — |

> [accordion] metadata full type
>
> ```ts theme={null}
> {
> }
> ```

***

### delete

`secrets.delete`

Delete secret

**Risk:** `destructive`

```ts theme={null}
await corsair.e2b.api.secrets.delete({"path":{"secretID":"test"}});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `path` | `object` | Yes | — |

> [accordion] path full type
>
> ```ts theme={null}
> {
>   secretID: string
> }
> ```

**Output:** `void`

***

### get

`secrets.get`

Get secret

**Risk:** `read`

```ts theme={null}
await corsair.e2b.api.secrets.get({"path":{"secretID":"test"}});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `path` | `object` | Yes | — |

> [accordion] path full type
>
> ```ts theme={null}
> {
>   secretID: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `secretID` | `string` | Yes | — |
| `name` | `string` | Yes | — |
| `currentVersion` | `number` | Yes | — |
| `metadata` | `object` | Yes | — |
| `createdAt` | `string` | Yes | — |
| `updatedAt` | `string` | Yes | — |

> [accordion] metadata full type
>
> ```ts theme={null}
> {
> }
> ```

***

### list

`secrets.list`

List secrets

**Risk:** `read`

```ts theme={null}
await corsair.e2b.api.secrets.list({"query":{"nextToken":"test","limit":100}});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `query` | `object` | No | — |

Returns `{ items, nextToken? }`; pass X-Next-Token as query.nextToken to continue. The response never includes secret values.

> [accordion] query full type
>
> ```ts theme={null}
> {
>   nextToken?: string,
>   limit?: number
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `items` | `object[]` | Yes | — |
| `nextToken` | `string` | No | — |

> [accordion] items full type
>
> ```ts theme={null}
> {
>   secretID: string,
>   name: string,
>   currentVersion: number,
>   metadata: {
>   },
>   createdAt: string,
>   updatedAt: string
> }[]
> ```

***

### update

`secrets.update`

Update secret

**Risk:** `write`

```ts theme={null}
await corsair.e2b.api.secrets.update({"path":{"secretID":"test"},"body":{"value":"test"}});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `path` | `object` | Yes | — |
| `body` | `object` | Yes | — |

> [accordion] path full type
>
> ```ts theme={null}
> {
>   secretID: string
> }
> ```

> [accordion] body full type
>
> ```ts theme={null}
> {
>   value: string,
>   metadata?: {
>   }
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `secretID` | `string` | Yes | — |
| `name` | `string` | Yes | — |
| `currentVersion` | `number` | Yes | — |
| `metadata` | `object` | Yes | — |
| `createdAt` | `string` | Yes | — |
| `updatedAt` | `string` | Yes | — |

> [accordion] metadata full type
>
> ```ts theme={null}
> {
> }
> ```

***

## Tags

### assign

`tags.assign`

Assign tags

**Risk:** `write`

```ts theme={null}
await corsair.e2b.api.tags.assign({"body":{"target":"test","tags":["test"]}});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `body` | `object` | Yes | — |

> [accordion] body full type
>
> ```ts theme={null}
> {
>   target: string,
>   tags: string[]
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `tags` | `string[]` | Yes | — |
| `buildID` | `string` | Yes | — |

***

### count

`tags.count`

Count template tags

**Risk:** `read`

```ts theme={null}
await corsair.e2b.api.tags.count({"path":{"templateID":"test"}});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `path` | `object` | Yes | — |

> [accordion] path full type
>
> ```ts theme={null}
> {
>   templateID: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `total` | `number` | Yes | — |

***

### delete

`tags.delete`

Delete tags

**Risk:** `destructive`

```ts theme={null}
await corsair.e2b.api.tags.delete({"body":{"name":"test","tags":["test"]}});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `body` | `object` | Yes | — |

> [accordion] body full type
>
> ```ts theme={null}
> {
>   name: string,
>   tags: string[]
> }
> ```

**Output:** `void`

***

### exists

`tags.exists`

Check template tag

**Risk:** `read`

```ts theme={null}
await corsair.e2b.api.tags.exists({"path":{"templateID":"test"},"query":{"tag":"test"}});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `path` | `object` | Yes | — |
| `query` | `object` | Yes | — |

> [accordion] path full type
>
> ```ts theme={null}
> {
>   templateID: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   tag: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `exists` | `boolean` | Yes | — |
| `normalizedTag` | `string` | Yes | — |

***

### list

`tags.list`

List template tags

**Risk:** `read`

```ts theme={null}
await corsair.e2b.api.tags.list({"path":{"templateID":"test"}});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `path` | `object` | Yes | — |

> [accordion] path full type
>
> ```ts theme={null}
> {
>   templateID: string
> }
> ```

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   tag: string,
>   buildID: string,
>   createdAt: string
> }[]
> ```

***

### listAssignments

`tags.listAssignments`

List template tag assignments

**Risk:** `read`

```ts theme={null}
await corsair.e2b.api.tags.listAssignments({"path":{"templateID":"test","tag":"test"},"query":{"cursor":"test","limit":50}});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `path` | `object` | Yes | — |
| `query` | `object` | No | — |

> [accordion] path full type
>
> ```ts theme={null}
> {
>   templateID: string,
>   tag: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   cursor?: string,
>   limit?: number
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[]` | Yes | — |
| `nextCursor` | `string \| null` | Yes | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   assignmentId: string,
>   buildId: string,
>   assignedAt: string,
>   buildCreatedAt: string,
>   buildFinishedAt: string | null
> }[]
> ```

***

### listGroups

`tags.listGroups`

List template tag groups

**Risk:** `read`

```ts theme={null}
await corsair.e2b.api.tags.listGroups({"path":{"templateID":"test"},"query":{"assignmentLimit":6,"tagsLimit":25,"tagsCursor":"test","search":"test","sort":"latest_desc"}});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `path` | `object` | Yes | — |
| `query` | `object` | No | — |

> [accordion] path full type
>
> ```ts theme={null}
> {
>   templateID: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   assignmentLimit?: number,
>   tagsLimit?: number,
>   tagsCursor?: string,
>   search?: string,
>   sort?: latest_desc | latest_asc | name_asc | name_desc
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `tags` | `object[]` | Yes | — |
| `nextCursor` | `string \| null` | Yes | — |

> [accordion] tags full type
>
> ```ts theme={null}
> {
>   tag: string,
>   assignments: {
>     assignmentId: string,
>     buildId: string,
>     assignedAt: string,
>     buildCreatedAt: string,
>     buildFinishedAt: string | null
>   }[],
>   hasMore: boolean
> }[]
> ```

***

## Teams

### getMaxMetrics

`teams.getMaxMetrics`

Get team metrics max

**Risk:** `read`

```ts theme={null}
await corsair.e2b.api.teams.getMaxMetrics({"path":{"teamID":"test"},"query":{"start":0,"end":0,"metric":"concurrent_sandboxes"}});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `path` | `object` | Yes | — |
| `query` | `object` | Yes | — |

> [accordion] path full type
>
> ```ts theme={null}
> {
>   teamID: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   start?: number,
>   end?: number,
>   metric: concurrent_sandboxes | sandbox_start_rate
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `timestamp` | `string` | Yes | — |
| `timestampUnix` | `number` | Yes | — |
| `value` | `number` | Yes | — |

***

### getMetrics

`teams.getMetrics`

Get team metrics

**Risk:** `read`

```ts theme={null}
await corsair.e2b.api.teams.getMetrics({"path":{"teamID":"test"},"query":{"start":0,"end":0}});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `path` | `object` | Yes | — |
| `query` | `object` | No | — |

> [accordion] path full type
>
> ```ts theme={null}
> {
>   teamID: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   start?: number,
>   end?: number
> }
> ```

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   timestamp: string,
>   timestampUnix: number,
>   concurrentSandboxes: number,
>   sandboxStartRate: number
> }[]
> ```

***

## Templates

### create

`templates.create`

Create template (v3)

**Risk:** `write`

```ts theme={null}
await corsair.e2b.api.templates.create({"headers":{"idempotencyKey":"test"},"body":{}});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `headers` | `object` | No | — |
| `body` | `object` | Yes | — |

> [accordion] headers full type
>
> ```ts theme={null}
> {
>   idempotencyKey?: string
> }
> ```

> [accordion] body full type
>
> ```ts theme={null}
> {
>   name?: string,
>   tags?: string[],
>   alias?: string,
>   teamID?: string,
>   cpuCount?: number,
>   maxCpuCount?: number,
>   memoryMB?: number,
>   minFreeDiskMb?: number
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `templateID` | `string` | Yes | — |
| `buildID` | `string` | Yes | — |
| `public` | `boolean` | Yes | — |
| `names` | `string[]` | Yes | — |
| `tags` | `string[]` | Yes | — |
| `aliases` | `string[]` | Yes | — |

***

### delete

`templates.delete`

Delete template

**Risk:** `destructive`

```ts theme={null}
await corsair.e2b.api.templates.delete({"path":{"templateID":"test"}});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `path` | `object` | Yes | — |

> [accordion] path full type
>
> ```ts theme={null}
> {
>   templateID: string
> }
> ```

**Output:** `void`

***

### get

`templates.get`

Get template

**Risk:** `read`

```ts theme={null}
await corsair.e2b.api.templates.get({"path":{"templateID":"test"},"query":{"nextToken":"test","limit":100}});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `path` | `object` | Yes | — |
| `query` | `object` | No | — |

Returns the template and its build page, including nextToken from X-Next-Token; pass it as query.nextToken to continue.

> [accordion] path full type
>
> ```ts theme={null}
> {
>   templateID: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   nextToken?: string,
>   limit?: number
> }
> ```

**Output:** `object`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   templateID: string,
>   buildID: string,
>   cpuCount: number | 0,
>   maxCpuCount?: number,
>   memoryMB: number | 0,
>   diskSizeMB: number,
>   public: boolean,
>   aliases: string[],
>   names: string[],
>   createdAt: string,
>   updatedAt: string,
>   createdBy: {
>     id: string,
>     email: string | null
>   } | null,
>   lastSpawnedAt: string | null,
>   spawnCount: number,
>   buildCount: number,
>   envdVersion: string,
>   buildStatus: building | waiting | ready | error | uploaded | string,
>   isDefault?: boolean,
>   description?: string
> }& {
>   builds: {
>     buildID: string,
>     status: building | waiting | ready | error | uploaded | string,
>     createdAt: string,
>     updatedAt: string,
>     finishedAt?: string,
>     cpuCount: number,
>     maxCpuCount?: number,
>     memoryMB: number,
>     diskSizeMB?: number,
>     envdVersion?: string
>   }[],
>   nextToken?: string
> }
> ```

***

### getBuildLogs

`templates.getBuildLogs`

Get build logs

**Risk:** `read`

```ts theme={null}
await corsair.e2b.api.templates.getBuildLogs({"path":{"templateID":"test","buildID":"test"},"query":{"cursor":0,"limit":100,"direction":"forward","level":"test","source":"temporary"}});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `path` | `object` | Yes | — |
| `query` | `object` | No | — |

> [accordion] path full type
>
> ```ts theme={null}
> {
>   templateID: string,
>   buildID: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   cursor?: number,
>   limit?: number,
>   direction?: forward | backward,
>   level?: string,
>   source?: temporary | persistent
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `logs` | `object[]` | Yes | — |

> [accordion] logs full type
>
> ```ts theme={null}
> {
>   timestamp: string,
>   message: string,
>   level: string,
>   step?: string
> }[]
> ```

***

### getBuildStatus

`templates.getBuildStatus`

Get build status

**Risk:** `read`

```ts theme={null}
await corsair.e2b.api.templates.getBuildStatus({"path":{"templateID":"test","buildID":"test"},"query":{"logsOffset":0,"limit":100,"level":"test"}});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `path` | `object` | Yes | — |
| `query` | `object` | No | — |

> [accordion] path full type
>
> ```ts theme={null}
> {
>   templateID: string,
>   buildID: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   logsOffset?: number,
>   limit?: number,
>   level?: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `logs` | `string[]` | Yes | — |
| `logEntries` | `object[]` | Yes | — |
| `templateID` | `string` | Yes | — |
| `buildID` | `string` | Yes | — |
| `status` | `building \| waiting \| ready \| error \| uploaded \| string` | Yes | — |
| `reason` | `object` | No | — |

> [accordion] logEntries full type
>
> ```ts theme={null}
> {
>   timestamp: string,
>   message: string,
>   level: string,
>   step?: string
> }[]
> ```

> [accordion] reason full type
>
> ```ts theme={null}
> {
>   message: string,
>   step?: string,
>   logEntries?: {
>     timestamp: string,
>     message: string,
>     level: string,
>     step?: string
>   }[]
> }
> ```

***

### getBuildUploadLink

`templates.getBuildUploadLink`

Get build upload link

**Risk:** `read`

```ts theme={null}
await corsair.e2b.api.templates.getBuildUploadLink({"path":{"templateID":"test","hash":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"}});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `path` | `object` | Yes | — |

Returns an upload URL and headers for a template build file. Treat the response as a short-lived capability; avoid logging it.

> [accordion] path full type
>
> ```ts theme={null}
> {
>   templateID: string,
>   hash: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `present` | `boolean` | Yes | — |
| `url` | `string` | No | — |
| `headers` | `object` | No | — |

> [accordion] headers full type
>
> ```ts theme={null}
> {
> }
> ```

***

### getByAlias

`templates.getByAlias`

Get template by alias

**Risk:** `read`

```ts theme={null}
await corsair.e2b.api.templates.getByAlias({"path":{"alias":"test"}});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `path` | `object` | Yes | — |

> [accordion] path full type
>
> ```ts theme={null}
> {
>   alias: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `templateID` | `string` | Yes | — |
| `public` | `boolean` | Yes | — |

***

### list

`templates.list`

List templates (v2)

**Risk:** `read`

```ts theme={null}
await corsair.e2b.api.templates.list({"query":{"teamID":"test","nextToken":"test","limit":100}});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `query` | `object` | No | — |

Returns `{ items, nextToken? }`; pass X-Next-Token as query.nextToken to continue.

> [accordion] query full type
>
> ```ts theme={null}
> {
>   teamID?: string,
>   nextToken?: string,
>   limit?: number
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `items` | `object[]` | Yes | — |
| `nextToken` | `string` | No | — |

> [accordion] items full type
>
> ```ts theme={null}
> {
>   templateID: string,
>   buildID: string,
>   cpuCount: number | 0,
>   maxCpuCount?: number,
>   memoryMB: number | 0,
>   diskSizeMB: number,
>   public: boolean,
>   aliases: string[],
>   names: string[],
>   createdAt: string,
>   updatedAt: string,
>   createdBy: {
>     id: string,
>     email: string | null
>   } | null,
>   lastSpawnedAt: string | null,
>   spawnCount: number,
>   buildCount: number,
>   envdVersion: string,
>   buildStatus: building | waiting | ready | error | uploaded | string,
>   isDefault?: boolean,
>   description?: string
> }[]
> ```

***

### listDefault

`templates.listDefault`

List default templates

**Risk:** `read`

```ts theme={null}
await corsair.e2b.api.templates.listDefault({});
```

**Input:** *empty object*

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   templateID: string,
>   buildID: string,
>   cpuCount: number | 0,
>   maxCpuCount?: number,
>   memoryMB: number | 0,
>   diskSizeMB: number,
>   public: boolean,
>   aliases: string[],
>   names: string[],
>   createdAt: string,
>   updatedAt: string,
>   createdBy: {
>     id: string,
>     email: string | null
>   } | null,
>   lastSpawnedAt: string | null,
>   spawnCount: number,
>   buildCount: number,
>   envdVersion: string,
>   buildStatus: building | waiting | ready | error | uploaded | string,
>   isDefault?: boolean,
>   description?: string
> }[]
> ```

***

### startBuild

`templates.startBuild`

Start build (v2)

**Risk:** `write`

```ts theme={null}
await corsair.e2b.api.templates.startBuild({"path":{"templateID":"test","buildID":"test"},"headers":{"idempotencyKey":"test"},"body":{}});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `path` | `object` | Yes | — |
| `headers` | `object` | No | — |
| `body` | `object` | Yes | — |

> [accordion] path full type
>
> ```ts theme={null}
> {
>   templateID: string,
>   buildID: string
> }
> ```

> [accordion] headers full type
>
> ```ts theme={null}
> {
>   idempotencyKey?: string
> }
> ```

> [accordion] body full type
>
> ```ts theme={null}
> {
>   fromImage?: string,
>   fromTemplate?: string,
>   fromImageRegistry?: {
>     type: aws,
>     awsAccessKeyId: string,
>     awsSecretAccessKey: string,
>     awsRegion: string
>   } | {
>     type: gcp,
>     serviceAccountJson: string
>   } | {
>     type: registry,
>     username: string,
>     password: string
>   },
>   force?: boolean,
>   steps?: {
>     type: string,
>     args?: string[],
>     filesHash?: string,
>     force?: boolean
>   }[],
>   startCmd?: string,
>   readyCmd?: string
> }
> ```

**Output:** `void`

***

### update

`templates.update`

Update template (v2)

**Risk:** `write`

```ts theme={null}
await corsair.e2b.api.templates.update({"path":{"templateID":"test"},"body":{}});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `path` | `object` | Yes | — |
| `body` | `object` | Yes | — |

> [accordion] path full type
>
> ```ts theme={null}
> {
>   templateID: string
> }
> ```

> [accordion] body full type
>
> ```ts theme={null}
> {
>   public?: boolean
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `names` | `string[]` | Yes | — |

***

## Volumes

### create

`volumes.create`

Create team volume

**Risk:** `write`

```ts theme={null}
await corsair.e2b.api.volumes.create({"body":{"name":"test"}});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `body` | `object` | Yes | — |

> [accordion] body full type
>
> ```ts theme={null}
> {
>   name: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `volumeID` | `string` | Yes | — |
| `name` | `string` | Yes | — |
| `token` | `string` | Yes | — |
| `domain` | `string` | No | — |

***

### delete

`volumes.delete`

Delete team volume

**Risk:** `destructive`

```ts theme={null}
await corsair.e2b.api.volumes.delete({"path":{"volumeID":"test"}});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `path` | `object` | Yes | — |

> [accordion] path full type
>
> ```ts theme={null}
> {
>   volumeID: string
> }
> ```

**Output:** `void`

***

### get

`volumes.get`

Team volume

**Risk:** `read`

```ts theme={null}
await corsair.e2b.api.volumes.get({"path":{"volumeID":"test"}});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `path` | `object` | Yes | — |

> [accordion] path full type
>
> ```ts theme={null}
> {
>   volumeID: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `volumeID` | `string` | Yes | — |
| `name` | `string` | Yes | — |
| `token` | `string` | Yes | — |
| `domain` | `string` | No | — |

***

### list

`volumes.list`

List team volumes

**Risk:** `read`

```ts theme={null}
await corsair.e2b.api.volumes.list({});
```

**Input:** *empty object*

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   volumeID: string,
>   name: string
> }[]
> ```

***


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.