Skip to main content
GET
/
files
Download a file
curl --request GET \
  --url https://sandbox.{domain}/files \
  --header 'E2b-Sandbox-Id: <e2b-sandbox-id>' \
  --header 'E2b-Sandbox-Port: <e2b-sandbox-port>' \
  --header 'X-Access-Token: <api-key>'
"<string>"

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).

Query Parameters

path
string

Path to the file, URL encoded. Can be relative to user's home directory.

username
string

User used for setting the owner, or resolving relative paths.

signature
string

Signature used for file access permission verification.

signature_expiration
integer

Signature expiration used for defining the expiration time of the signature.

Response

Entire file downloaded successfully.

The file content