# Delete a file

> DELETE /v1/sandboxes/{sandboxId}/files

`DELETE https://api.zavu.dev/v1/sandboxes/{sandboxId}/files`

## Parameters

- `sandboxId` (path, string, required): Sandbox ID.
- `path` (query, string, required): Absolute, or relative to `/home/user`. Must resolve under `/home/user` or `/tmp`.
- `recursive` (query, boolean): Required to delete a directory.

## Responses

### 204

Deleted.

### 400

Missing or invalid `path`, or a directory without `recursive=true`.

- `code` (string, required)
- `message` (string, required)
- `details` (object)

### 401

Unauthorized.

- `code` (string, required)
- `message` (string, required)
- `details` (object)

### 404

Sandbox not found, or it belongs to another project.

- `code` (string, required)
- `message` (string, required)
- `details` (object)

### 409

`sandbox_not_running`: the sandbox is stopped, stopping, failed or deleted; resume it first. `sandbox_not_ready`: it is still starting and did not become ready in time; retry.

- `code` (string, required)
- `message` (string, required)
- `details` (object)

## Example

```bash
curl -X DELETE "https://api.zavu.dev/v1/sandboxes/sandbox_abc123/files?path=string" \
  -H "Authorization: Bearer $ZAVUDEV_API_KEY"
```

```typescript
import Zavudev from "@zavudev/sdk";

const zavu = new Zavudev({ apiKey: process.env.ZAVUDEV_API_KEY });

await zavu.sandboxes.files.delete("sandbox_abc123", {
  path: "string",
});
```
