Everstack
API ReferenceSandboxDownload File

Download File

GET/v1/sandbox/{sandbox_id}/files/download
GET/v1/sandbox/{'{sandbox_id}'}/files/download

Your instance endpoint, shown on the instance page in the dashboard. Each instance has its own host; there is no shared API host.

Description

Downloads a file from the sandbox filesystem. The response body is the raw binary content of the file. The server sets a Content-Disposition: attachment header containing the filename so that HTTP clients can save it with the correct name.

Path Parameters

ParameterTypeRequiredDescription
sandbox_idstringYesSandbox ID or name

Query Parameters

ParameterTypeRequiredDescription
pathstringYesAbsolute path to the file inside the sandbox (e.g. /repo/main.go)

Responses

200 Success

The response body is the raw binary content of the requested file.

HeaderDescription
Content-Typeapplication/octet-stream
Content-Dispositionattachment; filename="<filename>"

default An unexpected error response.

PropertyTypeDescription
codeinteger
messagestring
detailsobject[]

Request

curl -X GET "https://your-instance.example.com/v1/sandbox/sb_abc123/files/download?path=/repo/main.go" \
  -H "Authorization: Bearer <token>" \
  -O -J
const response = await fetch(
  "https://your-instance.example.com/v1/sandbox/sb_abc123/files/download?path=/repo/main.go",
  {
    method: "GET",
    headers: {
      Authorization: "Bearer <token>",
    },
  }
);

// Stream binary content to a local file (Node.js)
const { createWriteStream } = require("fs");
const dest = createWriteStream("./main.go");
response.body.pipe(dest);
import requests

response = requests.get(
    "https://your-instance.example.com/v1/sandbox/sb_abc123/files/download",
    params={"path": "/repo/main.go"},
    headers={"Authorization": "Bearer <token>"},
    stream=True,
)

with open("./main.go", "wb") as f:
    for chunk in response.iter_content(chunk_size=8192):
        f.write(chunk)

Response

Binary file content streamed in the response body.
Content-Type: application/octet-stream
Content-Disposition: attachment; filename="main.go"
{"code": 0, "message": "string", "details": [{"@type": "string"}]}