DirectoryPrivacy
Directory Privacy
Enable or disable protected directory
This function enables or disables password protection for a directory on the cPanel account.
get/DirectoryPrivacy/configure_directory_protection
Query parameters
authnamestring required
Example:protectandserve
The name of the directory protection authorization instance.
Note:
Only use this parameter when you enable password protection.
dirstring path required
Example:/home/example/example.com
The absolute or relative directory path for which to enable or disable password protection.
enabled0 | 1 required
Example:1
Whether to enable password protection for the directory.
- 1 - Enable.
- 0 - Disable.
Response
HTTP Request was successful.
Example response
{
"apiversion": 3,
"func": "configure_directory_protection",
"module": "DirectoryPrivacy",
"result": {
"data": {
"auth_name": "protectandserve",
"auth_type": "Basic",
"passwd_file": "/home/example/.htpasswds/example.com/passwd",
"protected": 1
},
"status": 1
}
}