File Management
Upload Files
Upload one or more files into the task’s sandbox workspace using multipart/form-data.
POST
This endpoint uploads one or more files into the sandbox workspace associated with a task run. Files are uploaded via
multipart/form-data. The target directory is created automatically if it doesn’t exist.
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_b41b647ffbfed27f616560Must be
multipart/form-data (set automatically by most HTTP clients when using form data).Path Parameters
The unique run identifier returned when the task was created.
Form Fields
One or more file fields. Each
file field uploads one file. You can include multiple file fields in a single request.Target directory inside the sandbox where files will be uploaded.Default:
/vercel/sandboxExample: path=/vercel/sandbox/uploadsResponse Fields
Array of successfully uploaded file entries.
Error Codes
| Status Code | Error | Description |
|---|---|---|
| 201 | Created | Files uploaded successfully |
| 400 | Bad Request | No files provided or invalid form data |
| 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 upload files |