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

ActionWhat it does
Connect sandboxConnect to a sandbox, resuming it first if it is paused, and set how long it stays up.
Create sandboxStart a new sandbox from a template, with its own timeout, resources and environment variables.
Create webhookAdd a webhook that receives sandbox events at an address you choose.
Delete webhookDelete a webhook so it stops receiving sandbox events.
Get sandboxGet a sandbox's details, such as its template, state, resources and when it ends.
Get sandbox logsRead a sandbox's logs, optionally filtered by level or text.
Get sandbox metricsGet a sandbox's CPU, memory and disk use over a period.
Get templateGet a template's details and its builds.
Get webhookGet a webhook's details, such as its address and the events it receives.
Kill sandboxStop a sandbox straight away and discard it.
List eventsList recent sandbox lifecycle events across your team, such as sandboxes created, paused or killed.
List sandbox eventsList the lifecycle events of one sandbox.
List sandboxesList your running and paused sandboxes, optionally filtered by state, template or metadata.
List snapshotsList saved sandbox snapshots, optionally for one sandbox or by name.
List templatesList the sandbox templates your team can start sandboxes from.
List webhooksList the webhooks that receive your team's sandbox events.
Pause sandboxPause a running sandbox, keeping its files and memory so it can be resumed later.
Set timeoutSet how many seconds from now a running sandbox stays up before it is stopped.
Update webhookChange 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

Sandboxsandbox_idtextRequired
Sandbox id.
Memorymemorytrue/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
Timeouttimeoutnumber
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 keyidempotency_keytext
Idempotency key.
Allow internet accessallow_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 pauseauto_pausetrue/false
Automatically pauses the sandbox after the timeoutDefault: false.
Auto pause memoryauto_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 resumeauto_resumeobject
Auto-resume configuration for paused sandboxes.
Cpu countcpu_countnumber
CPU cores for the sandboxAt least 1.
Env varsenv_varstext
Env vars.
Iamiamobject
Sandbox workload identity configuration. A non-empty, valid tokens map enables workload identity for the sandbox.
Mcpmcpobject
MCP configuration for the sandbox
Metadatametadatatext
Metadata.
Networknetworkobject
Network.
Templatetemplate_idtextRequired
Identifier of the required template
Timeouttimeoutnumber
Time to live for the sandbox in seconds.At least 1. Default: 300.
Volume mountsvolume_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

Enabledenabledtrue/false
Enabled.Default: true.
EventseventslistRequired
Events.
NamenametextRequired
Name.
Signature secretsignature_secrettextRequired
Secret used to sign the webhook payloads
UrlurltextRequired
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 idwebhook_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

Sandboxsandbox_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

Sandboxsandbox_idtextRequired
Sandbox id.
Logs starting atcursordate and time
Start of the time window.
Limitlimitnumber
Limit.From 0 to 1000. Default: 1000.
Directiondirectiontext
Direction of the logs that should be returnedOne of: forward, backward.
Levelleveltext
State of the sandboxOne of: debug, info, warn, error.
Searchsearchtext
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

Sandboxsandbox_idtextRequired
Sandbox id.
Startstartdate and time
Start of the time window.
Endenddate 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

Templatetemplate_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 idwebhook_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

Sandboxsandbox_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

Offsetoffsetnumber
Offset.At least 0. Default: 0.
Limitlimitnumber
Limit.From 1 to 100. Default: 10.
Order ascorder_asctrue/false
Order asc.Default: false.
Typestypeslist
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

Sandboxsandbox_idtextRequired
Sandbox id.
Offsetoffsetnumber
Offset.At least 0. Default: 0.
Limitlimitnumber
Limit.From 1 to 100. Default: 10.
Order ascorder_asctrue/false
Order asc.Default: false.
Typestypeslist
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

Metadatametadatatext
Metadata.
Statestatelist
State.One or more of: running, paused.
Orderordertext
Sort directionOne of: asc, desc. Default: desc.
Started afterstarted_afterdate and time
Started after.
Templatetemplatetext
Template.
Next tokennext_tokentext
Next token.
Limitlimitnumber
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

Sandboxsandbox_idtext
Filter snapshots by source sandbox ID
Namenametext
Name.
Limitlimitnumber
Limit.From 1 to 100. Default: 100.
Next tokennext_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 ide2b_team_idtext
Identifier of the team, as its UUID or its public project ID (prj_)
Next tokennext_tokentext
Next token.
Limitlimitnumber
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

Sandboxsandbox_idtextRequired
Sandbox id.
Memorymemorytrue/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 guestrequire_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

Sandboxsandbox_idtextRequired
Sandbox id.
TimeouttimeoutnumberRequired
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 idwebhook_idtextRequired
Webhook id.
Enabledenabledtrue/false
Enabled.
Eventseventslist
Events.
Namenametext
Webhook user friendly name
Signature secretsignature_secrettext
Secret used to sign the webhook payloads
Urlurltext
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": ""
}

On this page