Using UAPI and API Tokens in WHM/cPanel

cPanel's UAPI (Universal API) allows secure programmatic access to functions like creating email accounts, managing databases, or modifying DNS records.

Creating an API Token

  1. Log in to WHM as root
  2. Go to Development → Manage API Tokens
  3. Click Generate Token, assign a name and expiration date
  4. Copy and store the token securely

Calling the UAPI

curl -H 'Authorization: cpanel root:API_TOKEN' \
 https://hostname.example.com:2087/execute/Email/add_pop?email=testuser&domain=example.com&password=pass123

UAPI is available for both WHM and cPanel scopes depending on the endpoint called.

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Automating Backups with Cron or API

Regular backups are essential for disaster recovery. You can automate backups through WHM’s...