- Created by Documentation, last modified on Apr 09, 2018
Description
This function queries the accounts on the server.
Examples
https://hostname.example.com:2087/cpsess##########/json-api/listaccts?search=username&searchtype=user
https://hostname.example.com:2087/cpsess##########/xml-api/listaccts?search=username&searchtype=user
whmapi0 listaccts search=username searchtype=user
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. If you run CloudLinux™, you must use the full path of the
whmapi0
command:/usr/local/cpanel/bin/whmapi0
{ "acct":[ { "maxaddons":"unlimited", "ip":"10.0.0.1", "outgoing_mail_suspended": 0, "outgoing_mail_hold": 0, "min_defer_fail_to_trigger_protection":"5", "legacy_backup":0, "diskused":"14M", "maxftp":"unlimited", "startdate":"13 May 22 16:03", "max_defer_fail_percentage":"unlimited", "disklimit":"500M", "is_locked":0, "suspendtime":null, "email":"user@example.com", "domain":"example.com", "unix_startdate":1369256589, "user":"username", "plan":"extensions_username_username", "shell":"/bin/bash", "maxpop":"unlimited", "backup":0, "theme":"paper_lantern", "owner":"root", "max_email_per_hour":"unlimited", "ipv6":[ ], "suspendreason":"not suspended", "maxlst":"unlimited", "suspended":0, "maxsql":"unlimited", "maxparked":"unlimited", "partition":"home", "maxsub":"unlimited" } ], "statusmsg":"Ok", "status":1 }
<listaccts> <acct> <backup>0</backup> <disklimit>500M</disklimit> <diskused>14M</diskused> <domain>example.com</domain> <email>user@example.com</email> <ip>10.0.0.1</ip> <ipv6></ipv6> <is_locked>0</is_locked> <legacy_backup>0</legacy_backup> <max_defer_fail_percentage>unlimited</max_defer_fail_percentage> <max_email_per_hour>unlimited</max_email_per_hour> <maxaddons>unlimited</maxaddons> <maxftp>unlimited</maxftp> <maxlst>unlimited</maxlst> <maxparked>unlimited</maxparked> <maxpop>unlimited</maxpop> <maxsql>unlimited</maxsql> <maxsub>unlimited</maxsub> <min_defer_fail_to_trigger_protection>5</min_defer_fail_to_trigger_protection> <outgoing_mail_suspended>0</outgoing_mail_suspended> <outgoing_mail_hold>0</outgoing_mail_hold> <owner>root</owner> <partition>home</partition> <plan>extensions_username_username</plan> <shell>/bin/bash</shell> <startdate>13 May 22 16:03</startdate> <suspended>0</suspended> <suspendreason>not suspended</suspendreason> <suspendtime/> <theme>paper_lantern</theme> <unix_startdate>1369256589</unix_startdate> <user>username</user> </acct> <status>1</status> <statusmsg>Ok</statusmsg> </listaccts>
Parameters
Parameter | Type | Description | Possible values | Example |
---|---|---|---|---|
searchtype | string | The account information to query. If you do not specify a value for both the |
| domain |
search | string | A Perl Compatible Regular Expression (PCRE) that filters the results. The system matches the PCRE against the If you do not specify a value for both the | A valid PCRE. | username |
Returns
Return | Type | Description | Possible values | Example |
---|---|---|---|---|
acct | array of hashes | A hash of account data. | This hash includes the backup , disklimit , diskused , domain , email , ip , is_locked , legacy_backup , max_defer_fail_percentage , max_email_per_hour , maxaddons , maxftp , maxlst , maxparked , maxpop , maxsql , maxsub , min_defer_fail_to_trigger_protection , owner , partition , outgoing_mail_suspended, outgoing_mail_hold, plan , shell , startdate , suspended , suspendreason , suspendtime , theme , unix_startdate , and user returns. | |
| Boolean | Whether backups are enabled. The function returns this value in the |
| 0 |
| string | The account's disk space quota. The function returns this value in the |
| unlimited |
| string | The account's current disk space usage. The function returns this value in the | An integer that represents an amount of disk space, in Megabytes (MB). For example, | 14M |
| string | The account's main domain. The function returns this value in the | A valid domain name on the account. | example.com |
| string | The account's contact email address. The function returns this value in the | A valid email address. | username@example.com |
| string | The account's main domain's IP address. The function returns this value in the | A valid IPv4 address. | 192.168.0.128 |
| string | The account's main domain's IPv6 address The function returns this value in the | A valid IPv6 address. | 0101:ca75:0101:ca75:0101:ca75:0101:ca77 |
| Boolean | Whether the account is currently locked. The function returns this value in the |
| 0 |
| Boolean | Whether legacy backups are enabled. The function returns this value in the |
| 0 |
| string | The percentage of failed or deferred email messages that the account can send per hour before the system rate-limits outgoing mail. The function returns this value in the |
| unlimited |
| string | The maximum number of emails that the account can send in one hour. The function returns this value in the |
| unlimited |
| string | The account's maximum number of addon domains. The function returns this value in the |
| unlimited |
| string | The account's maximum number of FTP accounts. The function returns this value in the |
| unlimited |
| string | The account's maximum number of mailing lists. The function returns this value in the |
| unlimited |
| string | The account's maximum number of parked domains (aliases). The function returns this value in the |
| unlimited |
| string | The account's maximum number of email addresses. The function returns this value in the |
| unlimited |
| string | The account's maximum number of each available type of SQL database. For example, if you set this value to The function returns this value in the |
| unlimited |
| string | The account's maximum number of subdomains. The function returns this value in the |
| unlimited |
| string | The minimum number of failed or deferred messages that the account can send before outgoing mail is subject to rate-limiting. The function returns this value in the |
| 5 |
| Boolean | Whether to suspend outgoing email from the account's users and force failure of any of their mail currently in the mail queue. Note: If mail for a cPanel user's account is suspended, the system will reject their email before the system puts it in the mail server queue. The function returns this value in the Note: We added this parameter in cPanel & WHM version 56. |
| 0 |
| Boolean | Whether to retain outgoing mail in the mail queue for the account's users. The function returns this value in the Note: We added this parameter in cPanel & WHM version 56. |
| 0 |
| string | The account's owner. The function returns this value in the |
| root |
| string | The partition that contains the account's home directory. The function returns this value in the | The name of a partition on the server. | home |
| string | The account's hosting package. The function returns this value in the | The name of a package on the server. | packagename |
| string | The account's shell. The function returns this value in the | The absolute path of a shell location on the server. | /bin/bash |
| string | The account creation date. The function returns this value in the | The date in
| 13 May 22 16:03 |
| Boolean | Whether the account is currently suspended. The function returns this value in the |
| 0 |
| string | The reason for account suspension, if the suspender provided one. The function returns this value in the |
| not suspended |
| string | The time of suspension. The function returns this value in the |
| null |
| string | The account's cPanel interface theme. The function returns this value in the |
| paper_lantern |
| string | The account creation date. The function returns this value in the | The account creation date and time, in Unix time format. | 1369256589 |
| string | The account username. The function returns this value in the | The user parameter's value. | username |
| Boolean | Whether the system successfully called the function. |
| 1 |
statusmsg | string | A message of success or a reason for failure. |
| Ok
|
Function information
API Version:
WHM API 1 Equivalent:
Important:
We strongly recommend that you use WHM API 1. WHM API 0 is deprecated.
Available in:
WHM 11+
Methods:
GET, POST
Required Parameters:
(none)
Return Formats:
About WHM API 0
Warning:
WHM API 0 is deprecated. We strongly recommend that you use the equivalent WHM API 1 function instead.
Notes:
- Some functions and parameters may require that you authenticate as the
root
user. - You must use the appropriate WHM ports (
2086
or2087
) to call WHM API functions.
Find a function
Related functions
-
Page:WHM API 0 Functions - accountsummary — This function retrieves a user's account summary.
-
Page:WHM API 0 Functions - gethostname — This function retrieves the server's hostname.
-
Page:WHM API 0 Functions - createacct — This function creates a cPanel account.
-
Page:WHM API 0 Functions - domainuserdata — This function retrieves domain data.
-
Page:WHM API 0 Functions - editquota — This function modifies a user's disk quota.