Docs
Dashboard
API reference / FilesBeta

Read a file or list a folder

A file comes back as an inert download (application/octet-stream, attachment). A folder, or list=1, gives a listing. Also works on a stopped session, read-only, from the workspace it saved (its stop archive, or the last checkpoint after a lost machine) without starting a machine; .boxline/ is left out and links are never followed. 409 nothing_saved when it saved no workspace. One request scans at most 1 GiB of the saved archive, and a stopped session's folder lists at most 10,000 entries (413 payload_too_large for both), and at most 8 such reads of a project run at once (429 archive_busy). Listing a file is 400 not_a_directory.

GET/v1/sessions/{id}/files

Request

Method and pathGET/v1/sessions/{id}/files
Base URLhttps://api.boxline.dev
AuthenticationYour API key in the x-api-key header (or Authorization: Bearer). The examples read it from BOXLINE_API_KEY.

Path parameters

NameTypeDefaultAllowed valuesDescription
idrequiredstring––

Query parameters

NameTypeDefaultAllowed valuesDescription
pathstring.–A path inside the workspace, e.g. downloads/report.csv.
liststring–1
curl -G "https://api.boxline.dev/v1/sessions/$SESSION_ID/files" \  -H "x-api-key: $BOXLINE_API_KEY" \  --data-urlencode "path=downloads/report.csv" \  -o report.csv# A folder listing instead: add --data-urlencode "list=1"

Responses

200 OK

The file's bytes, or a listing.

  • application/octet-stream: The file's bytes.
  • application/json: JSON.

Fields

NameTypeDefaultAllowed valuesDescription
pathstring––
entriesobject[]––
entries[].namestring––
entries[].typestring–file, dir, other
entries[].sizeinteger––
entries[].mtimestring––Format: date-time.
Response 200
{  "path": "/workspace/downloads/report.csv",  "entries": [    {      "name": "Work account",      "type": "file",      "size": 0,      "mtime": "2026-09-29T10:00:00.000Z"    }  ]}

Errors

Errors have a matching HTTP status and the same body. code is stable, so check it in your code; message is for people. See Errors and request ids.

StatusCodesWhen
400 Bad Requestinvalid_request, invalid_json, invalid_cursor, invalid_idempotency_key, invalid_extension, variables_with_extensions, terms_not_accepted, invalid_reset_token, invalid_confirmation_code, wrong_password, no_password, invalid_next, invalid_oauth_tokenThe request is not valid.
401 UnauthorizedunauthorizedMissing or invalid API key.
404 Not Foundnot_found, invite_not_found, provider_unavailableNo such thing in this project (or organization), or no such route.
409 Conflictsession_not_running, shell_disabled, browser_disabled, nothing_saved, not_resumable, invalid_state, conflict, email_taken, identity_in_use, provider_already_linked, last_sign_in_method, not_impersonating, machine_too_old, too_many_credential_values, limit_reached, terms_version_mismatch, no_project, last_owner, organization_not_empty, project_has_sessions, already_member, invite_pending, idempotency_in_progressThe current state does not allow it, or a request with this Idempotency-Key is still being answered.
Error body
{  "error": {    "code": "not_found",    "message": "session not found",    "requestId": "req_4fJx0aQm2Lk9Pz7N"  }}

Use with the browser

Work on what the browser downloaded: wait for the file, run Python on it in the same session, and read the result. See Browser, shell and files together.

curl -G https://api.boxline.dev/v1/sessions/$SESSION_ID/files/wait \  -H "x-api-key: $BOXLINE_API_KEY" \  --data-urlencode "pattern=downloads/*.csv"curl -X POST https://api.boxline.dev/v1/sessions/$SESSION_ID/shell/exec \  -H "x-api-key: $BOXLINE_API_KEY" \  -H "content-type: application/json" \  -d @- <<'JSON'{"command": "mkdir -p output && python3 -c \"import pandas as pd; print(pd.read_csv('downloads/report.csv')['revenue'].sum())\" > output/total.txt"}JSONcurl -G https://api.boxline.dev/v1/sessions/$SESSION_ID/files \  -H "x-api-key: $BOXLINE_API_KEY" \  --data-urlencode "path=output/total.txt"

Learn more

These docs describe a beta API. Endpoints, fields and SDK methods may change before general availability; breaking changes will be listed in the changelog.