Last updated 2 months ago

API Tokens in cPanel

In cPanel & WHM version 80, we introduced cPanel application programming interface (API) tokens. cPanel users can issue these API tokens. The server recognizes API tokens and allows other users to run API functions with the account’s data. API functions allow you to view and change account data without the need to log in to the cPanel interface. For example, you could issue an API token to a third-party developer. That third-party developer could use that token to check disk usage.

Creating an API token

You can use one of the following methods to create an API token:

Use cPanel’s Manage API Tokens interface (cPanel >> Home >> Security >> Manage API Tokens).

Use the UAPI Tokens::create_full_access function.

Using an API token

To call a UAPI or cPanel API 2 function with an API token, run the following command from the command line:

curl -H'Authorization: cpanel username:APITOKEN' 'https://example.com:2083/execute/Module/function?parameter=value'

and more..