File Management
Get Workspace Diff
Get the cumulative git diff of all changes made by the agent in the sandbox workspace.
GET
This endpoint returns a unified git diff of all changes made by the agent in the sandbox workspace. If the workspace is a git repository, it produces a proper
git diff output. For non-git workspaces, it falls back to a pseudo-diff listing all file contents.
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.
Query Parameters
Workspace path to diff.Default:
/vercel/sandboxGit ref to diff against.
"HEAD"— diff staged + unstaged changes against HEAD (default)"initial"— diff from the very first commit to current working tree
base=initialResponse Fields
Unified diff output. Empty string if no changes.
The workspace path that was diffed.
Whether the workspace is a git repository.
The git ref used as the diff base.
null for non-git workspaces.Error Codes
| Status Code | Error | Description |
|---|---|---|
| 200 | Success | Diff 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 get diff |