E2B icon

E2B

Run commands and manage E2B sandboxes and snapshots

Sandbox → Get

AI-generated

Summary

Retrieve detailed information about an E2B sandbox either by its ID or by applying a metadata filter to find the first matching sandbox.

Inputs

  • Get By (required) — Select whether to retrieve the sandbox by its unique ID or by a metadata filter.
  • Sandbox ID (required) — The unique identifier of the sandbox to retrieve. Required when "Get By" is set to "ID".
  • Metadata Filter (required) — JSON object with key-value pairs that the sandbox must match. Used when "Get By" is set to "Metadata" to retrieve the first matching sandbox.
  • Timeout — Timeout in seconds for the API operation; defaults to 300 seconds.

Output shape

a single record

Returns detailed sandbox metadata including sandboxId, templateId, name, state, metadata, timestamps, resource allocations, version info, network and lifecycle details, and volume mounts.

Examples

Example 1: Retrieve sandbox by ID

Set 'Get By' to 'ID' and provide the 'Sandbox ID'. The operation returns the sandbox's details corresponding to that ID.

Example 2: Retrieve sandbox by metadata

Set 'Get By' to 'Metadata' and provide a JSON metadata filter. The operation returns the first sandbox matching all metadata key-value pairs.

Links

Discussion