Self Help Documentation
accounts/listuserpermissions
Description
Lists all available user permissions. This list is pulled real-time directly from the SPanel system.
Alias of user/listuserpermissions for admin usage.
Parameters
Field | Type | Required | Description |
---|---|---|---|
token | string | Yes | Authorizing API token – check API Basics for more information. |
action | string | Yes | The category and function being executed. |
labels | bool | No | Default: false (unset). If set to true, API call results will include human-readable labels for each category and its pages. |
Warning
The user permissions are subject to change overtime as we add new features to SPanel. A good idea is to run a cron to update these permissions in your system regularly if you are using some form of caching.
Info
Please note that the permission list differs from the categories and pages placement that you can see in the SPanel UI because of the way the functions are organized into categories in the SPanel API.
Example
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
$endpointUrl = 'https://123.123.123.123/spanel/api.php'; $postData = [ 'token' => 'provided_auth_token', // Check API Basics for more information 'action' => 'accounts/listuserpermissions', //'labels' => true ]; $ch = curl_init(); curl_setopt( $ch, CURLOPT_URL, $endpointUrl); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt( $ch, CURLOPT_POST, true); curl_setopt( $ch, CURLOPT_POSTFIELDS, http_build_query($postData)); curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt( $ch, CURLOPT_SSL_VERIFYHOST, false); $jsonOutput = curl_exec( $ch ); |
You can find more information about the Endpoint URL in our API Basics article.
Output
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
{ "result": "success", "data": { "email": { "category": "email", "pages": [ "accounts", "forwarders", "mailroute", "catchall", "webmaillogin", "autoresponders", "spamassassin", "filters" ] }, "mysql": { "category": "mysql", "pages": [ "databases", "getphpmyadmin" ] }, "user": { "category": "user", "pages": [ "manageusers", "pwreset", "language", "contactmail", "loginsecurity" ] }, "domain": { "category": "domain", "pages": [ "domains", "subdomains", "dnseditor", "redirects" ] }, "file": { "category": "file", "pages": [ "ftpaccounts", "backups", "restorebackup", "getftpmanager", "diskusage" ] }, "tool": { "category": "tool", "pages": [ "ssl", "cron", "phpmanager", "phpinieditor", "resourceusage" ] }, "software": { "category": "software", "pages": [ "wpmanager", "joomlamanager", "nodejsmanager", "getsoftaculous" ] } } } |