WHM API 1 outputs data in either JSON or XML format.

 The output format depends on the options that you choose when you call the function.

  • We strongly recommend that you use JavaScript Object Notation (JSON).
  • Extensible Markup Language (XML) requires additional computational resources, and has complex requirements that can cause difficulty during the development process. This API's XML output is not compliant with XML standards, and it may result in validation errors.

Basic return data  

Both JSON and XML output return data as hashes or arrays of hashes. All WHM API 1 function output follows the following basic structure:

  • A top-level hash contains the data and metadata hashes. In XML output, <result> tags wrap the top-level hash of output.
    • The data hash contains the function's output parameters.
    • The  metadata hash contains the function's metadata parameters.


  • WHM API 1 function documentation does not include metadata parameters in the table of return parameter information. 
  • WHM API 1 calls via the command line do not return the metadata that other methods return if they experience errors that prevent a successful function run. To check for errors in code that calls WHM API 1 functions via the command line, validate the command line return for a nonzero exit code instead.

The metadata hash includes the following output parameters:

Metadata parameterTypeDescriptionPossible valuesExample
versionintegerThe WHM API version.For WHM API 1 functions, this value is always 1.1
reasonstringA message of success, or a reason for failure.
  • OK
  • An error message.
resultBooleanWhether the function succeeded.
  • 1 — Success.
  • 0 — Failure.
commandstringThe WHM API 1 function name.Any WHM API 1 function's name.listaccts

If the function returns a hash with a single key whose value is an array, the metadata will include the payload_is_literal output parameter with a value of 1. You will only receive this parameter when you call WHM API's rename_mysql_database or rename_mysql_user functions, or when you call certain UAPI functions via WHM API.


The accountsummary function's output is typical of WHM API 1 output:

  "data": {
    "acct": [
        "maxaddons": "unlimited",
        "ip": "",
        "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": "unlimited",
        "is_locked": 0,
        "suspendtime": null,
        "email": "",
        "domain": "",
        "unix_startdate": 1369256589,
        "user": "user",
        "plan": "extensions_user_user",
        "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"
  "metadata": {
    "version": 1,
    "reason": "OK",
    "result": 1,
    "command": "accountsummary"


            <startdate>13 May 22 16:03</startdate>
            <suspendreason>not suspended</suspendreason>