Return cPanel accounts

This function lists the accounts on the server.

SecurityBasicAuth
Request
query Parameters
search
string

A Perl Compatible Regular Expression (PCRE) that filters the results.

Note:

  • The system matches the PCRE against the searchtype parameter's specified type.
  • If you do not specify a value for both the searchtype and search parameters, the function returns all of the server's accounts.
Example: search=username
searchmethod
string

The function's search method.

  • exact - The matched value and the search value must be identical.
  • regex - The matched value must contain the search value.
Enum: "exact" "regex"
Example: searchmethod=exact
searchtype
string

The account information to query. If you do not specify a value for both the searchtype and search parameters, the function returns all of the server's accounts.

  • domain - Match domains against the search regular expression.
  • owner - Match the WHM user who owns the account against the search regular expression.
  • user - Match usernames against the search regular expression.
  • ip - Match IP addresses against the search regular expression.
  • package - Match hosting plans (packages) against the search regular expression.
Enum: "domain" "owner" "user" "ip" "package"
Example: searchtype=domain
want
string

The returns to include in the output for each account.

If you do not specify a value, the function's output includes all of its returns.

Example: want=domain,diskused
Responses
200

HTTP Request was successful.

Response Schema: application/json
object
object
get/listaccts
Request samples
whmapi1 --output=jsonpretty \
  listaccts
Response samples
application/json
{
  • "data": {
    • "acct": [
      • {
        • "backup": 0,
        • "child_nodes": [
          • {
            • "alias": "nodealias",
            • "workload": "Mail"
            }
          ],
        • "disklimit": "unlimited",
        • "diskused": "14M",
        • "domain": "example.com",
        • "email": "username@example.com",
        • "has_backup": 1,
        • "inodeslimit": "unlimited",
        • "inodesused": 1,
        • "ip": "192.168.0.128",
        • "ipv6": [
          • "0101:ca75:0101:ca75:0101:ca75:0101:ca77"
          ],
        • "is_locked": 0,
        • "legacy_backup": 0,
        • "mailbox_format": "mdbox",
        • "max_defer_fail_percentage": "unlimited",
        • "max_email_per_hour": "unlimited",
        • "max_emailacct_quota": "unlimited",
        • "maxaddons": "unlimited",
        • "maxftp": "unlimited",
        • "maxlst": "unlimited",
        • "maxparked": "unlimited",
        • "maxpop": "unlimited",
        • "maxsql": "unlimited",
        • "maxsub": "unlimited",
        • "min_defer_fail_to_trigger_protection": "unlimited",
        • "outgoing_mail_hold": 1,
        • "outgoing_mail_suspended": 0,
        • "owner": "root",
        • "partition": "home",
        • "plan": "packagename",
        • "shell": "/bin/bash",
        • "startdate": "13 May 22 16:03",
        • "suspended": 0,
        • "suspendreason": "not suspended",
        • "suspendtime": 1594040856,
        • "temporary": 0,
        • "theme": "jupiter",
        • "uid": 1001,
        • "unix_startdate": 1369256589,
        • "user": "username"
        }
      ]
    },
  • "metadata": {
    • "command": "listaccts",
    • "reason": "OK",
    • "result": 1,
    • "version": 1
    }
}