Skip to main content
DELETE
/
sandboxes
/
{sandbox_id}
/
files
Remove File
curl --request DELETE \
  --url https://api.declaw.ai/sandboxes/{sandbox_id}/files \
  --header 'X-API-Key: <api-key>'
Removes the file or directory (recursively) at the given path inside the sandbox. Returns an empty {} body regardless of whether the path existed — the operation is idempotent.
Directory removal is recursive. All files and subdirectories under the specified path are permanently deleted.

Path Parameters

sandbox_id
string
required
The sandbox identifier. Format: sbx-<8 chars>.

Query Parameters

path
string
required
Absolute path of the file or directory to remove inside the sandbox.Example: /home/user/old-results/

Response

Returns an empty JSON object {}.

Example

curl -X DELETE "https://api.declaw.ai/sandboxes/sbx-a1b2c3d4/files?path=/home/user/old-results" \
  -H "X-API-Key: YOUR_API_KEY"
Response
{}

Error Responses

StatusCause
401Missing or invalid API key
404Sandbox not found
503Sandbox has no VM