Everstack
Api referenceSandbox

Sandbox

Sandbox APIs for isolated runtimes, lifecycle, networking, automation, and observability.

Sandbox API

Programmatic endpoints for treating sandboxes as isolated runtimes you can create, inspect, automate, expose, and destroy.

Sandboxes are not only for agents. The same API can be used to:

  • run isolated code execution
  • host temporary preview apps and expose them at the edge
  • create scheduled workers with crons
  • create HTTP-triggered workers with webhooks
  • inspect logs, metrics, events, and execution history
  • manage shell, files, ports, SSH access, and lifecycle

Common workflows

Create an isolated runtime

Start with POST /v1/sandbox to create a sandbox from a template or image, then use shell, files, commands, or code execution APIs inside it.

Host a temporary service

Create a sandbox, start a web process, detect or expose a listening port, and use the generated URL for previews, demos, or QA.

Run recurring or event-driven jobs

Use cron and webhook endpoints to turn a sandbox into a scheduled or HTTP-triggered worker.

Observe and debug

Use stats, events, and execution history to understand what happened inside the runtime.


Lifecycle

MethodEndpointDescription
POST/v1/sandboxCreate Sandbox
GET/v1/sandbox/instancesList Instances
GET/v1/sandbox/instances/{sandboxId}Get Instance
PATCH/v1/sandbox/instances/{sandboxId}Resize (CPU/memory)
GET/v1/sandbox/overviewOverview
POST/v1/sandbox/recreateRecreate
POST/v1/sandbox/{sandboxId}/stopStop
POST/v1/sandbox/{sandboxId}/reviveRevive from sleep
POST/v1/sandbox/instances/{sandboxId}/restoreRestore from archive
POST/v1/sandbox/{sandboxId}/terminateTerminate
DELETE/v1/sandbox/{sessionId}Destroy
POST/v1/sandbox/{sandboxId}/renew-expirationRenew Expiration

Lifecycle states

Sandboxes progress through these lifecycle_state values:

StateDescription
pendingCreation queued
creatingVM being provisioned
runningActive and reachable
stoppingShutting down
sleepingVM stopped, workspace preserved
revivingWaking from sleep
archivingCompressing to archive storage
archivedVM gone, workspace in cold storage. Restore with /restore.
terminatingBeing permanently deleted
terminatedPermanently deleted
failedUnrecoverable error

Create sandbox -- new fields

The following fields were added to POST /v1/sandbox in the Sandbox Overhaul:

FieldTypeDescription
labelsobjectKey-value metadata for filtering ({ "agent_id": "agt_123" }). Filterable via label_filter on List.
autoArchiveAfterDaysintegerDays before sleeping sandbox is archived. 0 = disabled. Default: 7.
autoDeleteAfterDaysintegerDays before sandbox is deleted. -1 = never (default). 0 = on stop.
networkBlockAllbooleanBlock all outbound egress. Always permits loopback, link-local, DNS.
networkAllowCidrsstring[]CIDR blocks to permit when networkBlockAll is true (max 10).
computerUsebooleanStart Xvfb + XFCE4 desktop at boot for GUI automation.
tailscaleAuthKeystringJoin sandbox to a Tailnet at boot via this ephemeral auth key.
mountsStorageMount[]FUSE-mount external S3/R2/GCS/Azure storage at boot.
snapshotIdstringUse a named snapshot's image instead of image.

Templates

MethodEndpointDescription
GET/v1/sandbox/templatesList Templates
GET/v1/sandbox/templates/{templateId}Get Template

Snapshots

Named, reusable environment templates. Create from a public image or an existing sandbox. Reference via snapshotId when creating sandboxes.

Note: Creating a snapshot from an existing sandbox currently captures the base image reference. Full filesystem snapshots (Firecracker-level) are planned for Phase 2 of snapshot support.

MethodEndpointDescription
POST/v1/snapshotsCreate snapshot { name, image? } or { name, from_sandbox_id }
GET/v1/snapshotsList snapshots
GET/v1/snapshots/{snapshotId}Get snapshot
DELETE/v1/snapshots/{snapshotId}Delete snapshot

Snapshot states: pendingactive | error. Auto-deactivated after 2 weeks of no use; reactivated on next use.


Volumes

Persistent FUSE-backed storage independent of sandbox lifecycle. Multiple sandboxes can mount the same volume simultaneously.

MethodEndpointDescription
POST/v1/volumesCreate volume { name }
GET/v1/volumesList volumes
DELETE/v1/volumes/{volumeId}Delete volume

Attach volumes at sandbox creation via the mounts field with type: "everstack-volume".


Command Execution

MethodEndpointDescription
GET/v1/sandbox/{sandboxId}/pingPing
POST/v1/sandbox/{sandboxId}/commandExecute Command (SSE)
DELETE/v1/sandbox/{sandboxId}/commandInterrupt Command
GET/v1/sandbox/{sandboxId}/command/status/{cmdId}Command Status
GET/v1/sandbox/{sandboxId}/command/{cmdId}/logsCommand Logs

