File Management
List Workspace Files
List files and directories in the task’s sandbox workspace. Supports recursive listing.
GET
This endpoint lists files and directories inside the sandbox workspace associated with a task run. By default it lists the top-level contents of
/vercel/sandbox. Use the path and recursive parameters to navigate subdirectories.
Authentication
To use this API, you need a BLACKBOX API Key. Follow these steps to get your API key:- Go to app.blackbox.ai/agent-api and click Get an API Key (requires a Pro subscription)
- Once provisioning completes, you will be redirected to your Dashboard
- From the Dashboard, create an API key to use with all Agent API requests
sk-xxxxxxxxxxxxxxxxxxxxxx
Headers
API Key of the form
Bearer <api_key>.Example: Bearer sk_b41b647ffbfed27f616560Path Parameters
The unique run identifier returned when the task was created.Example:
a1b2c3d4-e5f6-7890-abcd-ef1234567890Query Parameters
Directory path to list inside the sandbox.Default:
/vercel/sandboxExample: path=/vercel/sandbox/srcWhether to list files recursively in all subdirectories.Default:
falseExample: recursive=trueResponse Fields
Array of file and directory entries.
The directory path that was listed.
Whether the listing was recursive.
Error Codes
| Status Code | Error | Description |
|---|---|---|
| 200 | Success | File list returned |
| 401 | Unauthorized | Invalid or missing API key |
| 403 | Forbidden | Task belongs to a different user |
| 404 | Not Found | Task not found or no sandbox available |
| 500 | Internal Server Error | Failed to list files |