cPanel & WHM supports several API authentication methods. Whenever code calls an API function, it must first authenticate to the server. The authentication process accesses the server in order to run code as a specific cPanel or WHM user with a specific set of permissions.
API calls that use a method that includes a URL must use the correct port:
2082 — Unsecure calls to cPanel's APIs.
2083 — Secure calls to cPanel's APIs.
2086 — Unsecure calls to WHM's APIs, or to cPanel's APIs via the WHM API.
2087 — Secure calls to WHM's APIs, or to cPanel's APIs via the WHM API.
2095 — Unsecure calls to cPanel's APIs via a Webmail session.
2096 — Secure calls to cPanel's APIs via a Webmail session.
Otherwise-correct calls will return Permission denied or Function not found errors if they use an incorrect port number.
This guide only includes cPanel & WHM authentication methods. For Manage2 authentication information, read our Guide to the Manage2 API documentation.
You can currently use the following methods to authenticate with cPanel & WHM in your custom code:
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. ®2017 All rights reserved.