# Return mail directory's subdirectories and files

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

Important:

  When you disable the Receive Mail role, 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.

Endpoint: GET /Email/browse_mailbox
Version: 11.136.0.13
Security: BasicAuth

## Query parameters:

  - `account` (string)
    An email address, to limit the function's results.
    Example: "user@example.com"

  - `dir` (string)
    A mail directory name, to limit results to specific directories.

Note:

  If you pass the default or mail values, the function lists information for all mail directories.
    Example: "maildir"

  - `showdotfiles` (integer)
    Whether to include hidden files and directories.
* 1 — Include hidden items.
* 0 — Do not include hidden items.
    Enum: 0, 1

## Response 200 fields (application/json):

  - `apiversion` (integer)
    The version of the API.
    Example: 3

  - `func` (string)
    The name of the method called.
    Example: "browse_mailbox"

  - `module` (string)
    The name of the module called.
    Example: "Email"

  - `result` (object)

  - `result.data` (array)

  - `result.data.depth` (integer)
    The directory depth of the item's path.
    Example: 2

  - `result.data.file` (string)
    The item's base name.
    Example: "archive"

  - `result.data.fullpath` (string)
    The item's absolute path.
    Example: "/home/example/mail/archive"

  - `result.data.isleaf` (integer)
    Whether the item is a file or a directory.
* 1 - File.
* 0 - Directory.
    Enum: 0, 1

  - `result.data.ismailbox` (integer)
    Whether the item is a mailbox.
* 1 - Mailbox.
* 0 - Not a mailbox.
    Enum: 0, 1

  - `result.data.mtime` (integer)
    The item's modification time. A time, in [Unix time](https://en.wikipedia.org/wiki/Unix_time) format.
    Example: 1413398866

  - `result.data.path` (string)
    The item's directory's path.
    Example: "/home/example/mail"

  - `result.data.relpath` (string)
    The item's relative path.
    Example: "/archive"

  - `result.data.type` (string)
    The item type.
* dir - The item is a directory.
* file - The item is a file.
    Enum: "dir", "file"

  - `result.errors` (array,null)
    List of errors if the API failed.

  - `result.messages` (array,null)
    List of messages generated by the API.

  - `result.metadata` (object)

  - `result.metadata.transformed` (integer)
    Post-processing may have transformed the data.
    Enum: 1

  - `result.status` (integer)
    * 1 - Success.
* 0 - Failed. Check the errors field for more details.
    Enum: 0, 1

  - `result.warnings` (array,null)
    List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.


