cPanel API tokens: access for scripts

An API token lets a script or an external service work with cPanel without your password: create mailboxes, read statistics, make backups.

  1. Open "Manage API Tokens" (group "Security").
  2. Enter a token name (letters, digits, dashes).
  3. Set an expiry date - better to limit it.
  4. Click "Create" and copy the token right away: it is shown only once.
New API token
New API token

Example request - list of mailboxes:

curl -H 'Authorization: cpanel USERNAME:TOKEN' 'https://PANEL_ADDRESS/execute/Email/list_pops'

USERNAME is your cPanel username, PANEL_ADDRESS is the cPanel address from the welcome email.

A token has the same rights as your password. Keep it like a password and delete it when the script is no longer used.

Questions and answers
Nowhere - it is shown once. If lost, delete it and create a new one.