Code Execution

MethodEndpointDescription
POST/v1/sandbox/{sandboxId}/code/contextCreate Code Context
GET/v1/sandbox/{sandboxId}/code/contextsList Code Contexts
GET/v1/sandbox/{sandboxId}/code/contexts/{contextId}Get Code Context
DELETE/v1/sandbox/{sandboxId}/code/contexts/{contextId}Delete Code Context
DELETE/v1/sandbox/{sandboxId}/code/contextsDelete by Language
POST/v1/sandbox/{sandboxId}/codeExecute Code (SSE)
DELETE/v1/sandbox/{sandboxId}/codeInterrupt Code

Filesystem

Standard file operations:

MethodEndpointDescription
GET/v1/sandbox/{sandboxId}/files/infoFile Info
DELETE/v1/sandbox/{sandboxId}/filesDelete Files
POST/v1/sandbox/{sandboxId}/files/permissionsFile Permissions
POST/v1/sandbox/{sandboxId}/files/mvMove Files
POST/v1/sandbox/{sandboxId}/files/replaceReplace in File
POST/v1/sandbox/{sandboxId}/files/uploadUpload File
GET/v1/sandbox/{sandboxId}/files/downloadDownload File
POST/v1/sandbox/{sandboxId}/directoriesCreate Directories
DELETE/v1/sandbox/{sandboxId}/directoriesDelete Directories

Bulk and search operations (added in Sandbox Overhaul):

MethodEndpointDescription
POST/v1/sandbox/{sandboxId}/files/bulk-uploadUpload multiple files (multipart, 256MB limit)
GET/v1/sandbox/{sandboxId}/files/content-searchSearch file contents (?pattern=&path=)
POST/v1/sandbox/{sandboxId}/files/global-replaceFind-and-replace across files ({ path, pattern, replacement, dry_run })

Metrics & Observability

MethodEndpointDescription
GET/v1/sandbox/{sandboxId}/metricsPoint-in-time stats
GET/v1/sandbox/{sandboxId}/metrics/watchStream stats (SSE, every 2s)
GET/v1/sandbox/{sandboxId}/metrics/historyTime-series history (30s resolution, 2h retention)
GET/v1/sandbox/metrics/batchLatest metrics for multiple sandboxes (?ids=id1,id2)
GET/v1/sandbox/{sandboxId}/eventsLifecycle events
GET/v1/sandbox/{sandboxId}/executionsExecution history

OTLP Export

Forward sandbox metrics to your own observability backend (New Relic, Grafana Cloud, Datadog, Honeycomb).

Preview: Metric forwarding to the OTLP endpoint is in development. The config API is live; metrics will be forwarded in a follow-up release.

MethodEndpointDescription
GET/v1/settings/otlpGet OTLP config
PUT/v1/settings/otlpSet OTLP config { endpoint, headers, extra_labels, enabled }
POST/v1/settings/otlp/testSend test span to configured endpoint

Ports & Preview URLs

MethodEndpointDescription
GET/v1/sandbox/{sessionId}/portsList Exposed Ports
POST/v1/sandbox/{sessionId}/portsExpose Port
GET/v1/sandbox/{sessionId}/ports/detectDetect Listening Ports
DELETE/v1/sandbox/{sessionId}/ports/{port}Unexpose Port
POST/v1/sandbox/instances/{sandboxId}/preview-urlGenerate signed preview URL

Signed preview URLs

POST /v1/sandbox/instances/{sandboxId}/preview-url generates an HMAC-signed URL that embeds auth in the URL itself -- no custom headers required. Useful for shareable links, iframe embeds, and link sharing.

{ "port": 3000, "expires_in_seconds": 3600 }

Response:

{ "url": "https://...", "expires_at": "2026-06-01T13:00:00Z" }

SSH

MethodEndpointDescription
POST/v1/sandbox/{sandboxId}/ssh/accessGrant SSH Access
DELETE/v1/sandbox/{sandboxId}/ssh/access/{userId}Revoke SSH Access
GET/v1/sandbox/{sandboxId}/ssh/infoSSH Info
POST/v1/sandbox/instances/{sandboxId}/ssh-tokenGenerate temporary SSH token
GET/v1/sandbox/instances/{sandboxId}/ssh-tokensList active SSH tokens
DELETE/v1/sandbox/instances/{sandboxId}/ssh-tokens/{tokenId}Revoke SSH token

SSH tokens

SSH tokens let agents and users SSH into sandboxes without key distribution. Connect via:

ssh <token>@ssh.everstack.ai

Tokens are temporary (default 60 minutes, max 24 hours) and can be revoked before expiry.

Note: The SSH proxy token validation is in development. Token generation and revocation APIs are live; proxy-level enforcement ships in a follow-up.


Language Server Protocol (LSP)

Get structured code intelligence inside sandboxes without parsing raw terminal output.

Requires the relevant tools installed in the sandbox image (pylint/pylsp for Python, tsc for TypeScript). The everstack-python and everstack-node catalog images include these by default.

