v1

latestOpenAPI 3.0.2cPanel License2026-08-06657427.1 MB
DirectoryPrivacy
Directory Privacy

Return whether directory uses password protection

This function confirms whether a directory uses password protection.

get/DirectoryPrivacy/is_directory_protected

Query parameters

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

The absolute directory path on the cPanel account to check for password protection.

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": "is_directory_protected",
  "module": "DirectoryPrivacy",
  "result": {
    "data": {
      "auth_name": "Protected 'example.com'",
      "auth_type": "Basic",
      "passwd_file": "/home/example/.htpasswds/example.com/passwd",
      "protected": 1
    },
    "status": 1
  }
}