{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-apis.sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"Introduction to WHM API 1","description":"With its world-class support and rich feature set, cPanel &amp; WHM has been the industry-leading web hosting platform for over 20 years. Trusted worldwide by our technology partners WordPress, CloudLinux, LiteSpeed, and more.","siteUrl":"https://api.docs.cpanel.net/","image":"/assets/cpanel-whm.ccd85fdccb18de0645f8a6ebf38e36a0489b92fc9d4ca92776f06aa5a160b167.db81178d.svg","keywords":"documentation, api, portal, cpanel","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"introduction-to-whm-api-1","__idx":0},"children":["Introduction to WHM API 1"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"overview","__idx":1},"children":["Overview"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["WHM API 1 accesses the WHM interface's features. You can use this API to perform server administration tasks, administrate cPanel and WHM reseller accounts, and manage cPanel & WHM services."]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Note"]}]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["When you enable a non-Standard Node ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://go.cpanel.net/serverroles"},"children":["server profile"]},", the system disables API calls associated with that profile's disabled roles."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Use the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/openapi/whm/operation/applist/"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["applist"]}]}," command to return an alphabetical list of WHM API 1 functions."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["You ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["cannot"]}," call this API's functions via another API's call methods."]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"basic-usage","__idx":2},"children":["Basic usage"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"json-api","__idx":3},"children":["JSON API"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"https://hostname.example.com:2087/cpsess##########/json-api/accountsummary?api.version=1&user=username\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["WHM API 1 calls through JSON consist of the following basic parts:"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/intro_json_example.1de3288a9854f6e3ac504e6205484dce8f26ac09b0d8683545ae33aa762ab8d3.053c55cc.png","alt":"JSON API Example"},"children":[]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"server-and-port","__idx":4},"children":["Server and port"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The web server's HTTP address and the port number to use. Generally, this value begins with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["https://"]}," and the domain name."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["When you call this API, use the following ports:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["2086"]}," - Unsecure calls as a specific WHM account."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["2087"]}," - Secure calls as a specific WHM account."]}]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Warning"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["cannot"]}," call this API via cPanel ports (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["2082"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["2083"]},") or Webmail ports (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["2095"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["2096"]},")."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"security-token","__idx":5},"children":["Security token"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The current session's ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://go.cpanel.net/basic-security-concepts"},"children":["security token"]},"."]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Note"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Cookie-based calls (for example, calls from a web browser) require a security token. For other authentication methods, read our Guide to API Authentication documentation."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"api-type","__idx":6},"children":["API type"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The API output type that you wish to receive. Use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["json-api"]}," to return JSON-formatted output."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"function","__idx":7},"children":["Function"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The WHM API function."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"api-version","__idx":8},"children":["API version"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The API version to use. To call WHM API 1, set the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["api.version"]}," parameter to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["1"]},"."]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Important"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["must"]}," include the API version in your call."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"input-parameters-and-values","__idx":9},"children":["Input parameters and values"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The function's input parameters and their values."]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["You ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["must"]}," ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://go.cpanel.net/percent-encoding"},"children":["URI-encode"]}," these values."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Separate multiple ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["parameter=value"]}," pairs with the ampersand character (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["&"]},")."]}]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Note"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The term \"Boolean\" in our documentation refers to parameters that accept values of ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["1"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["0"]},". cPanel & WHM's APIs do ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["not"]}," support the literal values of ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["true"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["false"]},"."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"command-line","__idx":10},"children":["Command Line"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"whmapi1 accountsummary user=username\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["WHM API 1 calls via the command line do ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["not"]}," return the metadata that other methods return if they experience errors that prevent a successful function run. For more information, read our WHM API 1 - Return Data documentation."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["WHM API 1 calls through the command line consist of the following basic parts:"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/whm-command.f631d1d488edad54581b86ebdb693ac33382ba9d7af6e8d8786e1a8f44ee1bdf.053c55cc.png","alt":"Command Line API Example"},"children":[]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"command","__idx":11},"children":["Command"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This value is always ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["whmapi1"]}," for calls to WHM API 1."]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Note"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If you run CloudLinux™, you must use the full path of the",{"$$mdtype":"Tag","name":"code","attributes":{},"children":[" whmapi1"]}," command:"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"/usr/local/cpanel/bin/whmapi1\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"output-type","__idx":12},"children":["Output Type"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The API output type that you wish to receive."]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--output=json"]}," to return JSON-formatted output."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--output=jsonpretty"]}," to return indented JSON-formatted output."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--output=yaml"]}," to return YAML-formatted output."]}]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Note"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This parameter defaults to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--output=yaml"]},"."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"function-1","__idx":13},"children":["Function"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The WHM API 1 function."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"input-parameters-and-values-1","__idx":14},"children":["Input parameters and values"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The function's input parameters and their values."]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Separate multiple parameter=value pairs with a space character."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Special characters within a key's value may cause an error. You ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["must"]}," either escape any special characters within values or surround the value with appropriate quotes. For more information, read Wikipedia's ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://go.cpanel.net/Escape_character"},"children":["Escape Characters"]}," article. For example, a bash shell command with a JSON-encoded value may appear similar to one of the following:",{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["whmapi1 function key=[\\\"sslinstall\\\",\\\"videotut\\\"]\""]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["whmapi1 function key='{\"videotut\",\"sslinstall\"}'"]}]}]}]}]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Note"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The term \"Boolean\" in our documentation refers to parameters that accept values of ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["1"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["0"]},". cPanel & WHM's APIs do ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["not"]}," support the literal values of ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["true"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["false"]},"."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For more information about this feature, run the following command:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"whmapi1 --help\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Do ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["not"]}," attempt to use cPanel or WHM interface URLs to perform actions in custom code. You ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["must"]}," call the appropriate API functions in order to perform the actions of cPanel & WHM's interfaces."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For example, do not pass values to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":[".html"]}," pages, as in the following example:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"https://example.com:2083/cpsess###########/frontend/jupiter/email_accounts/index.html/create#email=test&domain=example.com```\n\nWhile this **unsupported** method sometimes worked in previous versions of cPanel & WHM, we **strongly** discourage its use and do **not** guarantee that it will work in the future. Instead, the correct method to perform this action is to call the appropriate API function.\n","lang":"bash"},"children":[]}]},"headings":[{"value":"Introduction to WHM API 1","id":"introduction-to-whm-api-1","depth":1},{"value":"Overview","id":"overview","depth":2},{"value":"Basic usage","id":"basic-usage","depth":2},{"value":"JSON API","id":"json-api","depth":3},{"value":"Server and port","id":"server-and-port","depth":4},{"value":"Security token","id":"security-token","depth":4},{"value":"API type","id":"api-type","depth":4},{"value":"Function","id":"function","depth":4},{"value":"API version","id":"api-version","depth":4},{"value":"Input parameters and values","id":"input-parameters-and-values","depth":4},{"value":"Command Line","id":"command-line","depth":3},{"value":"Command","id":"command","depth":4},{"value":"Output Type","id":"output-type","depth":4},{"value":"Function","id":"function-1","depth":4},{"value":"Input parameters and values","id":"input-parameters-and-values-1","depth":4}],"frontmatter":{"seo":{"title":"Introduction to WHM API 1"}},"lastModified":"2026-05-19T00:16:18.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/whm/introduction","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}