GET /v1/sandboxes/{sandbox_id}/files/stat
Returns the entry at `path` without reading it: a directory's own entry (where `list=1` on `sandboxesReadFile` lists what is in it), and a symlink as a symlink with its `target`. Sandboxes whose template image predates this operation answer `409 guest_outdated`.

Authentication

Bearer Token (b3os_sk_ API key or b3os_pat_ token)

Path Parameters

sandbox_id string required path
The sandbox ID (`sbx_…`).
Example: "sbx_01m5t68q1b590rj801nbzsqzkk"

Query Parameters

path string required query
Absolute path inside the sandbox.
Example: "/workspace/main.py"

Responses

200 The entry.
application/json
name string REQUIRED
path string REQUIRED
type string REQUIRED
Enum: file, directory, symlink
size integer REQUIRED
mode string REQUIRED
Octal permission bits.
modified_at string (date-time) REQUIRED
target string
Symlink target.
400 The request failed validation (`invalid_request`, `invalid_url`).
401 Missing, malformed, expired or revoked credentials (`unauthorized`).
403 Authenticated but not allowed (`forbidden`, `egress_denied`).
404 Nothing exists at the path (`file_not_found`).
409 The sandbox's agent predates the operation (`guest_outdated`); also a sandbox that is not running (`sandbox_not_running`).
422 The path is not absolute, too long, or a parent is a file (`path_invalid`, `not_a_directory`).
429 A rate, concurrency or quota limit applies (`rate_limited`, `concurrency_limited`, `quota_exceeded`).
500 Something failed inside B3OS (`internal`). Retry with backoff.
502 The agent inside the microVM did not answer (`guest_unreachable`).
503 The node or the product is not available right now (`node_unavailable`, `product_unavailable`, `capacity_unavailable`).
curl -X GET 'https://beta-api.b3os.org/v1/sandboxes/sbx_01m5t68q1b590rj801nbzsqzkk/files/stat?path=%2Fworkspace%2Fmain.py' \  -H 'Authorization: Bearer YOUR_API_TOKEN'
const response = await fetch('https://beta-api.b3os.org/v1/sandboxes/sbx_01m5t68q1b590rj801nbzsqzkk/files/stat?path=%2Fworkspace%2Fmain.py', {  method: 'GET',  headers: {      "Authorization": "Bearer YOUR_API_TOKEN"  }});const data = await response.json();console.log(data);
import requestsheaders = {    'Authorization': 'Bearer YOUR_API_TOKEN'}response = requests.get('https://beta-api.b3os.org/v1/sandboxes/sbx_01m5t68q1b590rj801nbzsqzkk/files/stat?path=%2Fworkspace%2Fmain.py', headers=headers)print(response.json())
200 Response
{  "name": "data",  "path": "/workspace/data",  "type": "directory",  "size": 4096,  "mode": "0755",  "modified_at": "2026-10-25T19:00:10.000Z"}
Ask a question... ⌘I