OpenAdmin API Documentation
OpenAdmin API can be used to manage options available from the OpenAdmin interface: hosting plans, accounts, domains, services, DNS, email, security, server administration, and more. All API endpoints require Bearer JWT authentication.
OpenAdmin API is available only on OpenPanel Enterprise edition.
To use the API, enable it first from the OpenAdmin > Settings > API Access page or from terminal with opencli api on command.
To generate a token for use with the endpoints, send a POST request to /api/ using your OpenAdmin username and password:
curl -X POST "https://OPENADMIN_DOMAIN_OR_IP:2087/api/" && \
-H "Content-Type: application/json" -d '{"username":"OPENADMIN_USERNAME","password":"OPENADMIN_PASSWORD"}'
We recommend creating a separate admin user dedicated solely to API usage. This way, you can quickly suspend or delete that account if its credentials are ever compromised.
Example response with the token is:
{"access_token":"eyJhbGciOiJIUzI1NiIsInRs4CI6IkpXVCJ9.eyJmcmVzaCI6ZmFsc2UsImlhdCI6MTc4MDc0OTkwOCwianRpIjoiZDcwZmY2NmEtNDNiOC00OGZkLThiMWEtZDIwYWUwMDNhNjEyIiwidHlwZSI6ImFjY2VzcyIsInN1YiI6Im9wc3VwcG9ydCIsIm5iZiI6MTc4MDc0OTkwOCwiY3NyZiI6IjZlOGRmNGVmLTA0MjktNGNkYy1hNTg5LTJkYzUwMDk2ZDI2NSIsI3V4cCI6MTc4M33c1MDgwOH0.WLQ8rsVOF6pQg07i1fI1lXfd8_cCmryiOjGqg8zgOmw"}
This token must be sent in header for all other API endpoints:
-H "Authorization: Bearer YOUR_JWT_TOKEN" -H "Content-Type: application/json"
💡 Hint: Use opencli api list command to view usage examples for all the endpoints available on your OpenPanel version.
Some endpoints below are destructive or high-privilege (rebooting the server, changing the root SSH password, disabling OpenAdmin, migrating a server, WAF/firewall management). They run with the same privilege as the admin panel itself — scope and rotate API tokens accordingly.
Users
List All Accounts
GET /api/users
Example response
[
{
"username": "stefan",
"plan_name": "default_plan_nginx"
}
]
Create Account
POST /api/users
Request Body:
{
"username": "stefan",
"password": "s32dsasaq",
"plan_name": "default_plan_nginx"
}
Response:
{
"response": {
"message": "Successfully added user stefan password: s32dsasaq"
},
"success": true
}
Get Single Account
GET /api/users/{username}
Suspend / Unsuspend / Change Password
PATCH /api/users/{username}
Request Body Example:
{
"action": "suspend",
"password": "NEW_PASSWORD_HERE"
}
Change Plan
PUT /api/users/{username}
Request Body:
{
"plan_name": "default_plan_nginx"
}
Delete Account
DELETE /api/users/{username}
Autologin to User Account
CONNECT /api/users/{username}
List Users with Dedicated IPs
GET /api/ips
List a User's Containers
GET /api/users/{username}/containers
Add ?stats=1 to get live CPU/memory/network stats for that user's containers instead of the compose service definitions.
Manage a User's Container
POST /api/users/{username}/containers/{action}/{container_name}
{action} is one of start, stop, restart, cpu, ram.
Request Body (for cpu/ram only):
{
"value": "2"
}
Plans
List All Plans
GET /api/plans
Response:
{
"plans": [
{
"id": 1,
"name": "ubuntu_nginx_mysql",
"description": "Unlimited disk space and Nginx",
"bandwidth": 100,
"cpu": "1",
"ram": "1g",
"disk_limit": "10 GB",
"storage_file": "0 GB",
"inodes_limit": 1000000,
"db_limit": 0,
"domains_limit": 0,
"websites_limit": 10,
"docker_image": "openpanel/nginx"
}
]
}
Create Plan
POST /api/plans
Request Body:
{
"name": "Starter",
"description": "Starter hosting plan",
"email_limit": "10",
"max_email_quota": "0",
"max_hourly_email": "0",
"ftp_limit": "5",
"domains_limit": "5",
"websites_limit": "5",
"disk_limit": "5000",
"inodes_limit": "100000",
"db_limit": "5",
"cpu": "1",
"ram": "1",
"bandwidth": "100",
"feature_set": "default"
}
Get Single Plan
GET /api/plans/{plan_id}
Edit Plan
PUT /api/plans/{plan_id} (or PATCH)
Request Body: same fields as Create Plan — only send the ones you want to change, the rest fall back to defaults (0 for limits, 1 for cpu/ram, 100 for bandwidth, default for feature_set).
Delete Plan
DELETE /api/plans/{plan_id}
Domains
List All Domains
GET /api/domains
Add Domain
POST /api/domains/new
Request Body:
{
"username": "current_user",
"domain": "example.com",
"docroot": "/var/www/html/example.com"
}
Suspend Domain
POST /api/domains/suspend/{domain}
Unsuspend Domain
POST /api/domains/unsuspend/{domain}
Delete Domain
POST /api/domains/delete/{domain}
View / Update Docroot
GET /api/domains/docroot/{domain}
POST /api/domains/docroot/{domain}
Request Body:
{
"docroot": "/var/www/html/newroot"
}
View / Update DNS Zone File
GET /api/domains/{domain}/dns
POST /api/domains/{domain}/dns
Edits the raw bind zone file. On save the zone is validated with named-checkzone and reloaded — if validation fails, the previous version is restored automatically.
Request Body:
{
"content": "$TTL 86400\n@ IN SOA ..."
}
View / Update Caddy Config for a Domain
GET /api/domains/{domain}/caddy
POST /api/domains/{domain}/caddy
Same validate-then-reload behavior as the DNS zone endpoint, but for the domain's Caddy config block.
Request Body:
{
"content": "example.com {\n reverse_proxy ...\n}"
}
View / Update VirtualHost Config
GET /api/domains/{domain}/vhost/{username}
POST /api/domains/{domain}/vhost/{username}
Updates the raw nginx/apache/openresty vhost file for that user's domain and restarts the webserver container.
Request Body:
{
"content": "..."
}
SSL: View Status, Request AutoSSL, Upload Custom Cert, View Logs
GET /api/domains/{domain}/ssl
POST /api/domains/{domain}/ssl
Request Body (AutoSSL):
{ "action": "autossl" }
Request Body (custom certificate — paths must live under /var/www/html/):
{
"action": "custom",
"public_path": "/var/www/html/example.com/cert.pem",
"private_path": "/var/www/html/example.com/key.pem"
}
Request Body (issuance logs):
{ "action": "logs" }
View Domain Access Log
GET /api/domains/{domain}/log
Supports ?page=N and ?show_all=true query params for pagination.
View Domain GoAccess Stats
GET /api/domains/{domain}/stats/{username}
Returns the pre-rendered GoAccess HTML report (regenerated every 24h).
DNS Cluster
GET /api/dns/cluster — view cluster config (allowed slave IPs, enabled state)
POST /api/dns/cluster — enable/disable the cluster, or add/remove a slave IP
Request Body examples:
{ "action": "create", "ip": "1.2.3.4" }
{ "action": "delete", "ip": "1.2.3.4" }
{ "action": "enable" }
DNS Cluster Node Status
GET /api/dns/cluster/{ip}
Checks reachability of a slave node via rndc first, falling back to SSH.
DNS Zone Templates
GET /api/dns/zone-templates
POST /api/dns/zone-templates
Request Body:
{
"zone_template_ipv4": "...",
"zone_template_ipv6": "..."
}
Domain File Templates
GET /api/domains/file-templates
POST /api/domains/file-templates
Default templates used for new domains: default_page, suspended_user, suspended_website, docker_nginx_domain, docker_openresty_domain, docker_apache_domain, docker_varnish, docker_caddy. Send only the keys you want to update.
Usage
API Usage Info
GET /api/usage
Current Usage Stats
GET /api/usage/stats
Response:
{
"usage_stats": "{\"timestamp\": \"2024-09-03\", \"users\": 1, \"domains\": 2, \"websites\": 0}"
}
CPU Usage
GET /api/usage/cpu
Response Example:
{
"core_0": 0,
"core_1": 0
}
Memory Usage
GET /api/usage/memory
Disk Usage Per User
GET /api/usage/disk
Server Disk Usage
GET /api/usage/server
Response Example:
[
{
"device": "/dev/vda1",
"mountpoint": "/",
"fstype": "ext4",
"total": 123690532864,
"used": 63366230016,
"free": 60307525632,
"percent": 51.2
}
]
System
Get System Information
GET /api/system
Response Example:
{
"hostname": "stefi",
"os": "Ubuntu 24.04 LTS",
"time": "2024-09-04 15:09:16",
"kernel": "6.8.0-36-generic",
"cpu": "DO-Premium-Intel(x86_64)",
"openpanel_version": "0.2.7",
"running_processes": 178,
"package_updates": 98,
"uptime": "18905"
}
Docker Info
GET /api/docker/info
Raw output of the Docker Engine info API call (containers, images, storage driver, etc).
Services
List Monitored Services
GET /api/services
Edit Services List
PUT /api/services
Request Body Example:
{
"service1": { "name": "Service One", "status": "active" },
"service2": { "name": "Service Two", "status": "inactive" }
}
Check Status of Services
GET /api/services/status
Start Service
POST /api/service/start/{service_name}
Restart Service
POST /api/service/restart/{service_name}
Stop Service
POST /api/service/stop/{service_name}
Notifications
List Notifications
GET /api/notifications
Response Example:
[
{ "title": "Update available", "message": "New package updates available." }
]
Mark Notification as Read
POST /api/notifications/{line_number}/read
Pass ?command=mark_all_as_read to mark every notification as read in one call.
Delete Notification
DELETE /api/notifications/{line_number}
Pass ?command=delete_all to clear the whole log.
Emails
Mailserver Settings
GET /api/emails/settings
POST /api/emails/settings
Request Body (set webmail domain):
{ "webmail_domain": "webmail.example.com" }
Request Body (switch webmail client):
{ "webmail_software": "roundcube" }
Request Body (toggle mailserver services — any of ENABLE_POSTFWD, ENABLE_AMAVIS, ENABLE_DNSBL, ENABLE_RSPAMD, ENABLE_SPAMASSASSIN, ENABLE_MTA_STS, ENABLE_OPENDKIM, ENABLE_OPENDMARC, ENABLE_POP3, ENABLE_IMAP, ENABLE_CLAMAV, ENABLE_FAIL2BAN, SMTP_ONLY, ENABLE_SRS):
{ "ENABLE_CLAMAV": "1", "ENABLE_FAIL2BAN": "1" }
Request Body (change storage location — only allowed before any mailbox exists):
{ "storage_type": "custom", "email_storage_location": "/mnt/mail" }
List / Manage Mailboxes
GET /api/emails/accounts — list all mailboxes and their quotas
POST /api/emails/accounts — update password, quota, or send/receive restrictions
DELETE /api/emails/accounts — delete one or more mailboxes
Request Body (change password):
Request Body (set quota, in MB):
Request Body (remove quota):
Request Body (restrict send/receive):
Request Body (delete accounts):
Mail Queue
GET /api/emails/queue — list queued messages
POST /api/emails/queue — retry or delete queued messages
Request Body:
{ "action": "retry", "scope": "all" }
{ "action": "delete", "scope": "selected", "queue_ids": ["ABC123"] }
Per-Domain Email Rate Limits
GET /api/emails/domain-limits — view postfwd rules (add ?hits=example.com to view recent hits for a domain)
POST /api/emails/domain-limits — manage rules
Request Body (set a limit):
{ "action": "update-domain", "domain": "example.com", "username": "user1", "limit": 100 }
Request Body (reset counters):
{ "action": "reset-all" }
Other supported actions: reset-domain, reset-user, delete-domain, delete-user, delete-all. You can also send {"raw_content": "..."} to overwrite the postfwd rules file directly.
Security
HTTP Basic Auth
GET /api/security/basic-auth
POST /api/security/basic-auth
Request Body:
{
"basic_auth": "yes",
"basic_auth_username": "admin",
"basic_auth_password": "secret"
}