Self Help Documentation
< All Topics

accounts/listaccounts

Description

Lists all existing SPanel accounts currently on the server.

Parameters

FieldTypeRequiredDescription
tokenstringYesAuthorizing API token – check API Basics for more information.
actionstringYesThe category and function being executed.
accountuserstringNoThis parameter contains the SPanel user account name to obtain data for.

Example

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

$postData = [
  'token' => 'provided_auth_token',
  'action' => 'accounts/listaccounts',
 //Optional parameter:
  'accountuser' => 'spanelio',
];

$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 );Code language: PHP (php)

You can find more information about the Endpoint URL in our API Basics article.

Output

{
    "data": [
        {
            "domain": "testdomain.com",
            "user": "testuser",
            "ip": "123.123.123.123",
            "disk": "123",
            "inodes":"123",
            "homedir": "home",
            "numaddons": "0",
            "numsubdomains": "0",
            "numdatabases": "0",
            "numemails": "0",
            "numftpaccts": "0",
            "suspended": "0",
            "disklimit": "Unlimited",
            "inodeslimit": "Unlimited",
            "domainslimit": "Unlimited",
            "emailslimit": "Unlimited",
            "databaseslimit": "Unlimited",
            "setupDate": "01.10.2021",
            "package": "Custom"
        }
    ]
}Code language: JSON / JSON with Comments (json)
Table of Contents