MethodEndpointDescription
GET/v1/sandbox/{sandboxId}/lspLSP capability info
GET/v1/sandbox/{sandboxId}/lsp/{lang}/diagnostics?path=Errors and warnings
GET/v1/sandbox/{sandboxId}/lsp/{lang}/symbols?path=Functions, classes, variables in a file
GET/v1/sandbox/{sandboxId}/lsp/{lang}/workspace-symbols?query=Cross-file symbol search

Supported languages: python, typescript

Returns: Structured JSON with line numbers and severity -- not raw terminal output.


Computer Use

Full desktop automation for vision-capable agents. Requires computer_use: true on sandbox creation, which launches Xvfb + XFCE4 at boot.

Install xdotool, scrot/ImageMagick, and ffmpeg in your sandbox image for full functionality.

Screenshot

MethodEndpointDescription
GET/v1/sandbox/{sandboxId}/computerCapability info
POST/v1/sandbox/{sandboxId}/computer/screenshotTake screenshot (returns image bytes)
GET/v1/sandbox/{sandboxId}/computer/displaysList displays
GET/v1/sandbox/{sandboxId}/computer/windowsList open windows
{ "format": "jpeg", "quality": 85 }

Response: Content-Type: image/jpeg binary body.

Mouse & keyboard

MethodEndpointDescription
POST/v1/sandbox/{sandboxId}/computer/mouse/clickClick { x, y, button, double }
POST/v1/sandbox/{sandboxId}/computer/mouse/moveMove { x, y }
POST/v1/sandbox/{sandboxId}/computer/mouse/scrollScroll { x, y, direction, amount }
POST/v1/sandbox/{sandboxId}/computer/mouse/dragDrag { from: {x,y}, to: {x,y} }
POST/v1/sandbox/{sandboxId}/computer/keyboard/typeType text { text }
POST/v1/sandbox/{sandboxId}/computer/keyboard/keyKey combo { key } (e.g. "ctrl+c")

Screen recording

MethodEndpointDescription
POST/v1/sandbox/{sandboxId}/computer/recording/startStart recording { label, fps }
POST/v1/sandbox/{sandboxId}/computer/recording/stopStop recording { recording_id }
GET/v1/sandbox/{sandboxId}/computer/recordingsList recordings
GET/v1/sandbox/{sandboxId}/computer/recordings/{id}/downloadDownload MP4
DELETE/v1/sandbox/{sandboxId}/computer/recordings/{id}Delete recording

VNC access

When computer_use: true, deploy x11vnc and NoVNC in your sandbox image. NoVNC is then accessible on port 6080 via the preview URL infrastructure:

https://6080-{token}.preview.everstack.ai

Lifecycle Webhooks

Outgoing webhooks that notify your system when sandbox state changes.

These are outgoing lifecycle events -- distinct from the incoming trigger webhooks (/v1/sandbox/webhooks) used to invoke sandboxes.

MethodEndpointDescription
GET/v1/sandbox-webhooksList endpoints
POST/v1/sandbox-webhooksCreate endpoint { url, events, secret }
DELETE/v1/sandbox-webhooks/{id}Remove endpoint
GET/v1/sandbox-webhooks/{id}/deliveriesDelivery log (last 100)
POST/v1/sandbox-webhooks/{id}/testSend test payload

Events: sandbox.started, sandbox.stopped, sandbox.archived, sandbox.deleted, sandbox.error

All payloads are HMAC-SHA256 signed (X-Everstack-Signature: sha256=<hex>). 3 retries with 0s/5s/30s backoff.


Declarative Image Builder

Build sandbox environments from a spec in code, without maintaining a Docker registry.

Preview: Phase 1 maps specs to the nearest catalog image. Custom package installation via BuildKit build is in Phase 2.

MethodEndpointDescription
POST/v1/images/buildBuild from spec (24h cache)
{
  "spec": {
    "base": "debian:bookworm-slim",
    "apt": ["python3", "nodejs"],
    "pip": ["numpy", "pandas"],
    "npm": ["typescript"],
    "run": ["pip install -r requirements.txt"],
    "env": { "PYTHONPATH": "/app" },
    "workdir": "/app"
  }
}

Same spec within 24h returns the cached result instantly ("cached": true).


MCP Setup

Get the MCP server config block for your AI client with one call.

MethodEndpointDescription
GET/v1/mcp/config?client=claudeConfig block for Claude / Cursor / Windsurf

Supported clients: claude, cursor, windsurf.


Crons

MethodEndpointDescription
GET/v1/sandbox/cronsList Crons
POST/v1/sandbox/cronsCreate Cron
PATCH/v1/sandbox/crons/{id}Update Cron
DELETE/v1/sandbox/crons/{id}Delete Cron

Incoming Webhooks

MethodEndpointDescription
GET/v1/sandbox/webhooksList Webhooks
POST/v1/sandbox/webhooksCreate Webhook
DELETE/v1/sandbox/webhooks/{id}Delete Webhook

Triggers

MethodEndpointDescription
GET/v1/sandbox/triggersShared History

On this page