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 - get_homedir_roots
Skip to end of metadata
Go to start of metadata


This function returns all the directories where the system stores users' home directories. It returns them in descending order, based on the current amount of available free disk space for each directory. For example, the first directory the function lists has the most available free disk space.


Use WHM's Basic WebHost Manager Setup (WHM >> Home >> Server Configuration >> Basic WebHost Manager Setup) to configure where the system will create a new user's home directory.


 Command Line
whmapi1 get_homedir_roots


  • 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:


 Output (JSON)
   "metadata" : {
      "reason" : "OK",
      "version" : 1,
      "result" : 1,
      "command" : "get_homedir_roots"
   "data" : {
      "payload" : [
            "path" : "/home"
            "path" : "/home2"


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


This function does not accept parameters.


ReturnTypeDescriptionPossible valuesExample
payloadarray of hashesAn array containing data for each home parent directory.

This array contains the path return.



A directory where the system can store users' home directories.

This function returns this value in the payload array.

A valid directory path.