Skip to main content
Version: 1.7.50

OpenAdmin API Documentation

A comprehensive REST API for managing OpenPanel hosting accounts, plans, domains, services, and server resources. All endpoints require Bearer JWT authentication.

Base URL: http://PANEL:2087

Authentication: All requests require a bearer token:

Authorization: Bearer YOUR_JWT_TOKEN

Table of Contentsโ€‹

  1. Users
  2. Plans
  3. Domains
  4. Usage
  5. System
  6. Services
  7. Notifications

Usersโ€‹

List All Accountsโ€‹

GET /api/users Response: 200 OK

[
{
"username": "stefan",
"email": "[email protected]",
"plan_name": "default_plan_nginx"
}
]

Create Accountโ€‹

POST /api/users Request Body:

{
"email": "[email protected]",
"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


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"
}
]
}

Get Single Planโ€‹

GET /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}


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"
}

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." }
]