---
title: "Return mail directory's subdirectories and files"
method: GET
path: "/Email/browse_mailbox"
tags: ["Email", "Email Accounts"]
---

# Return mail directory's subdirectories and files

`GET /Email/browse_mailbox`

This function lists the mail directory's subdirectories (boxes) and files.

**Important:**

  When you disable the [*Receive Mail* role](https://go.cpanel.net/serverroles#roles), the system **disables** this function.

**Notes:**

  If you do not use any input parameters, the function returns a list of items in the cPanel account's main mail directory.

## Query parameters

- `account` string, email
- `dir` string
- `showdotfiles` 0 | 1

## Response `200`

HTTP Request was successful.

- object
  - `apiversion` integer — The version of the API.
  - `func` string — The name of the method called.
  - `module` string — The name of the module called.
  - `result` object
    - `data` object[]
      - `depth` integer — The directory depth of the item's path.
      - `file` string — The item's base name.
      - `fullpath` string, path — The item's absolute path.
      - `isleaf` 0 | 1 — Whether the item is a file or a directory. * `1` - File. * `0` - Directory.
      - `ismailbox` 0 | 1 — Whether the item is a mailbox. * `1` - Mailbox. * `0` - **Not** a mailbox.
      - `mtime` integer — The item's modification time. A time, in [Unix time](https://en.wikipedia.org/wiki/Unix_time) format.
      - `path` string, path — The item's directory's path.
      - `relpath` string, path — The item's relative path.
      - `type` 'dir' | 'file' — The item type. * `dir` - The item is a directory. * `file` - The item is a file.
    - `errors` string[], nullable — List of errors if the API failed.
    - `messages` string[], nullable — List of messages generated by the API.
    - `metadata` object
      - `transformed` 1 — Post-processing may have transformed the data.
    - `status` 0 | 1 — * `1` - Success. * `0` - Failed. Check the `errors` field for more details.
    - `warnings` string[], nullable — List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.

---

[API](https://skmtc.net/cpanel/apis/cpanel-uapi.md) · [All operations](https://skmtc.net/cpanel/apis/cpanel-uapi/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/cpanel/cpanel-uapi/revisions/632e2f8e6d04/schema)
