API reference (OpenAPI)
This page shows where the full API v1 reference lives, how to read it, and a map of the main endpoint groups. General rules (jobs, errors, idempotency, language) are in the API v1 overview.
Where the reference is
| Source | Content |
|---|---|
API reference page on the MoorCP site (https://moorcp.com/docs/) | A reference you can browse by group, in two languages (English and Indonesian), with a button to download openapi.yaml |
The openapi.yaml file | The raw OpenAPI 3.1 specification. It can be downloaded from the reference page (https://moorcp.com/docs/openapi.yaml). |
INFO
The panel itself does not serve an API reference page or the OpenAPI file. The panel's endpoints are only API v1 itself. Use the reference version that matches your panel version (GET /v1/health shows it).
Using the OpenAPI file
The openapi.yaml file can be used to:
- import into Postman, Insomnia, or Bruno, so every endpoint is available as a request. Set the server variable to
https://panel.example.com:8443/v1, then set API key auth in theX-API-Keyheader; - generate a client (SDK) with an OpenAPI generator for your billing system's programming language;
- validate requests and responses in integration tests.
WARNING
The specification is still a draft (1.0.0-draft). Endpoints and fields can be added between releases. Error codes (code) and existing fields are kept stable.
Reading the specification
Servers
The specification lists two base URLs: /v1 (official) and /api/v1 (alias for older clients). Both behave the same.
Security schemes
| Scheme | Header or cookie | For |
|---|---|---|
apiKey | X-API-Key header | Integrations, scripts, CLI |
session | moorcp_session cookie | Admin GUI. Changing requests need X-CSRF-Token. |
billingClient | X-Billing-Client-ID header | Billing keys on client operations |
mtls | Client certificate | Agents, and API keys pinned to mTLS |
Tags
Every operation has one or more tags. Operations also tagged billing can be used by billing keys (with the account ownership rules). Operations without the billing tag under /v1/accounts/{id}/... can usually still be used by billing as client operations, except those marked admin-only.
Common parameters
| Parameter | Meaning |
|---|---|
Idempotency-Key (header) | When marked required, requests without the header are refused with 400 |
accountId (query) | Limits a list to one account; required for billing keys on /v1/websites, /v1/jobs, /v1/audit |
limit (query) | Maximum number of entries |
cursor (query) | Next page, from nextCursor in the previous response |
Responses
200/201: the resulting object or array.202: a job was created. The body is aJobobject, or an object that containsjob(for example{account, job}when creating an account).204: success without a body.4xx/5xx: anErrorobject{code, message}. Response descriptions in the specification name the possible error codes, for example409 ... (cp.account_conflict).
Endpoint groups
The table below summarizes the tags in the specification. The number of operations grows with each release.
| Tag | Content | Example endpoints |
|---|---|---|
provisioning | Accounts: create, list, details, suspend, unsuspend, change package, terminate, bulk actions, server move, access, contact, client panel login links, account IPv6, monthly visits | POST /v1/accounts, POST /v1/accounts/{id}/suspend, POST /v1/accounts/{id}/client-login |
packages | Hosting packages | GET /v1/packages, PUT /v1/packages/{id} |
billing | Panel capabilities for billing, plus the marker for endpoints billing keys may use | GET /v1/billing/capabilities |
usage | Bulk usage per account | GET /v1/usage/accounts |
jobs | Job status, list, retry, and stop/kill | GET /v1/jobs/{id}, POST /v1/jobs/{id}/retry, POST /v1/jobs/{id}/cancel |
websites | Websites, aliases, redirects, docroot, directory protection, error pages, logs, visitor statistics (daily, live, optional beacon), health, SSL (including sslJob, the latest SSL request), changing the account's primary domain, Redis and Memcached per account, client SSH/SFTP password and IP allowlist | POST /v1/websites, POST /v1/websites/{id}/ssl/issue, POST /v1/accounts/{id}/primary-domain |
databases | MariaDB/PostgreSQL databases and users, grants, import/export, phpMyAdmin and AdminNeo (including the phpMyAdmin PHP settings per server), optimizer, remote database access | POST /v1/accounts/{id}/databases |
files | File manager: list (paged with limit/offset, sort, and search), upload, download, archive, extract, permissions, trash | GET /v1/accounts/{id}/files |
email | Email domains, mailboxes, aliases, rules, spam, queue, send limits, webmail, delivery history (Track delivery) per account and per server | POST /v1/accounts/{id}/email/mailboxes |
dns | Zones, records, templates, import/export, nameservers, cluster, nameserver nodes, cPanel DNSOnly replicas, replica zone holds | GET /v1/accounts/{id}/dns/zones, GET /v1/dns/nodes |
backup | Destinations, policies, snapshots, backup now, restore, download, restore tests, restore from a portable archive, client external backup storage and rules | POST /v1/accounts/{id}/backup/run |
devtools | Cron, FTP, SSH keys, Git deploy, runtime apps, PHP | GET /v1/accounts/{id}/cron |
security | WAF and CrowdSec, account WAF IP allowlist, server firewall ports and turning on firewalld, login protection, malware (scan schedule, scanner settings, custom signatures, YARA); plus API keys, secrets, and agent mTLS certificates | GET /v1/servers/{id}/waf, GET /v1/servers/{id}/firewall, POST /v1/api-keys |
servers | Servers (including IPv6 and the primary IP), registration tokens, verification, health, services, reboot, time, capacity, drain, CloudLinux, server PHP, OpenLiteSpeed settings, SSH settings and root SSH port, Redis/Memcached setup, Rspamd web UI, Softaculous (core install, license check), alerts, notification channels, blacklists, license (including activation and trial), updates, panel backup, panel logs | GET /v1/servers, POST /v1/servers/{id}/softaculous/install, GET /v1/alerts |
config | Configuration manager: targets, profiles, plan/diff, apply, versions, rollback | POST /v1/servers/{id}/config/{target}/apply |
migration | cPanel importer, restore from cPanel backup files on a server, sources, waves, sync, cutover, propagation, live job progress | POST /v1/migrations/cpanel |
webhooks | Outgoing webhooks, event catalog, history, redelivery | POST /v1/webhooks |
audit | Audit log and account Recent Activity | GET /v1/audit?accountId= |
auth | Staff GUI sessions: login, logout, 2FA, password change | POST /v1/auth/login |
staff | Staff management | GET /v1/staff |
agents | Endpoints called by agents (registration, heartbeat, certificate renewal). Not for integrations. | POST /v1/agents/register |
Admin-only endpoints
The endpoints below are only for staff or API keys with the admin role. Other roles are refused with 403 cp.forbidden for changes:
| Endpoint | Purpose |
|---|---|
POST /v1/dns/nodes, DELETE /v1/dns/nodes/{serverId}, POST /v1/dns/nodes/{serverId}/primary | Add, remove, and promote nameserver nodes. GET /v1/dns/nodes shows the DNS mode, nodes, candidate servers, default nameservers, and the number of stored zone copies. |
POST /v1/dns/external-nodes, DELETE /v1/dns/external-nodes/{id} | Add and remove cPanel DNSOnly replicas (?purge=1 also deletes MoorCP zones from that server) |
DELETE /v1/dns/replica-holds/{zone} | Release a zone imported from cPanel from the DNSOnly replicas before cutover (audit dns.replica.release) |
POST /v1/servers/{id}/firewall/ports, DELETE /v1/servers/{id}/firewall/ports?port=&proto= | Open and close TCP/UDP ports in firewalld (audit server.port_open, server.port_close) |
POST /v1/servers/{id}/firewall/enable | Install and turn on firewalld with the required rules; it turns itself off again unless the panel confirms within 90 seconds (audit server.firewall_enable) |
PUT /v1/servers/{id}/ssh/settings | Separate SFTP/SSH port for clients and client password login (audit server.ssh_settings) |
PUT /v1/servers/{id}/ssh/system-port | Change the root SSH port, with rollback if sshd does not listen (audit server.ssh_system_port) |
POST /v1/servers/{id}/rspamd/sso | One-time link to the Rspamd web UI |
POST /v1/license/activate | Activate a license by key or server IP, or request a trial (audit license.activate) |
POST /v1/servers/{id}/rename | Change the hostname of a server without accounts, without enrolling it again (audit server.rename) |
PUT /v1/servers/{id}/mail/relay, POST /v1/servers/{id}/mail/relay/test | Turn the SMTP relay (smarthost) on or off, and test it without saving. GET is open to other staff roles; the password is never returned |
POST /v1/server-installs/test, POST /v1/server-installs, GET /v1/server-installs/{id}?from=, POST /v1/server-installs/{id}/reboot | Add a server over SSH: test the login, start the installation, follow its log, and reboot for disk quotas (audit server.install_start, server.install_reboot, server.install_finish). The SSH credentials are only kept in memory |
DELETE /v1/accounts/{id}/backup/snapshots/{snapshot} | Remove one backup snapshot (audit backup.snapshot_delete). Refused for clients and billing keys |
GET /v1/servers/{id}/databases/activity/full (full query text) is refused for the support role.
Added in rc.47 to v0.12.5
| Area | Endpoints |
|---|---|
| Servers | POST /v1/servers/{id}/rename, /v1/server-installs (add a server over SSH), POST /v1/servers/{id}/softaculous/prune (with dryRun) |
| SMTP relay | GET/PUT /v1/servers/{id}/mail/relay, POST /v1/servers/{id}/mail/relay/test |
| Calendars & Contacts, Web Disk | GET /v1/servers/{id}/dav, POST /v1/servers/{id}/dav/setup, GET /v1/accounts/{id}/email/dav; GET /v1/servers/{id}/webdisk, POST /v1/servers/{id}/webdisk/setup, GET /v1/accounts/{id}/ftp/webdisk, PUT /v1/accounts/{id}/ftp/{login}/options |
| Database monitoring | GET /v1/servers/{id}/databases/activity (and /full), POST /v1/servers/{id}/databases/activity/{engine}/{pid}/kill, PUT /v1/servers/{id}/databases/userstat, GET /v1/accounts/{id}/databases/activity |
| Backup | GET /v1/accounts/{id}/backup/snapshots/{snapshot}/browse, DELETE /v1/accounts/{id}/backup/snapshots/{snapshot} |
| Jobs | POST /v1/jobs/{id}/cancel ({"force": true} to kill) |
| Migration | GET/PUT /v1/migrations/settings (concurrency 1–8); autoCutover in the body of POST /v1/migrations/waves/{id}/start |
| Websites | PUT/DELETE /v1/websites/{id}/aliases/{domain}/forward (parked domain redirect), PUT /v1/websites/{id}/access (IP Blocker, hotlink protection), PUT /v1/websites/{id}/mime-types, GET/PUT /v1/websites/{id}/indexes (Index Manager), PUT /v1/websites/{id}/protected-dirs/leech, GET /v1/websites/{id}/logs/download, GET /v1/accounts/{id}/edge-ssl (Cloudflare SSL) |
PUT /v1/accounts/{id}/email/domains/{domain}/alias (parked domain email), POST /v1/accounts/{id}/email/domains/{domain}/repair (deliverability fix), GET /v1/accounts/{id}/email/lists, PUT/DELETE /v1/accounts/{id}/email/lists/{address} | |
| Files | GET /v1/accounts/{id}/files/usage (disk usage per folder) |
| DNS | GET/POST /v1/accounts/{id}/dns/ddns, POST /v1/accounts/{id}/dns/ddns/{hostId}/reset, DELETE /v1/accounts/{id}/dns/ddns/{hostId} |
| Client access | GET/POST /v1/accounts/{id}/api-tokens, DELETE /v1/accounts/{id}/api-tokens/{tokenId} (client API tokens); GET/POST /v1/accounts/{id}/users, PATCH/DELETE /v1/accounts/{id}/users/{userId} (panel users); POST /v1/client/password (a panel user changes their own password) |
See Authentication and API keys for client API tokens and API v1 overview for stopping jobs.
Added in rc.25 to rc.46
| Area | Endpoints |
|---|---|
| License | POST /v1/license/activate |
| IPv6 | GET/PUT /v1/accounts/{id}/ipv6 (staff only); ipv6, mail_outbound_ipv6, and primary_ip in PATCH /v1/servers/{id} |
| Remote database | GET/PUT /v1/accounts/{id}/database-remote |
| External backup | /v1/accounts/{id}/backup-external (storage under destinations, schedules under rules, rules/{rule}/run), POST /v1/accounts/{id}/backup/archive-restore |
| Visitor statistics | GET /v1/websites/{id}/statistics, GET /v1/websites/{id}/statistics/live, GET/PUT /v1/websites/{id}/statistics/beacon, GET /v1/accounts/{id}/visits |
| Track delivery | GET /v1/accounts/{id}/email/delivery, GET /v1/servers/{id}/mail/delivery |
| Object cache | GET /v1/servers/{id}/cache, POST /v1/servers/{id}/memcached/setup, GET/PUT /v1/accounts/{id}/memcached, POST /v1/accounts/{id}/memcached/flush |
| WordPress Manager | POST /v1/accounts/{id}/apps/{appId}/sso, PUT /v1/accounts/{id}/apps/{appId}/wp-settings |
| SSH and WAF per account | PUT/DELETE /v1/accounts/{id}/ssh-password, PUT /v1/accounts/{id}/ssh-allow, GET/PUT /v1/accounts/{id}/waf-allow |
| Malware scanner | /v1/security/malware/schedule, /v1/security/malware/scanner (plus scanner/sync), /v1/security/malware/signatures (upload, edit, download, delete), GET /v1/servers/{id}/malware/scanner, PUT /v1/servers/{id}/malware/yara |
| Server settings | GET/PUT /v1/servers/{id}/webserver/ols-tuning, GET/PUT /v1/servers/{id}/phpmyadmin/settings, GET/PUT /v1/servers/{id}/ssh/settings, PUT /v1/servers/{id}/ssh/system-port, POST /v1/servers/{id}/firewall/enable, POST /v1/servers/{id}/rspamd/sso |
| Migration | GET /v1/migrations/cpanel/archives, GET /v1/migrations/jobs/{jobId}/progress |
POST /v1/websites also accepts aliases, and GET /v1/accounts/{id}/files accepts limit, offset, sort, order, q, and type=dir and returns total.
The endpoints for upgrading from the panel (POST /v1/updates/panel-upgrade and POST /v1/updates/agents-upgrade) are not in the specification yet. They are explained in Updates and releases.
TIP
For billing integrations, start with the operations tagged provisioning, packages, billing, usage, jobs, and webhooks. The flow guide is in Billing integration.
Endpoints without authentication
| Endpoint | Purpose |
|---|---|
GET /v1/health | Panel status and version |
GET /v1/files/dl/{token}, GET /v1/backup/dl/{token} | Downloads with signed links created through the API |
POST /v1/git-hooks/{repo}/{token} | Git deploy webhook (token in the URL) |
GET /install-agent.sh, GET /downloads/{name} | Installer and agent binary for new hosting servers |
GET /v1/client/license | License lock status of the client panel (client origin, port 2083), so the client panel can show its locked page |
GET /nic/update, GET/POST /v1/ddns/update | Dynamic DNS update (dyndns2) on the client origin. Not a panel login: the hostname and its mcdd_... secret are sent as HTTP Basic auth (or Authorization: Bearer with ?hostname=) |
