Returns the immediate children (files and subdirectories) of the specified
directory path. Does not recurse into subdirectories.
Path Parameters
The sandbox identifier. Format: sbx-<8 chars>.
Query Parameters
Absolute path of the directory to list inside the sandbox.Example: /home/user
Response
Returns an array of EntryInfo objects, one per directory entry.
Entry filename or directory name (not the full path).
Full absolute path inside the sandbox.
Entry type: "file", "dir", or "symlink".
Size in bytes. 0 for directories.
Example
curl "https://api.declaw.ai/sandboxes/sbx-a1b2c3d4/files/list?path=/home/user" \
-H "X-API-Key: YOUR_API_KEY"
[
{
"name": "script.py",
"path": "/home/user/script.py",
"type": "file",
"size": 1024
},
{
"name": "data",
"path": "/home/user/data",
"type": "dir",
"size": 0
}
]
Error Responses
| Status | Cause |
|---|
401 | Missing or invalid API key |
404 | Sandbox not found |
502 | envd daemon unreachable |
503 | Sandbox has no VM |