---
title: "List box files"
method: GET
path: "/boxes/{boxId}/fs/list"
tags: ["File System"]
---

# List box files

`GET /boxes/{boxId}/fs/list`

Lists files and directories in a box. You can specify the directory path and depth, and optionally a working directory. The response includes metadata such as type, size, permissions, and last modified time.

## Path parameters

- `boxId` string, required

## Query parameters

- `workingDir` string
- `path` string, required
- `depth` number

## Response `200`

List files

- ListFileResult — Response containing directory listing results
  - `data` union[], required — Array of files and directories
    - union
      - File — File system file representation
        - `type` 'file', required — File type indicator
        - `name` string, required — Name of the file
        - `path` string, required — Full path to the file in the box
        - `size` string, required — Size of the file
        - `mode` string, required — File metadata
        - `lastModified` string, date-time, required — Last modified time of the file
      - Dir — File system directory representation
        - `type` 'dir', required — Directory type indicator
        - `name` string, required — Name of the directory
        - `path` string, required — Full path to the directory in the box
        - `mode` string, required — Directory metadata
        - `lastModified` string, date-time, required — Last modified time of the directory

## Other responses

- `404` — Directory 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)
