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
- Log in to WHM as root
- Go to Development → Manage API Tokens
- Click Generate Token, assign a name and expiration date
- 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.