# contPanel Developer API > JSON-over-HTTPS API built into every contPanel server, for hosting companies that automate accounts from WHMCS, HostBill or their own billing system. Endpoint: `POST https://SERVER:2087/api/`. Human page: https://contpanel.com/developer/ · Product: https://contpanel.com · Docs: https://contpanel.com/docs/ · Made with Producer Media Holding, 347 5th Ave #1402, New York, NY 10016. ## Authentication - Create a token in the root panel (port 2087) → Developer → New token. Tokens start with `cpk_`, are shown once and stored only as a SHA-256 hash. - Send it as `X-API-Key: cpk_…` (recommended) or `Authorization: Bearer cpk_…`. - Access: "full" may change accounts; "read" may only call test, server.info, package.list, account.list, account.get, usage. - Optional allowed addresses: IPs or CIDR ranges (IPv4/IPv6). - TLS uses the panel certificate; self-signed until a certificate for the host name is issued (use `curl -k` / disable peer verification). ## Request and answer Body: JSON object with `action` plus parameters (form-encoded also accepted). Success: `{"ok": true, "data": {…}}` (HTTP 200). Failure: `{"ok": false, "error": "code", "message": "detail"}` — HTTP 400 failed action, 401 bad token, 403 address refused or read-only token, 429 rate limit. ```bash curl -sk https://SERVER:2087/api/ -H "X-API-Key: cpk_YOUR_TOKEN" \ -d '{"action":"account.create","username":"alice","domain":"alice.com","package":"Starter"}' ``` ## Actions | Action | Access | Parameters | Result | |---|---|---|---| | test | read | — | `{pong, version, time}` | | server.info | read | — | version, hostname, license {valid, reason}, accounts, sites, system load | | package.list | read | — | list of packages: id, name, disk_mb, max_sites, max_dbs, accounts | | account.list | read | — | list: username, domain, email, package, package_name, owner, sites, dbs, disk_used (bytes), disk_mb, suspended, created_at | | account.get | read | username* | the account plus usage fields | | account.create | full | username* (3–16, a–z0–9, starts with a letter), domain*, package* (id or name), password (≥8, generated if empty), email, reseller (bool) | {username, password, domain}. Creates Linux user, /home/USER/public_html, site, PHP pool, DNS zone, main FTP login, AutoSSL | | account.suspend | full | username*, reason | sites show a suspension page; FTP and panel sign-in stop; data kept | | account.unsuspend | full | username* | restores the account | | account.password | full | username*, password (generated if empty) | panel, main FTP and SFTP password changed together | | account.package | full | username*, package* | upgrade/downgrade, limits apply at once | | account.delete | full | username* | removes the account, sites, databases, DNS, FTP, certificates and /home/USER (irreversible) | | usage | read | username (optional) | disk_mb, disk_limit_mb, bandwidth_mb, bandwidth_month (YYYY-MM), sites, databases, suspended; without username: {accounts: {user: {…}}} | | sso | full | username*, host | {url, expires_in: 60} one-time sign-in link to the customer panel on port 2083 | ## Errors api_unauthorized, api_ip_not_allowed, api_read_only, api_rate_limited, api_unknown_action, api_failed, license_locked (writes blocked while the license is invalid), account_not_found, username_taken, invalid_username, invalid_domain, site_exists, password_short, license_limit. ## Limits 300 calls per minute per token. Only port 2087 serves the API. Every change is logged with token name, action, account and caller address. ## Integrations (free with every license) - WHMCS module: https://license.contpanel.com/dl/integrations/contpanel-whmcs.zip → `modules/servers/contpanel/`. Server: module contPanel, port 2087, Secure on, token as Access Hash. Supports CreateAccount, SuspendAccount, UnsuspendAccount, TerminateAccount, ChangePassword, ChangePackage, UsageUpdate (daily disk/traffic), ServiceSingleSignOn, AdminLink, package loader. - HostBill module: https://license.contpanel.com/dl/integrations/contpanel-hostbill.zip → `includes/modules/Hosting/contpanel/`. Activate under Settings → Modules → Hosting Modules; App: contPanel, Secure on, token as Hash (port 2087). Supports Create, Suspend, Unsuspend, Terminate, ChangePassword, ChangePackage, getSynchInfo (account and usage sync), client and admin login, package loader. ### Other modules - WiseCP (billing software used mostly in Turkey), built and maintained by the contPanel team on the same API: https://license.contpanel.com/dl/integrations/contpanel-wisecp.zip → `coremio/modules/Servers/ContPanel/`. Server type contPanel, port 2087, SSL on, token as access hash. ## Türkçe contPanel Geliştirici API, her contPanel sunucusunda hazır gelen JSON/HTTPS arayüzüdür: `POST https://SUNUCU:2087/api/`. Root panel → Geliştirici → Yeni anahtar ile `cpk_` ile başlayan anahtar oluşturulur, `X-API-Key` başlığıyla gönderilir; IP ile sınırlanabilir, salt okunur yapılabilir. Hesap açma (account.create), askıya alma (account.suspend / account.unsuspend), şifre (account.password), paket değiştirme (account.package), silme (account.delete), disk ve aylık trafik (usage) ve müşteri paneline tek tıkla giriş (sso) yapılır. WHMCS ve HostBill modülleri her lisansla ücretsizdir; diğer modüller arasında çoğunlukla Türkiye’de kullanılan WiseCP için contPanel ekibinin geliştirdiği modül de vardır. Anahtar başına dakikada 300 çağrı; her değişiklik kayda geçer.