POST /compat/e2b/envd/filesystem.Filesystem/ListDir
envd's `filesystem.Filesystem/ListDir` (the SDKs' `files.list`). Entries `depth` levels down (default 1, at most 8, at most 10,000 entries).

Header Parameters

X-Access-Token string required header
The sandbox's envd access token (`b3os_et_…`), from the create or connect answer.
E2b-Sandbox-Id string required header
The sandbox the call is for (`sandboxID` of the create answer). The token must be this sandbox's.

Request Body required

application/json
path string REQUIRED
depth integer

Responses

200 The entries.
application/json
entries object[]
Array of:
name string
type string
Enum: FILE_TYPE_FILE, FILE_TYPE_DIRECTORY, FILE_TYPE_SYMLINK
path string
size string
Bytes (an int64 in proto3 JSON).
mode integer
permissions string
modifiedTime string (date-time)
symlinkTarget string
401 The envd call is refused (`envd_token_invalid`), the same answer on every envd path whatever the reason, in E2B's error shape (Connect clients read the 401 as `unauthenticated`).
curl -X POST 'https://beta-api.b3os.org/compat/e2b/envd/filesystem.Filesystem/ListDir' \  -H 'Authorization: Bearer YOUR_API_TOKEN' \  -H 'X-Access-Token: string' \  -H 'E2b-Sandbox-Id: string' \  -H 'Content-Type: application/json' \  -d '{  "path": "/home/user",  "depth": 1}'
const response = await fetch('https://beta-api.b3os.org/compat/e2b/envd/filesystem.Filesystem/ListDir', {  method: 'POST',  headers: {      "Authorization": "Bearer YOUR_API_TOKEN",      "Content-Type": "application/json",      "X-Access-Token": "string",      "E2b-Sandbox-Id": "string"  },  body: JSON.stringify({    "path": "/home/user",    "depth": 1  })});const data = await response.json();console.log(data);
import requestsheaders = {    'Authorization': 'Bearer YOUR_API_TOKEN',    'X-Access-Token': 'string',    'E2b-Sandbox-Id': 'string'}response = requests.post('https://beta-api.b3os.org/compat/e2b/envd/filesystem.Filesystem/ListDir', headers=headers, json={  "path": "/home/user",  "depth": 1})print(response.json())
200 Response
{  "entries": [    {      "name": "hello.txt",      "type": "FILE_TYPE_FILE",      "path": "/home/user/hello.txt",      "size": "5",      "mode": 420,      "permissions": "-rw-r--r--",      "modifiedTime": "2026-11-02T13:00:00.000Z"    }  ]}
Ask a question... ⌘I