Add authorized user for protected directory

This function adds a user who can access a protected directory on the cPanel account.

SecurityBasicAuth
Request
query Parameters
dir
required
string <path>

The directory to add users to.

Example: dir=/home/example/example.com
password
required
string

The password for the user.

Example: password=123456luggage
user
required
string

The username of the user who can access the directory.

Example: user=example1
Responses
200

HTTP Request was successful.

Response Schema: application/json
apiversion
integer

The version of the API.

func
string

The name of the method called.

module
string

The name of the module called.

object
get/DirectoryPrivacy/add_user
Request samples
uapi --output=jsonpretty \
  --user=username \
  DirectoryPrivacy \
  add_user \
  dir='/home/example/example.com' \
  user='example1' \
  password='123456luggage'
Response samples
application/json
{
  • "apiversion": 3,
  • "func": "add_user",
  • "module": "DirectoryPrivacy",
  • "result": {
    • "data": null,
    • "errors": null,
    • "messages": null,
    • "metadata": { },
    • "status": 1,
    • "warnings": null
    }
}