v1

latestOpenAPI 3.0.2cPanel License2026-08-06657427.1 MB
DirectoryProtection
Directory Protection

Return Directory Protection settings

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

get/DirectoryProtection/list_directories

Query parameters

dirstring path required
Example:/home/example/example.com

The absolute or relative file path in the user's home directory for which to return leech protection information.

Response

HTTP Request was successful.

apiversioninteger

The version of the API.

funcstring

The name of the method called.

modulestring

The name of the module called.

Example response

{
  "apiversion": 3,
  "func": "list_directories",
  "module": "DirectoryProtection",
  "result": {
    "data": {
      "children": [
        {
          "path": "/home/example/example.com/cgi-bin",
          "state": {
            "has_leech_protection": 1
          }
        }
      ],
      "current": {
        "path": "/home/example/example.com",
        "state": {
          "has_leech_protection": 1
        }
      },
      "home": {
        "path": "/home/example",
        "state": {
          "has_leech_protection": 1
        }
      },
      "parent": {
        "path": "/home/example",
        "state": {
          "has_leech_protection": 1
        }
      }
    },
    "status": 1
  }
}