Everstack
API ReferenceSandboxDelete Directories

Delete Directories

DELETE/v1/sandbox/{sandbox_id}/directories
DELETE/v1/sandbox/{'{sandbox_id}'}/directories

Your instance endpoint, shown on the instance page in the dashboard. Each instance has its own host; there is no shared API host.

Description

Deletes one or more directories from the sandbox filesystem, including all of their contents recursively (equivalent to rm -rf). Paths that do not exist are silently ignored.

Path Parameters

ParameterTypeRequiredDescription
sandbox_idstringYesSandbox ID or name

Request Body

PropertyTypeRequiredDescription
pathsstring[]YesList of absolute directory paths to delete inside the sandbox

Responses

200 Success

PropertyTypeDescription
statusstringAlways "deleted" on success

default An unexpected error response.

PropertyTypeDescription
codeinteger
messagestring
detailsobject[]

Request

curl -X DELETE "https://your-instance.example.com/v1/sandbox/sb_abc123/directories" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{"paths":["/repo/tmp"]}'
const response = await fetch(
  "https://your-instance.example.com/v1/sandbox/sb_abc123/directories",
  {
    method: "DELETE",
    headers: {
      Authorization: "Bearer <token>",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      paths: ["/repo/tmp"],
    }),
  }
);

const data = await response.json();
console.log(data); // { status: "deleted" }
import requests

response = requests.delete(
    "https://your-instance.example.com/v1/sandbox/sb_abc123/directories",
    headers={"Authorization": "Bearer <token>"},
    json={"paths": ["/repo/tmp"]},
)

print(response.json())  # {"status": "deleted"}

Response

{"status": "deleted"}
{"code": 0, "message": "string", "details": [{"@type": "string"}]}