Skip to content

Sandbox Lifecycle Events API

RESTful endpoints to request latest sandbox lifecycle events. Track when sandboxes are created, paused, resumed, updated, or killed.

Authentication: Requires team API key

Query Parameters:

  • offset (optional): Number of events to skip (default: 0, min: 0)
  • limit (optional): Number of events to return (default: 10, min: 1, max: 100)
  • orderAsc (optional): Sort order - true=ascending, false=descending (default: false)

Endpoints:

Get events for specific sandbox:

javascript
import { Sandbox } from '@e2b/code-interpreter'

const sbx = await Sandbox.create()

const resp = await fetch(
  `https://api.e2b.app/events/sandboxes/${sbx.id}`,
  {
    method: 'GET',
    headers: {
      'X-API-Key': E2B_API_KEY,
    },
  }
)
const sandboxEvents = await resp.json()

Get events for all team sandboxes:

javascript
const resp = await fetch(
  'https://api.e2b.app/events/sandboxes?limit=10',
  {
    method: 'GET',
    headers: {
      'X-API-Key': E2B_API_KEY,
    },
  }
)
const teamSandboxEvents = await resp.json()

Event Types:

  • sandbox.lifecycle.created
  • sandbox.lifecycle.updated (includes set_timeout in eventData)
  • sandbox.lifecycle.paused
  • sandbox.lifecycle.resumed
  • sandbox.lifecycle.killed

Event Structure:

json
{
  "version": "v1",
  "id": "event-uuid",
  "type": "sandbox.lifecycle.killed",
  "eventData": null,
  "sandboxBuildId": "build-uuid",
  "sandboxExecutionId": "execution-uuid",
  "sandboxId": "sandbox-id",
  "sandboxTeamId": "team-uuid",
  "sandboxTemplateId": "template-id",
  "timestamp": "2025-08-06T20:59:36Z"
}

E2B Documentation • Generated from e2b.dev/docs