In cPanel & WHM version 11.30 and later, cPanel tags are deprecated. We provide this example to help developers move from the old cPanel tag system to our LiveAPI system. We strongly recommend that you only use the LiveAPI system to call the cPanel APIs.

Special characters within a key's value may cause an error. You must either escape any special characters within values or surround the value with appropriate quotes. For more information, read Wikipedia's Escape Characters article.For example, a bash shell command with a JSON-encoded value may appear similar to one of the following:

While 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.

Call cPanel API 1 from the WHM API

Warning:

Unless you call this API via the WHM API, you cannot call this API via WHM's ports (2086 or 2087).

Custom Event Handlers and Standardized Hooks

API method distinctions

cPanel, Inc. produces four current and two deprecated APIs, and they all include separate sets of functions. Make certain that the function and module that you call exist in the API version that your code uses.

Browser-based calls to WHM API 1 must include the WHM API version (api.version=1). If you omit the version, the system calls WHM API 0, which may not contain the desired function, or may contain an older version of that function.

cPanel, WebHost Manager, and WHM are registered trademarks of cPanel, Inc. for providing its computer software that facilitates the management and configuration of Internet web servers. ®2018 All rights reserved.