This function adds a user who can access a protected directory on the cPanel account.
uapi --output=jsonpretty \ --user=username \ DirectoryPrivacy \ add_user \ dir='/home/example/example.com' \ user='example1' \ password='123456luggage'
{- "apiversion": 3,
- "func": "add_user",
- "module": "DirectoryPrivacy",
- "result": {
- "data": null,
- "errors": null,
- "messages": null,
- "metadata": { },
- "status": 1,
- "warnings": null
}
}