Skip to main content
GET
/
api
/
v1
/
files
Read a file
curl --request GET \
  --url https://{sandbox_id_or_name}.sandbox.tensorlake.ai/api/v1/files \
  --header 'Authorization: Bearer <token>'
"<string>"
Read a file from a sandbox path.

Endpoint

GET /api/v1/files?path=<absolute-or-relative-path>

Example Request

curl "https://<sandbox-id>.sandbox.tensorlake.ai/api/v1/files?path=/workspace/data.csv" \
  -H "Authorization: Bearer $TENSORLAKE_API_KEY"

Response

Tensorlake returns 200 OK with Content-Type: application/octet-stream and the raw file bytes. If the path points to a directory, Tensorlake returns 400 Bad Request. If the file does not exist, Tensorlake returns 404 Not Found. Paths containing .. are rejected with 403 Forbidden.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

path
string
required

Absolute or relative file path inside the sandbox.

Response

File contents

The response is of type file.