Everstack
API ReferenceSandboxUpload File

Upload File

POST/v1/sandbox/{sandbox_id}/files/upload
POST/v1/sandbox/{'{sandbox_id}'}/files/upload

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

Description

Uploads a file into the sandbox filesystem at the destination path specified by the path query parameter. The request body may be a multipart/form-data upload or a raw binary body. If the parent directories do not exist they will be created automatically.

Path Parameters

ParameterTypeRequiredDescription
sandbox_idstringYesSandbox ID or name

Query Parameters

ParameterTypeRequiredDescription
pathstringYesAbsolute destination path inside the sandbox (e.g. /repo/data.csv)

Request Body

Send the file as a multipart/form-data field named file, or as a raw binary body with an appropriate Content-Type header.

Responses

201 Success

PropertyTypeDescription
statusstringAlways "uploaded" on success
pathstringThe absolute path where the file was written inside the sandbox

default An unexpected error response.

PropertyTypeDescription
codeinteger
messagestring
detailsobject[]

Request

curl -X POST "https://your-instance.example.com/v1/sandbox/sb_abc123/files/upload?path=/repo/data.csv" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: multipart/form-data" \
  -F "file=@/local/path/data.csv"
const fs = require("fs");

const formData = new FormData();
formData.append("file", new Blob([fs.readFileSync("/local/path/data.csv")]), "data.csv");

const response = await fetch(
  "https://your-instance.example.com/v1/sandbox/sb_abc123/files/upload?path=/repo/data.csv",
  {
    method: "POST",
    headers: {
      Authorization: "Bearer <token>",
    },
    body: formData,
  }
);

const data = await response.json();
console.log(data); // { status: "uploaded", path: "/repo/data.csv" }
import requests

with open("/local/path/data.csv", "rb") as f:
    response = requests.post(
        "https://your-instance.example.com/v1/sandbox/sb_abc123/files/upload",
        params={"path": "/repo/data.csv"},
        headers={"Authorization": "Bearer <token>"},
        files={"file": ("data.csv", f, "text/csv")},
    )

print(response.json())  # {"status": "uploaded", "path": "/repo/data.csv"}

Response

{"status": "uploaded", "path": "/repo/data.csv"}
{"code": 0, "message": "string", "details": [{"@type": "string"}]}