Older CWP versions had a simpler API under the admin panel address /api/. It is still present for old integrations, but new integrations should use the current API on port 2304.
Why not to use it
| Legacy API | Current API (port 2304) |
|---|---|
| One global key for everything | Separate keys per integration |
| Key sent in the URL (ends up in logs) | Key sent in the POST body |
| One shared IP allow list | IP restriction per key |
| No per-function permissions | Permissions per function and action |
| Plain-text responses | JSON or XML |
| Few functions | Accounts, packages, domains, email, FTP, MySQL, SSL, cron, autologin and more |
What it offers
The legacy API is configured in the admin panel (API key in /usr/local/cwp/.conf/api_key.conf, allowed IPs in /usr/local/cwp/.conf/api_allowed.conf) and is called as .../api/?key=KEY&api=FUNCTION with these functions: account_new, account_remove, account_suspend, account_unsuspend, addondomain_add, addondomain_remove, subdomain_add, subdomain_remove, unblock_ip, testconnection.
Migrating
| Legacy function | Current API |
|---|---|
account_new | account action=add |
account_remove | account action=del |
account_suspend / account_unsuspend | account action=susp / unsp |
addondomain_add / addondomain_remove | admindomains type=domain, add / del |
subdomain_add / subdomain_remove | admindomains type=subdomain, add / del |
testconnection | testconex |
After migrating, remove the legacy key and allowed IPs.