Skip to main content
GET
Download a file

Authorizations

X-Access-Token
string
header
required

Sandbox access token (envdAccessToken) for authenticating requests to a running sandbox. Returned by: POST /sandboxes (on create), POST /sandboxes/{sandboxID}/connect (on connect), POST /sandboxes/{sandboxID}/resume (on resume), and GET /sandboxes/{sandboxID} (for running or paused sandboxes).

Headers

E2b-Sandbox-Id
string
required

Identifier of the target sandbox. Routes the request to that sandbox's envd over the shared sandbox host.

E2b-Sandbox-Port
integer
default:49983
required

Port envd listens on inside the sandbox (default 49983).

Range
string

Byte range to download.

If-Modified-Since
string

Return 304 if the file has not changed since this HTTP date.

Accept-Encoding
string

Supported transfer encodings include gzip and identity. Range and conditional requests require acceptable identity encoding.

Query Parameters

path
string

Path to the file, URL encoded. Can be relative to the user's home directory (e.g. "file.txt" resolves to ~/file.txt).

username
string

User for setting file ownership and resolving relative paths. Defaults to the sandbox's default user.

signature
string

Signature used for file access permission verification.

signature_expiration
integer

Unix timestamp (seconds) after which the signature expires. Only used with the signature parameter.

Response

Entire file downloaded successfully. The Content-Type depends on the file. A gzip response uses the file extension's media type, or application/octet-stream as fallback.

The response is of type file.