We have a new documentation site for cPanel & WHM! You can find our new documentation site at docs.cpanel.net.

We will continue to maintain our API documentation on this server.

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

Description

This function returns the system's cPanel accounts and the linked cPanel & WHM server on which they exist.

Examples


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/list_user_child_nodes?api.version=1
 Command Line
whmapi1 list_user_child_nodes


Notes:

  • Unless otherwise noted, 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" : {
      "payload" : [
         {
            "user" : "username1",
            "type" : "Mail",
            "alias" : "MailServer1"
         },
         {
            "user" : "username2",
            "type" : "Mail",
            "alias" : "MailServer1"
         },
         {
            "user" : "username3",
            "type" : "Mail",
            "alias" : "MailServer1"
         }
      ]
   },
   "metadata" : {
      "version" : 1,
      "reason" : "OK",
      "command" : "list_user_child_nodes",
      "result" : 1
   }
}


Note:

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

Parameters

This function does not accept parameters.

Returns

ReturnTypeDescriptionPossible valuesExample
payloadarray of hashes

An array containing a list of cPanel accounts and the linked cPanel & WHM servers on which they exist.

This array contains the aliastype, and user returns.


alias

string

The name (alias) of the linked cPanel & WHM server.

The function returns this value in the payload return.

A linked server.MailServer1

type

string

The linked cPanel & WHM server's profile.

The function returns this value in the payload return.

A valid server profile.Mail

user

string

The cPanel account username.

The function returns this value in the payload return.

A valid cPanel account.username1