---
title: "Delete box file/dir"
method: DELETE
path: "/boxes/{boxId}/fs"
tags: ["File System"]
---

# Delete box file/dir

`DELETE /boxes/{boxId}/fs`

Deletes a file or a directory. If target path doesn't exist, the delete will fail.

## Path parameters

- `boxId` string, required

## Request body

- DeleteFile — Request parameters for deleting a file/directory
  - `workingDir` string — Working directory. If not provided, the file will be read from the `box.config.workingDir` directory.
  - `path` string, required — Target path in the box. If the path does not start with '/', the file/directory will be deleted relative to the working directory. If the target path does not exist, the delete will fail.

## Response `200`

Delete file/dir

- DeleteFileResult — Response after deleting file/directory
  - `message` string, required — Success message

## Other responses

- `404` — File/dir not found

---

[API](https://skmtc.dev/babelcloud/apis/gbox-open-api.md) · [All operations](https://skmtc.dev/babelcloud/apis/gbox-open-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/babelcloud/gbox-open-api/revisions/d655577fa915/schema)
