CyberPanel Server API Skill Reference
Generated from : https://cyberpanel.docs.apiary.io/#reference/server
API Version : CyberPanel API
Format : REST/JSON
Base Auth : ``adminUser`` + ``adminPass`` required for all endpoints
This skill reference documents all Server-related API endpoints available in CyberPanel for programmatic server, website, user, and firewall management.
All requests require:
{
"adminUser" : " your_admin_username" ,
"adminPass" : " your_admin_password"
}
Most endpoints accept JSON payloads
Login as User uses form-data
// Official wrapper: https://github.com/jetchirag/cyberpanel-whmcs/blob/master/api.php
Test API access and credentials.
Method
Endpoint
Content-Type
POST
/server/verify
application/json
Parameter
Type
Required
Description
adminUser
string
✅
Admin username
adminPass
string
✅
Admin password
{
"adminUser" : " admin" ,
"adminPass" : " secure_password"
}
{
"status" : " success" ,
"message" : " API access verified"
}
Generate session/login as another user (impersonation).
Method
Endpoint
Content-Type
POST
/server/loginasuser
multipart/form-data
Parameter
Type
Required
Description
adminUser
string
✅
Admin username
adminPass
string
✅
Admin password
userName
string
✅
Target username to impersonate
⚠️ Uses form-data , not JSON.
Provision a new website with user, package, and ACL assignment.
Method
Endpoint
Content-Type
POST
/websites/create
application/json
Parameter
Type
Required
Default
Description
adminUser
string
✅
-
Admin username
adminPass
string
✅
-
Admin password
domainName
string
✅
-
FQDN of new website (e.g., example.com)
ownerEmail
string
✅
-
Email for new user account
packageName
string
✅
-
Existing CyberPanel package name
websiteOwner
string
✅
-
Username for website owner (auto-created if missing)
ownerPassword
string
✅
-
Password for new user
websitesLimit
int
❌
1
Max websites allowed for this user
acl
string
❌
"user"
Access control level: admin, reseller, user, or custom
{
"adminUser" : " admin" ,
"adminPass" : " secure_password" ,
"domainName" : " example.com" ,
"ownerEmail" : " user@example.com" ,
"packageName" : " default" ,
"websiteOwner" : " example_user" ,
"ownerPassword" : " Str0ngP@ss!" ,
"websitesLimit" : 5 ,
"acl" : " user"
}
Remove a website and its configuration.
Method
Endpoint
Content-Type
POST
/websites/delete
application/json
Parameter
Type
Required
Description
adminUser
string
✅
Admin username
adminPass
string
✅
Admin password
domainName
string
✅
Website domain to delete
{
"adminUser" : " admin" ,
"adminPass" : " secure_password" ,
"domainName" : " example.com"
}
⚠️ Destructive action — irreversible without backup.
Upgrade/downgrade a website's resource package.
Method
Endpoint
Content-Type
POST
/websites/changepackage
application/json
Parameter
Type
Required
Description
adminUser
string
✅
Admin username
adminPass
string
✅
Admin password
websiteName
string
✅
Domain name of target website
packageName
string
✅
Must exist in CyberPanel packages
{
"adminUser" : " admin" ,
"adminPass" : " secure_password" ,
"websiteName" : " example.com" ,
"packageName" : " premium"
}
⏸️ Suspend/Un-suspend Website
Toggle website availability.
Method
Endpoint
Content-Type
POST
/websites/togglesuspend
application/json
Parameter
Type
Required
Values
Description
adminUser
string
✅
-
Admin username
adminPass
string
✅
-
Admin password
websiteName
string
✅
-
Domain name
state
string
✅
"Suspend" | "Activate"
Desired state
Example Request (Suspend)
{
"adminUser" : " admin" ,
"adminPass" : " secure_password" ,
"websiteName" : " example.com" ,
"state" : " Suspend"
}
Provision a new CyberPanel user account.
Method
Endpoint
Content-Type
POST
/users/create
application/json
Parameter
Type
Required
Default
Description
adminUser
string
✅
-
Admin username
adminPass
string
✅
-
Admin password
firstName
string
✅
-
User's first name
lastName
string
✅
-
User's last name
email
string
✅
-
User email address
userName
string
✅
-
Login username
password
string
✅
-
Account password
websitesLimit
int
✅
-
Max websites user can create
acl
string
✅
-
admin, reseller, user, or custom ACL
securityLevel
string
✅
-
"HIGH" or "LOW"
{
"adminUser" : " admin" ,
"adminPass" : " secure_password" ,
"firstName" : " John" ,
"lastName" : " Doe" ,
"email" : " john@example.com" ,
"userName" : " johndoe" ,
"password" : " Str0ngP@ss!" ,
"websitesLimit" : 3 ,
"acl" : " user" ,
"securityLevel" : " HIGH"
}
📝 Note: Documentation typo — websitesLimit description incorrectly says "Last Name of new user".
Retrieve details for a specific user.
Method
Endpoint
Content-Type
POST
/users/info
application/json
Parameter
Type
Required
Description
adminUser
string
✅
Admin username
adminPass
string
✅
Admin password
userName
string
✅
Target username to query
{
"adminUser" : " admin" ,
"adminPass" : " secure_password" ,
"userName" : " johndoe"
}
{
"status" : " success" ,
"data" : {
"userName" : " johndoe" ,
"email" : " john@example.com" ,
"websitesLimit" : 3 ,
"acl" : " user" ,
"securityLevel" : " HIGH"
}
}
Update password for an existing user.
Method
Endpoint
Content-Type
POST
/users/changepassword
application/json
Parameter
Type
Required
Description
adminUser
string
✅
Admin username
adminPass
string
✅
Admin password
websiteOwner
string
✅
Username whose password to change
ownerPassword
string
✅
New password value
{
"adminUser" : " admin" ,
"adminPass" : " secure_password" ,
"websiteOwner" : " johndoe" ,
"ownerPassword" : " NewStr0ngP@ss!"
}
Create a new iptables/firewall rule.
Method
Endpoint
Content-Type
POST
/firewall/addrule
application/json
Parameter
Type
Required
Description
adminUser
string
✅
Admin username
adminPass
string
✅
Admin password
ruleName
string
✅
Human-readable rule identifier
ruleProtocol
string
✅
"TCP" or "UDP"
rulePort
string
✅
Port number or range (e.g., "80", "8000-8010")
ruleIP
string
✅
CIDR IP range; use "0.0.0.0/0" for all IPs
Example Request (Allow HTTP from anywhere)
{
"adminUser" : " admin" ,
"adminPass" : " secure_password" ,
"ruleName" : " Allow HTTP" ,
"ruleProtocol" : " TCP" ,
"rulePort" : " 80" ,
"ruleIP" : " 0.0.0.0/0"
}
Example Request (Allow SSH from specific IP)
{
"adminUser" : " admin" ,
"adminPass" : " secure_password" ,
"ruleName" : " Allow SSH from Office" ,
"ruleProtocol" : " TCP" ,
"rulePort" : " 22" ,
"ruleIP" : " 203.0.113.45/32"
}
⚠️ Security Note : Always restrict ruleIP to minimal required range. Avoid 0.0.0.0/0 for sensitive ports.
🧰 Implementation Notes for PHP/Laravel
// Example: CyberPanel API Helper (Laravel-friendly)
class CyberPanelAPI {
protected $ baseUrl = 'https://your-cyberpanel:8090 ' ;
protected $ adminUser ;
protected $ adminPass ;
public function __construct ($ adminUser , $ adminPass ) {
$ this ->adminUser = $ adminUser ;
$ this ->adminPass = $ adminPass ;
}
protected function request ($ endpoint , array $ payload , $ asFormData = false ) {
$ client = new \GuzzleHttp \Client (['verify ' => false ]); // Self-signed cert common
$ options = [
'json ' => array_merge (['adminUser ' => $ this ->adminUser , 'adminPass ' => $ this ->adminPass ], $ payload ),
'timeout ' => 30 ,
];
if ($ asFormData ) {
unset($ options ['json ' ]);
$ options ['form_params ' ] = array_merge (['adminUser ' => $ this ->adminUser , 'adminPass ' => $ this ->adminPass ], $ payload );
}
return $ client ->post ("{$ this ->baseUrl }{$ endpoint }" , $ options );
}
public function verifyConnection () {
return $ this ->request ('/server/verify ' , []);
}
public function createWebsite (array $ data ) {
return $ this ->request ('/websites/create ' , $ data );
}
// ... additional methods per endpoint
}
🚀 Laravel Service Provider Snippet
// config/cyberpanel.php
return [
'base_url ' => env ('CYBERPANEL_URL ' , 'https://localhost:8090 ' ),
'admin_user ' => env ('CYBERPANEL_ADMIN_USER ' ),
'admin_pass ' => env ('CYBERPANEL_ADMIN_PASS ' ),
'timeout ' => 30 ,
'verify_ssl ' => false , // Adjust for production
];
⚠️ Best Practices & Warnings
Never hardcode credentials — use environment variables or Laravel config.
Use HTTPS — CyberPanel API typically runs on :8090 with self-signed certs; validate in production.
Rate limiting — No documented limits, but avoid rapid-fire requests.
Error handling — Always check response status and parse status field in JSON.
Idempotency — Most endpoints are not idempotent; implement client-side checks for create operations.
Backup before delete — Delete Website is irreversible via API.
Firewall rules — Test with non-critical ports first; misconfiguration can lock you out.
🔄 Response Format Convention
All endpoints return JSON with consistent structure:
{
"status" : " success|error" ,
"message" : " Human-readable description" ,
"data" : { ... } // Optional, endpoint-specific
}
✅ Skill Ready : This markdown file can be imported into documentation systems, used for API client generation, or integrated into Laravel service layers.