1. Home
  2. Docs
  3. Developer Guide
  4. API
  5. Legacy API (Deprecated)

Legacy API (Deprecated)

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 APICurrent API (port 2304)
One global key for everythingSeparate keys per integration
Key sent in the URL (ends up in logs)Key sent in the POST body
One shared IP allow listIP restriction per key
No per-function permissionsPermissions per function and action
Plain-text responsesJSON or XML
Few functionsAccounts, 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 functionCurrent API
account_newaccount action=add
account_removeaccount action=del
account_suspend / account_unsuspendaccount action=susp / unsp
addondomain_add / addondomain_removeadmindomains type=domain, add / del
subdomain_add / subdomain_removeadmindomains type=subdomain, add / del
testconnectiontestconex

After migrating, remove the legacy key and allowed IPs.

Related

Was this article helpful to you? No Yes