< All Topics

admin/listadminuserpermissions

Description

Lists all available admin user permissions. Admin user permissions are expected to be used when working with an admin user, for example when using the admin/createadminuser and admin/updateadminpermissions API functions. This list is pulled real-time directly from the SPanel system.

Parameters

FieldTypeRequiredDescription
tokenstringYesAuthorizing API token – check API Basics for more information.
actionstringYesThe category and function being executed.
labelsboolNoDefault: false (unset). If set to true, API call results will include human-readable labels for each category and its pages.

Warning
The admin 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 (such as admin/manageadmins and accounts/packages for example).

Example

$endpointUrl = 'https://123.123.123.123/spanel/api.php';

$postData = [
  'token' => 'provided_auth_token', // Check API Basics for more information
  'action' => 'admin/listadminuserpermissions',
//'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

{
    "result": "success",
    "data": {
        "server": {
            "category": "server",
            "pages": [
                "information",
                "status",
                "settings",
                "resourceusage",
                "services",
                "restart"
            ]
        },
        "admin": {
            "category": "admin",
            "pages": [
                "branding",
                "manageadmins"
            ]
        },
        "accounts": {
            "category": "accounts",
            "pages": [
                "packages",
                "apitokens",
                "manage",
                "create",
                "suspended",
                "ssh"
            ]
        },
        "software": {
            "category": "software",
            "pages": [
                "webservermanager",
                "softaculous"
            ]
        },
        "mysql": {
            "category": "mysql",
            "pages": [
                "queries"
            ]
        }
    }
}
Previous admin/listadminusers
Next admin/createadminuser
Table of Contents