Child pages
  • WHM API 1 Functions - acctcounts
Skip to end of metadata
Go to start of metadata

 

Description

This function lists a reseller's total accounts, suspended accounts, and account creation limit.

Examples


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/acctcounts?api.version=1&user=username
 XML API
https://hostname.example.com:2087/cpsess##########/xml-api/acctcounts?api.version=1&user=username
 Command Line
whmapi1 acctcounts user=username


Notes:

  • You must URI-encode values.
  • For more information and additional output options, read our Guide to WHM API 1 documentation or run the whmapi1 --help command.
  • If you run CloudLinux™, you must use the full path of the whmapi1 command:

    /usr/local/cpanel/bin/whmapi1

 Output (JSON)
{
  "data": {
    "reseller": {
      "suspended": 0,
      "user": "resell",
      "active": 0,
      "limit": ""
    }
  },
  "metadata": {
    "version": 1,
    "reason": "OK",
    "result": 1,
    "command": "acctcounts"
  }
}
 Output (XML)
<result>
    <data>
        <reseller>
            <suspended>0</suspended>
            <user>resell</user>
            <active>0</active>
            <limit/>
        </reseller>
    </data>
    <metadata>
        <version>1</version>
        <reason>OK</reason>
        <result>1</result>
        <command>acctcounts</command>
    </metadata>
</result>


Note:

Use WHM's API Shell interface (WHM >> Home >> Development >> API Shell) to directly test WHM API calls.

   

Parameters

ParameterTypeDescriptionPossible valuesExample
userstring

A reseller's username, to query that reseller.

If you do not specify a value, the function lists information for the authenticated account.

A valid WHM username on the server.

username

Returns

ReturnTypeDescriptionPossible valuesExample
resellerhashA hash of information for an account.This hash includes the account, suspended, active, and limit returns. 

account

string

The reseller account's username.

The function returns this value in the reseller hash.

  • root
  • A valid WHM username.
root

suspended

integer

The number of suspended accounts that the reseller account owns.

The function returns this value in the reseller hash.

A positive integer that represents a number of currently suspended accounts.5

active

integer

The number of active accounts that the reseller account owns.

The function returns this value in the reseller hash.

A positive integer that represents a number of currently active accounts.9

limit

integer

The maximum number of accounts that the reseller account may create, if a maximum exists.

The function returns this value in the reseller hash.

  • A positive integer that represents the reseller's account creation limit.
  • A null value, if the reseller does not have an account creation limit.
25