---
title: "Delete a file or directory"
method: DELETE
path: "/sandboxes/{id}/files"
tags: ["Files"]
---

# Delete a file or directory

`DELETE /sandboxes/{id}/files`

## Request

- Base URL: `https://sandbox-as-a-service.com/v1`
- URL: `https://sandbox-as-a-service.com/v1/sandboxes/{id}/files`
- Auth: HTTP bearer

## Query parameters

- `path` string, required
- `recursive` boolean

## Response `200`

Deleted.

- object
  - `object` 'file', required
  - `sandbox_id` string, required
  - `path` string, required: Resolved absolute path inside the sandbox.
  - `deleted` boolean, required

## Other responses

- `400`: Invalid path.
- `404`: No such file, or no sandbox with that id.
- `409`: Sandbox is not running.

---

[API](https://skmtc.dev/sandbox-as-a-service/apis/sandbox-as-a-service-api.md) · [All operations](https://skmtc.dev/sandbox-as-a-service/apis/sandbox-as-a-service-api/llms.txt) · [OpenAPI document](https://skmtc.dev/sandbox-as-a-service/apis/sandbox-as-a-service-api/revisions/4f1ea2cf8333?raw)
