Using UAPI and API Tokens in WHM/cPanel Print

  • 0

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.


Was this answer helpful?

« Back