Page tree
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?user=username
 XML API
https://hostname.example.com:2087/cpsess##########/xml-api/acctcounts?user=username
 Command Line
whmapi0 acctcounts user=username

Notes:

  • You must URI-encode values.
  • For more information and additional output options, read our Guide to WHM API 0 documentation or run the whmapi0 --help command. 
  • We introduced this functionality in cPanel & WHM version 11.52.0.8.

 Output (JSON)
{  
   "reseller":{  
      "account":"root",
      "suspended":0,
      "active":9,
      "limit":""
   },
   "result":[  
      {  
         "statusmsg":"Obtained reseller account counts.",
         "status":1
      }
   ]
}
 Output (XML)
<acctcounts>
    <reseller>
        <account>root</account>
        <active>9</active>
        <limit/>
        <suspended>0</suspended>
    </reseller>
    <result>
        <status>1</status>
        <statusmsg>Obtained reseller account counts.</statusmsg>
    </result>
</acctcounts>

Parameters

ParameterTypeDescriptionPossible valuesExample
userstring

A reseller's username, to query only 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 account 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 user 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 user 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 user may create, if a maximum exists.

The function returns this value in the reseller hash.

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

result

array of hashes

An array of hashes of function information.

This hash includes the status and statusmsg returns.username

status

Boolean

Whether the function succeeded.

The function returns this value in the result hash.

  • 1 — Success.
  • 0 — Failure.

 

1

statusmsg

string

A message of success or a reason for failure.

The function returns this value in the result hash.

  • Ok
  • An error message.
Ok