E2B
App · 19 actions
Start, pause and stop E2B cloud sandboxes for running AI-generated code, read their logs, metrics and events, and manage templates, snapshots and webhooks.
Actions
| Action | What it does |
|---|---|
| Connect sandbox | Connect to a sandbox, resuming it first if it is paused, and set how long it stays up. |
| Create sandbox | Start a new sandbox from a template, with its own timeout, resources and environment variables. |
| Create webhook | Add a webhook that receives sandbox events at an address you choose. |
| Delete webhook | Delete a webhook so it stops receiving sandbox events. |
| Get sandbox | Get a sandbox's details, such as its template, state, resources and when it ends. |
| Get sandbox logs | Read a sandbox's logs, optionally filtered by level or text. |
| Get sandbox metrics | Get a sandbox's CPU, memory and disk use over a period. |
| Get template | Get a template's details and its builds. |
| Get webhook | Get a webhook's details, such as its address and the events it receives. |
| Kill sandbox | Stop a sandbox straight away and discard it. |
| List events | List recent sandbox lifecycle events across your team, such as sandboxes created, paused or killed. |
| List sandbox events | List the lifecycle events of one sandbox. |
| List sandboxes | List your running and paused sandboxes, optionally filtered by state, template or metadata. |
| List snapshots | List saved sandbox snapshots, optionally for one sandbox or by name. |
| List templates | List the sandbox templates your team can start sandboxes from. |
| List webhooks | List the webhooks that receive your team's sandbox events. |
| Pause sandbox | Pause a running sandbox, keeping its files and memory so it can be resumed later. |
| Set timeout | Set how many seconds from now a running sandbox stays up before it is stopped. |
| Update webhook | Change a webhook's name, address, events or whether it is turned on. |
Connect sandbox
Connect to a sandbox, resuming it first if it is paused, and set how long it stays up.
Inputs
- Sandbox
sandbox_idtextRequired - Sandbox id.
- Memory
memorytrue/false - Defaults to true. When false and the sandbox is paused, resume from disk state only: the sandbox cold-boots fresh and any memory in the snapshot is ignored, never modified or deleted. Disk state has crash-recovery semantics ; writes not flushed before the pause may be lost. A no-op for snapshots that contain no memory. Rejected with an error in environments where this capability is not enabled, never silently downgraded to a memory restore. A snapshot taken while the sandbox guest agent was not
- Timeout
timeoutnumber - Timeout in seconds from the current time after which the sandbox should expireAt least 1. Default:
300.
Outputs
dataobject- Response.
next_cursortext- Continuation token, when returned by the service.
Example output
{
"data": {
"alias": "example",
"domain": "example",
"envdAccessToken": "example",
"envdVersion": "example",
"sandboxID": "example",
"templateID": "example",
"trafficAccessToken": "example"
},
"next_cursor": ""
}Create sandbox
Start a new sandbox from a template, with its own timeout, resources and environment variables.
Inputs
- Idempotency key
idempotency_keytext - Idempotency key.
- Allow internet access
allow_internet_accesstrue/false - Allow sandbox to access the internet. When set to false, it behaves the same as specifying denyOut to 0.0.0.0/0 in the network config.
- Auto pause
auto_pausetrue/false - Automatically pauses the sandbox after the timeoutDefault:
false. - Auto pause memory
auto_pause_memorytrue/false - Controls the snapshot kind taken when the sandbox auto-pauses on timeout (only relevant when autoPause is true). When false, the auto-pause drops the in-memory state and persists only the filesystem (a filesystem-only snapshot); resuming it cold-boots (reboots) the sandbox from disk. Such a snapshot cannot be auto-resumed by traffic and must be resumed explicitly, so it cannot be combined with autoResume. Defaults to true (full memory snapshot).Default:
true. - Auto resume
auto_resumeobject - Auto-resume configuration for paused sandboxes.
- Cpu count
cpu_countnumber - CPU cores for the sandboxAt least 1.
- Env vars
env_varstext - Env vars.
- Iam
iamobject - Sandbox workload identity configuration. A non-empty, valid tokens map enables workload identity for the sandbox.
- Mcp
mcpobject - MCP configuration for the sandbox
- Metadata
metadatatext - Metadata.
- Network
networkobject - Network.
- Template
template_idtextRequired - Identifier of the required template
- Timeout
timeoutnumber - Time to live for the sandbox in seconds.At least 1. Default:
300. - Volume mounts
volume_mountslist - Volume mounts.
Outputs
dataobject- Response.
next_cursortext- Continuation token, when returned by the service.
Example output
{
"data": {
"alias": "example",
"domain": "example",
"envdAccessToken": "example",
"envdVersion": "example",
"sandboxID": "example",
"templateID": "example",
"trafficAccessToken": "example"
},
"next_cursor": ""
}Create webhook
Add a webhook that receives sandbox events at an address you choose.
Inputs
- Enabled
enabledtrue/false - Enabled.Default:
true. - Events
eventslistRequired - Events.
- Name
nametextRequired - Name.
- Signature secret
signature_secrettextRequired - Secret used to sign the webhook payloads
- Url
urltextRequired - Url.
Outputs
dataobject- Webhook creation response
next_cursortext- Continuation token, when returned by the service.
Example output
{
"data": {
"createdAt": "example",
"enabled": false,
"events": [],
"id": "example",
"name": "example",
"teamId": "example",
"url": "example"
},
"next_cursor": ""
}Delete webhook
Delete a webhook so it stops receiving sandbox events.
Inputs
- Webhook id
webhook_idtextRequired - Webhook id.
Outputs
dataobject- Response.
next_cursortext- Continuation token, when returned by the service.
Example output
{
"data": {},
"next_cursor": ""
}Get sandbox
Get a sandbox's details, such as its template, state, resources and when it ends.
Inputs
- Sandbox
sandbox_idtextRequired - Sandbox id.
Outputs
dataobject- Response.
next_cursortext- Continuation token, when returned by the service.
Example output
{
"data": {
"alias": "example",
"allowInternetAccess": false,
"cpuCount": 1,
"diskSizeMB": 1,
"domain": "example",
"endAt": "example",
"envdAccessToken": "example",
"envdUnresponsiveAtPause": false,
"envdVersion": "example",
"lifecycle": {
"autoResume": false,
"onTimeout": "kill"
},
"memoryMB": 1,
"metadata": "example",
"network": {
"allowOut": [],
"allowPublicTraffic": false,
"denyOut": [],
"dnsServers": [],
"egressProxy": {
"address": "example",
"password": "example",
"tls": {
"caCert": "example",
"enabled": false,
"serverName": "example"
},
"username": "example"
},
"httpsPorts": [],
"maskRequestHost": "example",
"rules": {}
},
"pauseMode": "full",
"sandboxID": "example",
"startedAt": "example",
"state": "running",
"templateID": "example",
"volumeMounts": []
},
"next_cursor": ""
}Get sandbox logs
Read a sandbox's logs, optionally filtered by level or text.
Inputs
- Sandbox
sandbox_idtextRequired - Sandbox id.
- Logs starting at
cursordate and time - Start of the time window.
- Limit
limitnumber - Limit.From 0 to 1000. Default:
1000. - Direction
directiontext - Direction of the logs that should be returnedOne of:
forward,backward. - Level
leveltext - State of the sandboxOne of:
debug,info,warn,error. - Search
searchtext - Search.
Outputs
dataobject- Response.
next_cursortext- Continuation token, when returned by the service.
Example output
{
"data": {
"logs": []
},
"next_cursor": ""
}Get sandbox metrics
Get a sandbox's CPU, memory and disk use over a period.
Inputs
- Sandbox
sandbox_idtextRequired - Sandbox id.
- Start
startdate and time - Start of the time window.
- End
enddate and time - End of the time window.
Outputs
datalist- Response.
next_cursortext- Continuation token, when returned by the service.
Example output
{
"data": [],
"next_cursor": ""
}Get template
Get a template's details and its builds.
Inputs
- Template
template_idtextRequired - Template id.
Outputs
dataobject- A template with its default build. `defaultBuild` is the build a sandbox created without a tag starts from, the latest ready build tagged default; it is absent until such a build is ready. `buildStatus` is the status of the latest build tagged default in any state: it is `building` while a rebuild runs, although sandboxes still start from the default build.
next_cursortext- Continuation token, when returned by the service.
Example output
{
"data": {
"buildCount": 1,
"buildStatus": "building",
"createdAt": "example",
"createdBy": {
"id": "example"
},
"defaultBuild": {
"buildID": "example",
"cpuCount": 1,
"createdAt": "example",
"diskSizeMB": 1,
"envdVersion": "example",
"finishedAt": "example",
"maxCpuCount": 1,
"memoryMB": 1,
"status": "building",
"updatedAt": "example"
},
"description": "example",
"isDefault": false,
"lastSpawnedAt": "example",
"names": [],
"public": false,
"spawnCount": 1,
"templateID": "example",
"updatedAt": "example"
},
"next_cursor": ""
}Get webhook
Get a webhook's details, such as its address and the events it receives.
Inputs
- Webhook id
webhook_idtextRequired - Webhook id.
Outputs
dataobject- Webhook detail response
next_cursortext- Continuation token, when returned by the service.
Example output
{
"data": {
"createdAt": "example",
"enabled": false,
"events": [],
"id": "example",
"name": "example",
"teamId": "example",
"url": "example"
},
"next_cursor": ""
}Kill sandbox
Stop a sandbox straight away and discard it.
Inputs
- Sandbox
sandbox_idtextRequired - Sandbox id.
Outputs
dataobject- Response.
next_cursortext- Continuation token, when returned by the service.
Example output
{
"data": {},
"next_cursor": ""
}List events
List recent sandbox lifecycle events across your team, such as sandboxes created, paused or killed.
Inputs
- Offset
offsetnumber - Offset.At least 0. Default:
0. - Limit
limitnumber - Limit.From 1 to 100. Default:
10. - Order asc
order_asctrue/false - Order asc.Default:
false. - Types
typeslist - Types.
Outputs
datalist- Response.
next_cursortext- Continuation token, when returned by the service.
Example output
{
"data": [],
"next_cursor": ""
}List sandbox events
List the lifecycle events of one sandbox.
Inputs
- Sandbox
sandbox_idtextRequired - Sandbox id.
- Offset
offsetnumber - Offset.At least 0. Default:
0. - Limit
limitnumber - Limit.From 1 to 100. Default:
10. - Order asc
order_asctrue/false - Order asc.Default:
false. - Types
typeslist - Types.
Outputs
datalist- Response.
next_cursortext- Continuation token, when returned by the service.
Example output
{
"data": [],
"next_cursor": ""
}List sandboxes
List your running and paused sandboxes, optionally filtered by state, template or metadata.
Inputs
- Metadata
metadatatext - Metadata.
- State
statelist - State.One or more of:
running,paused. - Order
ordertext - Sort directionOne of:
asc,desc. Default:desc. - Started after
started_afterdate and time - Started after.
- Template
templatetext - Template.
- Next token
next_tokentext - Next token.
- Limit
limitnumber - Limit.From 1 to 100. Default:
100.
Outputs
datalist- Response.
next_cursortext- Continuation token, when returned by the service.
Example output
{
"data": [],
"next_cursor": ""
}List snapshots
List saved sandbox snapshots, optionally for one sandbox or by name.
Inputs
- Sandbox
sandbox_idtext - Filter snapshots by source sandbox ID
- Name
nametext - Name.
- Limit
limitnumber - Limit.From 1 to 100. Default:
100. - Next token
next_tokentext - Next token.
Outputs
datalist- Response.
next_cursortext- Continuation token, when returned by the service.
Example output
{
"data": [],
"next_cursor": ""
}List templates
List the sandbox templates your team can start sandboxes from.
Inputs
- Team id
e2b_team_idtext - Identifier of the team, as its UUID or its public project ID (prj_)
- Next token
next_tokentext - Next token.
- Limit
limitnumber - Limit.From 1 to 100. Default:
100.
Outputs
datalist- Response.
next_cursortext- Continuation token, when returned by the service.
Example output
{
"data": [],
"next_cursor": ""
}List webhooks
List the webhooks that receive your team's sandbox events.
Inputs
None.
Outputs
datalist- Response.
next_cursortext- Continuation token, when returned by the service.
Example output
{
"data": [],
"next_cursor": ""
}Pause sandbox
Pause a running sandbox, keeping its files and memory so it can be resumed later.
Inputs
- Sandbox
sandbox_idtextRequired - Sandbox id.
- Memory
memorytrue/false - Whether to capture a full memory snapshot. When false, only the filesystem is persisted and resuming the sandbox cold-boots (reboots) it from disk, losing in-memory state, running processes, and open connections. Resume it with an explicit request (connect or resume); auto-resume, which can be triggered by arbitrary traffic, refuses such a sandbox. Defaults to true.Default:
true. - Require healthy guest
require_healthy_guesttrue/false - The pause checks that the sandbox guest agent answers before it takes the snapshot. By default an unresponsive agent is recorded on the snapshot and the pause proceeds; the sandbox then shows `envdUnresponsiveAtPause` and a later resume must ask for `memory: false`, since restoring that memory would bring the unresponsive agent back. With this true, the pause is instead refused with 503 while the agent does not answer, and the sandbox keeps running. A filesystem-only pause (`memory: false`) is aDefault:
false.
Outputs
dataobject- Response.
next_cursortext- Continuation token, when returned by the service.
Example output
{
"data": {},
"next_cursor": ""
}Set timeout
Set how many seconds from now a running sandbox stays up before it is stopped.
Inputs
- Sandbox
sandbox_idtextRequired - Sandbox id.
- Timeout
timeoutnumberRequired - Timeout in seconds from the current time after which the sandbox should expireAt least 0.
Outputs
dataobject- Response.
next_cursortext- Continuation token, when returned by the service.
Example output
{
"data": {},
"next_cursor": ""
}Update webhook
Change a webhook's name, address, events or whether it is turned on.
Inputs
- Webhook id
webhook_idtextRequired - Webhook id.
- Enabled
enabledtrue/false - Enabled.
- Events
eventslist - Events.
- Name
nametext - Webhook user friendly name
- Signature secret
signature_secrettext - Secret used to sign the webhook payloads
- Url
urltext - Url.
Outputs
dataobject- Webhook detail response
next_cursortext- Continuation token, when returned by the service.
Example output
{
"data": {
"createdAt": "example",
"enabled": false,
"events": [],
"id": "example",
"name": "example",
"teamId": "example",
"url": "example"
},
"next_cursor": ""
}