# Return Directory Protection settings

This function returns the
leech protection
settings of the subdirectories in a directory.

Endpoint: GET /DirectoryProtection/list_directories
Version: 11.136.0.25
Security: BasicAuth

## Query parameters:

  - `dir` (string, required)
    The absolute or relative file path in the user's home directory for which to return leech protection information.
    Example: "/home/example/example.com"

## Response 200 fields (application/json):

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

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

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

  - `result` (object)

  - `result.data` (object)

  - `result.data.children` (array)
    A list of subdirectories and their leech protection information.

Note:

The function returns a list for each subdirectory in a directory.

  - `result.data.children.path` (string)
    The subdirectory's absolute directory path.
    Example: "/home/example/example.com/cgi-bin"

  - `result.data.children.state` (object)
    A object containing the subdirectory's leech protection information.

  - `result.data.children.state.has_leech_protection` (integer)
    The directory's leech protection status.

* 1 — Leech protection is enabled.
* 0 — Leech protection is disabled.
    Enum: 1, 0

  - `result.data.current` (object)
    The user's current directory and its leech protection information.

  - `result.data.current.path` (string)
    The current directory's absolute file path.
    Example: "/home/example/example.com"

  - `result.data.current.state` (object)
    An object containing the current directory's leech protection information.

  - `result.data.current.state.has_leech_protection` (integer)
    The current directory's leech protection status.

* 1 — Leech protection is enabled.
* 0 — Leech protection is disabled.
    Enum: 1, 0

  - `result.data.home` (object)
    The user's home directory and its leech protection information.

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

  - `result.data.home.state` (object)
    A object containing the home directory's leech protection information.

  - `result.data.home.state.has_leech_protection` (integer)
    The home directory's leech protection status.

* 1 — Leech protection is enabled.
* 0 — Leech protection is disabled.
    Enum: 1, 0

  - `result.data.parent` (object)
    The parent directory of the current directory and its leech protection information.

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

  - `result.data.parent.state` (object)
    An object containing the parent directory's leech protection information.

  - `result.data.parent.state.has_leech_protection` (integer)
    The parent directory's leech protection status.

* 1 — Leech protection is enabled.
* 0 — Leech protection is disabled.
    Enum: 1, 0

  - `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.status` (integer)
    * 1 — Success.
* 0 — Failed. Check the errors field for more details.
    Enum: 1, 0

  - `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.


