Skip to content

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 ​

SourceContent
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 fileThe 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 the X-API-Key header;
  • 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 ​

SchemeHeader or cookieFor
apiKeyX-API-Key headerIntegrations, scripts, CLI
sessionmoorcp_session cookieAdmin GUI. Changing requests need X-CSRF-Token.
billingClientX-Billing-Client-ID headerBilling keys on client operations
mtlsClient certificateAgents, 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 ​

ParameterMeaning
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 a Job object, or an object that contains job (for example {account, job} when creating an account).
  • 204: success without a body.
  • 4xx/5xx: an Error object {code, message}. Response descriptions in the specification name the possible error codes, for example 409 ... (cp.account_conflict).

Endpoint groups ​

The table below summarizes the tags in the specification. The number of operations grows with each release.

TagContentExample endpoints
provisioningAccounts: create, list, details, suspend, unsuspend, change package, terminate, bulk actions, server move, access, contact, client panel login links, account IPv6, monthly visitsPOST /v1/accounts, POST /v1/accounts/{id}/suspend, POST /v1/accounts/{id}/client-login
packagesHosting packagesGET /v1/packages, PUT /v1/packages/{id}
billingPanel capabilities for billing, plus the marker for endpoints billing keys may useGET /v1/billing/capabilities
usageBulk usage per accountGET /v1/usage/accounts
jobsJob status, list, retry, and stop/killGET /v1/jobs/{id}, POST /v1/jobs/{id}/retry, POST /v1/jobs/{id}/cancel
websitesWebsites, 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 allowlistPOST /v1/websites, POST /v1/websites/{id}/ssl/issue, POST /v1/accounts/{id}/primary-domain
databasesMariaDB/PostgreSQL databases and users, grants, import/export, phpMyAdmin and AdminNeo (including the phpMyAdmin PHP settings per server), optimizer, remote database accessPOST /v1/accounts/{id}/databases
filesFile manager: list (paged with limit/offset, sort, and search), upload, download, archive, extract, permissions, trashGET /v1/accounts/{id}/files
emailEmail domains, mailboxes, aliases, rules, spam, queue, send limits, webmail, delivery history (Track delivery) per account and per serverPOST /v1/accounts/{id}/email/mailboxes
dnsZones, records, templates, import/export, nameservers, cluster, nameserver nodes, cPanel DNSOnly replicas, replica zone holdsGET /v1/accounts/{id}/dns/zones, GET /v1/dns/nodes
backupDestinations, policies, snapshots, backup now, restore, download, restore tests, restore from a portable archive, client external backup storage and rulesPOST /v1/accounts/{id}/backup/run
devtoolsCron, FTP, SSH keys, Git deploy, runtime apps, PHPGET /v1/accounts/{id}/cron
securityWAF 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 certificatesGET /v1/servers/{id}/waf, GET /v1/servers/{id}/firewall, POST /v1/api-keys
serversServers (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 logsGET /v1/servers, POST /v1/servers/{id}/softaculous/install, GET /v1/alerts
configConfiguration manager: targets, profiles, plan/diff, apply, versions, rollbackPOST /v1/servers/{id}/config/{target}/apply
migrationcPanel importer, restore from cPanel backup files on a server, sources, waves, sync, cutover, propagation, live job progressPOST /v1/migrations/cpanel
webhooksOutgoing webhooks, event catalog, history, redeliveryPOST /v1/webhooks
auditAudit log and account Recent ActivityGET /v1/audit?accountId=
authStaff GUI sessions: login, logout, 2FA, password changePOST /v1/auth/login
staffStaff managementGET /v1/staff
agentsEndpoints 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:

EndpointPurpose
POST /v1/dns/nodes, DELETE /v1/dns/nodes/{serverId}, POST /v1/dns/nodes/{serverId}/primaryAdd, 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/enableInstall 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/settingsSeparate SFTP/SSH port for clients and client password login (audit server.ssh_settings)
PUT /v1/servers/{id}/ssh/system-portChange the root SSH port, with rollback if sshd does not listen (audit server.ssh_system_port)
POST /v1/servers/{id}/rspamd/ssoOne-time link to the Rspamd web UI
POST /v1/license/activateActivate a license by key or server IP, or request a trial (audit license.activate)
POST /v1/servers/{id}/renameChange 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/testTurn 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}/rebootAdd 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 ​

AreaEndpoints
ServersPOST /v1/servers/{id}/rename, /v1/server-installs (add a server over SSH), POST /v1/servers/{id}/softaculous/prune (with dryRun)
SMTP relayGET/PUT /v1/servers/{id}/mail/relay, POST /v1/servers/{id}/mail/relay/test
Calendars & Contacts, Web DiskGET /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 monitoringGET /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
BackupGET /v1/accounts/{id}/backup/snapshots/{snapshot}/browse, DELETE /v1/accounts/{id}/backup/snapshots/{snapshot}
JobsPOST /v1/jobs/{id}/cancel ({"force": true} to kill)
MigrationGET/PUT /v1/migrations/settings (concurrency 1–8); autoCutover in the body of POST /v1/migrations/waves/{id}/start
WebsitesPUT/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)
EmailPUT /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}
FilesGET /v1/accounts/{id}/files/usage (disk usage per folder)
DNSGET/POST /v1/accounts/{id}/dns/ddns, POST /v1/accounts/{id}/dns/ddns/{hostId}/reset, DELETE /v1/accounts/{id}/dns/ddns/{hostId}
Client accessGET/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 ​

AreaEndpoints
LicensePOST /v1/license/activate
IPv6GET/PUT /v1/accounts/{id}/ipv6 (staff only); ipv6, mail_outbound_ipv6, and primary_ip in PATCH /v1/servers/{id}
Remote databaseGET/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 statisticsGET /v1/websites/{id}/statistics, GET /v1/websites/{id}/statistics/live, GET/PUT /v1/websites/{id}/statistics/beacon, GET /v1/accounts/{id}/visits
Track deliveryGET /v1/accounts/{id}/email/delivery, GET /v1/servers/{id}/mail/delivery
Object cacheGET /v1/servers/{id}/cache, POST /v1/servers/{id}/memcached/setup, GET/PUT /v1/accounts/{id}/memcached, POST /v1/accounts/{id}/memcached/flush
WordPress ManagerPOST /v1/accounts/{id}/apps/{appId}/sso, PUT /v1/accounts/{id}/apps/{appId}/wp-settings
SSH and WAF per accountPUT/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 settingsGET/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
MigrationGET /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 ​

EndpointPurpose
GET /v1/healthPanel 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/licenseLicense 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/updateDynamic 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=)

See also ​

MoorCP Shared, a shared hosting panel for server fleets.