مستندات فنی API Technical API Docs
راهنمای کامل نسخه 3.۰.۰ با پشتیبانی از چند پروتکل (OpenVPN, L2TP, Cisco, WireGuard AnyConnect). کنترل کامل بر روی کاربران، نودهای توزیع شده، پورتهای اختصاصی و سیستم نمایندگی پیشرفته.
Complete guide for v3.0.0 supporting Multi-Protocols (OpenVPN, L2TP, Cisco, WireGuard AnyConnect). Full control over users, distributed nodes, custom ports, and advanced reseller system.
https://your-domain.com:PORT
OVPN / L2TP / CISCO / WG1
احراز هویتAuthentication
تمام درخواستها نیازمند هدر X-API-KEY هستند.
All requests require the X-API-KEY header.
X-API-KEY: y0ur_s3cur3_ap1_k3y_h3r3
Content-Type: application/json
{ "success": true, "message": "Panel is online", "timestamp": "2024-01-01T12:00:00.000000" }
مدیریت کاربرانUser Management
لیست کامل کاربران. اگر کلید شما ادمین اصلی باشد، علاوهبر کاربران، ساختار نمایندگان (sub-admins) هم برگردانده میشود. اگر کلید شما متعلق به نماینده باشد، فقط کاربران همان نماینده برگردانده میشوند. List users. With a main admin key, it returns main-admin users plus sub-admins structure. With a sub-admin key, it returns only that sub-admin’s users.
پارامترهای ورودی Input Parameters
این اندپوینت پارامتر ورودی ندارد (بهجز هدر X-API-KEY و پارامترهای مسیر).
This endpoint has no input parameters (except X-API-KEY header and path params).
مثالهای cURL (۳ نمونه) cURL Examples (3)
cURL
curl -s "http://YOUR_PANEL_DOMAIN/api/v1/users/list_all" \
-H "X-API-KEY: YOUR_MAIN_ADMIN_API_KEY"
Response
{
"success": true,
"main_admin": {
"users": [
{
"username": "user1"
}
]
},
"sub_admins": [
{
"id": 1,
"username": "sa1",
"users": [
{
"username": "sa_user1"
}
]
}
]
}
cURL
curl -s "http://YOUR_PANEL_DOMAIN/api/v1/users/list_all" \
-H "X-API-KEY: YOUR_SUB_ADMIN_API_KEY"
Response
{
"success": true,
"users": [
{
"username": "sa_user1"
},
{
"username": "sa_user2"
}
]
}
cURL
curl -s "http://YOUR_PANEL_DOMAIN/api/v1/users/list_all"
Response
{
"success": false,
"message": "API key is missing"
}
ایجاد کاربر (تکی یا گروهی/Bulk). در حالت Bulk با ارسال bulk_count چند کاربر با نامهای رند ساخته میشود. اگر کلید sub-admin باشد، محدودیت تعداد کاربران و سهمیه ترافیک نماینده اعمال میشود و sub_admin_id نادیده گرفته میشود.
Create user(s) (Single or Bulk). In Bulk mode, send bulk_count to create random usernames. With a sub-admin key, user-count and quota limits apply and sub_admin_id is ignored.
پارامترهای ورودی Input Parameters
bulk_count ارسال نشده باشد، اجباری است.
Username for single mode. Required if bulk_count is not provided.
fixed_date (پیشفرض) یا flexible_days.
Activation type: fixed_date (default) or flexible_days.
flexible_days: تعداد روز بعد از اولین اتصال.
Only for flexible_days: days after first connection.
fixed_date: تاریخ انقضا (YYYY-MM-DD).
For fixed_date: expiry date (YYYY-MM-DD).
fixed_date: تعداد روز از الان (اگر expiry_date_str نبود).
For fixed_date: days from now (if expiry_date_str not set).
نکات مهم Important Notes
در حالت Bulk نام کاربریها بهصورت رند ساخته میشوند. در پاسخ، لیست کاربران ساختهشده برمیگردد و همگامسازی سنگین با نودها در پسزمینه انجام میشود. In bulk mode usernames are random. Response includes created users; heavy node sync runs in background.
مثالهای cURL (۳ نمونه) cURL Examples (3)
cURL
curl -s "http://YOUR_PANEL_DOMAIN/api/v1/users" \
-H "X-API-KEY: YOUR_MAIN_ADMIN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"username": "test_user",
"max_clients": 2,
"activation_type": "fixed_date",
"expiry_date_str": "2026-12-31",
"data_limit": 50,
"data_limit_unit": "GB",
"enable_wg1": true
}'
Response
{
"success": true,
"message": "Users created successfully.",
"created_users": [
"test_user"
]
}
cURL
curl -s "http://YOUR_PANEL_DOMAIN/api/v1/users" \
-H "X-API-KEY: YOUR_MAIN_ADMIN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"bulk_count": 3,
"activation_type": "flexible_days",
"pending_activation_days": 30,
"enable_l2tp": true,
"l2tp_password": "P@ss1234"
}'
Response
{
"success": true,
"message": "Users created successfully.",
"created_users": [
"user1234",
"user5678",
"user9012"
]
}
cURL
curl -s "http://YOUR_PANEL_DOMAIN/api/v1/users" \
-H "X-API-KEY: YOUR_MAIN_ADMIN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"max_clients": 1
}'
Response
{
"success": false,
"message": "Username is required."
}
دریافت اطلاعات کامل کاربر + وضعیت آنلاین + ترافیک + پروتکلها (OpenVPN/L2TP/Cisco/WireGuard) و لیست سرورهای مربوط. اگر کلید sub-admin باشد فقط به کاربران خودش دسترسی دارد. Get full user details + online status + traffic + protocols (OpenVPN/L2TP/Cisco/WireGuard) and related server lists. Sub-admin keys can access only their own users.
پارامترهای ورودی Input Parameters
مثالهای cURL (۳ نمونه) cURL Examples (3)
cURL
curl -s "http://YOUR_PANEL_DOMAIN/api/v1/users/test_user" \
-H "X-API-KEY: YOUR_MAIN_ADMIN_API_KEY"
Response
{
"success": true,
"username": "test_user",
"is_active": true,
"is_online": false,
"active_connections": 0,
"data_limit": 50,
"data_limit_unit": "GB",
"total_traffic_bytes": 123456,
"openvpn_servers": [
{
"name": "Main Server",
"is_tunnel": false
}
]
}
cURL
curl -s "http://YOUR_PANEL_DOMAIN/api/v1/users/unknown_user" \
-H "X-API-KEY: YOUR_SUB_ADMIN_API_KEY"
Response
{
"success": false,
"message": "User not found or permission denied"
}
cURL
curl -s "http://YOUR_PANEL_DOMAIN/api/v1/users/test_user"
Response
{
"success": false,
"message": "API key is missing"
}
ویرایش کاربر. ورودیها به منطق مرکزی بهصورت فرمگونه تبدیل میشوند. این اندپوینت هم nodes و هم نام قدیمیتر allowed_nodes را میپذیرد. همچنین expiry_date_str بهعنوان ورودی قدیمی پشتیبانی میشود.
Edit a user. Input is converted into the internal update logic (form-like). Accepts both nodes and legacy allowed_nodes. Also supports legacy expiry_date_str.
پارامترهای ورودی Input Parameters
مثالهای cURL (۳ نمونه) cURL Examples (3)
cURL
curl -s -X PUT "http://YOUR_PANEL_DOMAIN/api/v1/users/test_user" \
-H "X-API-KEY: YOUR_MAIN_ADMIN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"max_clients": 3,
"data_limit": 100,
"data_limit_unit": "GB",
"notes": "VIP user"
}'
Response
{
"success": true,
"message": "User updated successfully."
}
cURL
curl -s -X PUT "http://YOUR_PANEL_DOMAIN/api/v1/users/test_user" \
-H "X-API-KEY: YOUR_MAIN_ADMIN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"enable_wg1": true,
"nodes": [
"main",
"node_1"
]
}'
Response
{
"success": true,
"message": "User updated successfully."
}
cURL
curl -s -X PUT "http://YOUR_PANEL_DOMAIN/api/v1/users/test_user" \
-H "X-API-KEY: YOUR_MAIN_ADMIN_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'
Response
{
"success": false,
"message": "Request body must be JSON and not empty"
}
عملیات کاربران User Actions
API Keyفعال/غیرفعال کردن کاربر (روی تمام پروتکلها اثر میگذارد). Enable/disable a user (affects all protocols).
پارامترهای ورودی Input Parameters
مثالهای cURL (۳ نمونه) cURL Examples (3)
cURL
curl -s -X POST "http://YOUR_PANEL_DOMAIN/api/v1/users/test_user/toggle" \
-H "X-API-KEY: YOUR_MAIN_ADMIN_API_KEY"
Response
{
"success": true,
"message": "User toggled"
}
cURL
curl -s -X POST "http://YOUR_PANEL_DOMAIN/api/v1/users/unknown_user/toggle" \
-H "X-API-KEY: YOUR_SUB_ADMIN_API_KEY"
Response
{
"success": false,
"message": "User not found or permission denied"
}
cURL
curl -s -X POST "http://YOUR_PANEL_DOMAIN/api/v1/users/test_user/toggle"
Response
{
"success": false,
"message": "API key is missing"
}
باطلسازی توکن اشتراک و صدور/ساخت مجدد گواهی (کار سنگین در پسزمینه). لینک اشتراک قدیمی فوراً باطل میشود و لینک جدید در پاسخ برمیگردد. Revoke subscription token and re-issue certificate (heavy task in background). Old subscription link is invalidated instantly; new link is returned.
پارامترهای ورودی Input Parameters
مثالهای cURL (۳ نمونه) cURL Examples (3)
cURL
curl -s -X POST "http://YOUR_PANEL_DOMAIN/api/v1/users/test_user/revoke" \
-H "X-API-KEY: YOUR_MAIN_ADMIN_API_KEY"
Response
{
"success": true,
"message": "Token revoked instantly. Certificate generation running in background.",
"new_subscription_url": "http://YOUR_PANEL_DOMAIN/sub/test_user?token=NEW..."
}
cURL
curl -s -X POST "http://YOUR_PANEL_DOMAIN/api/v1/users/other_user/revoke" \
-H "X-API-KEY: YOUR_SUB_ADMIN_API_KEY"
Response
{
"success": false,
"message": "User not found or permission denied."
}
cURL
curl -s -X POST "http://YOUR_PANEL_DOMAIN/api/v1/users/unknown_user/revoke" \
-H "X-API-KEY: YOUR_MAIN_ADMIN_API_KEY"
Response
{
"success": false,
"message": "User not found or permission denied."
}
ریست ترافیک کاربر (download/upload) به صفر. در صورت امکان ممکن است کاربر دوباره فعال شود (در پاسخ فیلد user_re_enabled).
Reset user's traffic (download/upload) to zero. May re-enable the user when possible (see user_re_enabled).
پارامترهای ورودی Input Parameters
مثالهای cURL (۳ نمونه) cURL Examples (3)
cURL
curl -s -X POST "http://YOUR_PANEL_DOMAIN/api/v1/users/test_user/reset_traffic" \
-H "X-API-KEY: YOUR_MAIN_ADMIN_API_KEY"
Response
{
"success": true,
"message": "Traffic reset for 'test_user'.",
"user_re_enabled": false
}
cURL
curl -s -X POST "http://YOUR_PANEL_DOMAIN/api/v1/users/unknown_user/reset_traffic" \
-H "X-API-KEY: YOUR_SUB_ADMIN_API_KEY"
Response
{
"success": false,
"message": "User not found or permission denied"
}
cURL
curl -s -X POST "http://YOUR_PANEL_DOMAIN/api/v1/users/test_user/reset_traffic" \
-H "X-API-KEY: YOUR_MAIN_ADMIN_API_KEY"
Response
{
"success": false,
"message": "An internal error occurred."
}
حذف کاربر Delete User
API Keyحذف کاربر. اگر کلید sub-admin باشد فقط میتواند کاربران خودش را حذف کند. Delete a user. Sub-admin keys can delete only their own users.
پارامترهای ورودی Input Parameters
مثالهای cURL (۳ نمونه) cURL Examples (3)
cURL
curl -s -X DELETE "http://YOUR_PANEL_DOMAIN/api/v1/users/test_user" \
-H "X-API-KEY: YOUR_MAIN_ADMIN_API_KEY"
Response
{
"success": true,
"message": "User 'test_user' deleted successfully."
}
cURL
curl -s -X DELETE "http://YOUR_PANEL_DOMAIN/api/v1/users/unknown_user" \
-H "X-API-KEY: YOUR_SUB_ADMIN_API_KEY"
Response
{
"success": false,
"message": "User not found or permission denied"
}
cURL
curl -s -X DELETE "http://YOUR_PANEL_DOMAIN/api/v1/users/test_user" \
-H "X-API-KEY: INVALID_KEY"
Response
{
"success": false,
"message": "Invalid or inactive API key"
}
لینک اشتراک کاربر User Subscription URL
API Keyدریافت لینک اشتراک (Subscription URL) کاربر. برای sub-admin فقط کاربران خودش قابل مشاهده است. Get user's subscription URL. Sub-admin keys can access only their own users.
پارامترهای ورودی Input Parameters
مثالهای cURL (۳ نمونه) cURL Examples (3)
cURL
curl -s "http://YOUR_PANEL_DOMAIN/api/v1/users/test_user/sub" \
-H "X-API-KEY: YOUR_MAIN_ADMIN_API_KEY"
Response
{
"success": true,
"sub_url": "http://YOUR_PANEL_DOMAIN/sub/test_user?token=..."
}
cURL
curl -s "http://YOUR_PANEL_DOMAIN/api/v1/users/unknown_user/sub" \
-H "X-API-KEY: YOUR_SUB_ADMIN_API_KEY"
Response
{
"success": false,
"message": "User not found or permission denied"
}
cURL
curl -s "http://YOUR_PANEL_DOMAIN/api/v1/users/test_user/sub"
Response
{
"success": false,
"message": "API key is missing"
}
اطلاعات کامل اتصال (OpenVPN/L2TP/Cisco/WireGuard) All Connection Info (OpenVPN/L2TP/Cisco/WireGuard)
API Keyدریافت همه لینکهای دانلود/کانفیگ OpenVPN مربوط به کاربر. برای sub-admin فقط کاربران خودش. Get all OpenVPN download/config links for a user. Sub-admin keys can access only their own users.
پارامترهای ورودی Input Parameters
مثالهای cURL (۳ نمونه) cURL Examples (3)
cURL
curl -s "http://YOUR_PANEL_DOMAIN/api/v1/users/test_user/all_ovpn_links" \
-H "X-API-KEY: YOUR_MAIN_ADMIN_API_KEY"
Response
{
"success": true,
"username": "test_user",
"links": [
{
"name": "main_udp",
"url": "http://YOUR_PANEL_DOMAIN/download/test_user/main_udp.ovpn"
}
]
}
cURL
curl -s "http://YOUR_PANEL_DOMAIN/api/v1/users/other_user/all_ovpn_links" \
-H "X-API-KEY: YOUR_SUB_ADMIN_API_KEY"
Response
{
"success": false,
"message": "User not found or permission denied"
}
cURL
curl -s "http://YOUR_PANEL_DOMAIN/api/v1/users/test_user/all_ovpn_links" \
-H "X-API-KEY: INVALID_KEY"
Response
{
"success": false,
"message": "Invalid or inactive API key"
}
مدیریت نودهاNode Management
کنترل سرورهای فرعی و زیرساخت (Async Provisioning)Manage slave servers and infrastructure (Async Provisioning)
سطح دسترسی: ادمین اصلیAccess Level: Main Admin Only
مدیریت نودها فقط با کلید ادمین اصلی امکانپذیر است. نمایندگان (Sub-Admins) دسترسی به این بخش ندارند. Node management is restricted to the Main Admin Key. Sub-Admins do not have access to infrastructure settings.
لیست تمام نودها بههمراه وضعیت و ترافیک تجمیعی (از حافظه/STATE). List all nodes including status and aggregated traffic (from memory/STATE).
پارامترهای ورودی Input Parameters
این اندپوینت پارامتر ورودی ندارد (بهجز هدر X-API-KEY و پارامترهای مسیر).
This endpoint has no input parameters (except X-API-KEY header and path params).
مثالهای cURL (۳ نمونه) cURL Examples (3)
cURL
curl -s "http://YOUR_PANEL_DOMAIN/api/v1/nodes" \
-H "X-API-KEY: YOUR_MAIN_ADMIN_API_KEY"
Response
{
"success": true,
"nodes": [
{
"id": 1,
"name": "Node A",
"ip_address": "1.2.3.4",
"status": "active",
"total_traffic_bytes": 123456
}
]
}
cURL
curl -s "http://YOUR_PANEL_DOMAIN/api/v1/nodes" \
-H "X-API-KEY: YOUR_SUB_ADMIN_API_KEY"
Response
{
"success": true,
"nodes": [
{
"id": 1,
"name": "Node A",
"status": "active"
}
]
}
cURL
curl -s "http://YOUR_PANEL_DOMAIN/api/v1/nodes" \
-H "X-API-KEY: INVALID_KEY"
Response
{
"success": false,
"message": "Invalid or inactive API key"
}
ایجاد نود جدید و شروع نصب/Provision در پسزمینه (پاسخ 202). این متد فقط برای main_admin مجاز است. Create a new node and start provisioning in background (returns 202). Main-admin only.
پارامترهای ورودی Input Parameters
نکات مهم Important Notes
در صورت موفقیت، پاسخ 202 بههمراه node_id برمیگردد و نصب در پسزمینه ادامه پیدا میکند. اگر اتصال SSH تست اولیه را پاس نکند، خطا میگیرید. On success returns 202 with node_id; provisioning continues in background. SSH preflight failures return errors.
مثالهای cURL (۳ نمونه) cURL Examples (3)
cURL
curl -s -X POST "http://YOUR_PANEL_DOMAIN/api/v1/nodes" \
-H "X-API-KEY: YOUR_MAIN_ADMIN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Node A",
"ip_address": "1.2.3.4",
"ssh_password": "pass",
"openvpn_port": 1194,
"protocol": "udp",
"sync_all_users": false,
"communication_method": "wireguard"
}'
Response
{
"success": true,
"message": "Node created and installation started in background.",
"node_id": 1
}
cURL
curl -s -X POST "http://YOUR_PANEL_DOMAIN/api/v1/nodes" \
-H "X-API-KEY: YOUR_SUB_ADMIN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Node B",
"ip_address": "2.3.4.5",
"ssh_password": "pass"
}'
Response
{
"success": false,
"message": "Permission denied: Main admin API key required."
}
cURL
curl -s -X POST "http://YOUR_PANEL_DOMAIN/api/v1/nodes" \
-H "X-API-KEY: YOUR_MAIN_ADMIN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Node C"
}'
Response
{
"success": false,
"message": "Missing required fields: name, ip_address, ssh_password"
}
ویرایش نود و تریگر همگامسازی فقط برای سرویسهایی که تغییر کردهاند. (در کد فعلی محدودیت نقش برای PUT/DELETE نود اعمال نشده — فقط API key لازم است.) Edit node and trigger sync only for changed services. (Current code does not restrict role for node PUT/DELETE — only API key is required.)
پارامترهای ورودی Input Parameters
مثالهای cURL (۳ نمونه) cURL Examples (3)
cURL
curl -s -X PUT "http://YOUR_PANEL_DOMAIN/api/v1/nodes/1" \
-H "X-API-KEY: YOUR_MAIN_ADMIN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"openvpn_port": 443,
"protocol": "tcp"
}'
Response
{
"success": true,
"message": "Node updated. Sync triggered only for changed services."
}
cURL
curl -s -X PUT "http://YOUR_PANEL_DOMAIN/api/v1/nodes/1" \
-H "X-API-KEY: YOUR_MAIN_ADMIN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Node A (EU)",
"ip_address": "5.6.7.8"
}'
Response
{
"success": true,
"message": "Node updated. Sync triggered only for changed services."
}
cURL
curl -s -X PUT "http://YOUR_PANEL_DOMAIN/api/v1/nodes/999999" \
-H "X-API-KEY: YOUR_MAIN_ADMIN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"protocol": "udp"
}'
Response
{
"success": false,
"message": "Node not found"
}
حذف نود (غیرهمزمان). اگر حذف قبلاً شکست خورده باشد، حالت force فعال میشود. اگر حذف در جریان باشد کد 423 برمیگردد. (نکته: در کد اگر نود وجود نداشته باشد پیام success:true ولی status=404 برمیگردد.) Delete node (async). Force mode is used if previous deletion failed. Returns 423 if deletion is already in progress. (Note: if node not found, code returns success:true with HTTP 404.)
پارامترهای ورودی Input Parameters
مثالهای cURL (۳ نمونه) cURL Examples (3)
cURL
curl -s -X DELETE "http://YOUR_PANEL_DOMAIN/api/v1/nodes/1" \
-H "X-API-KEY: YOUR_MAIN_ADMIN_API_KEY"
Response
{
"success": true,
"message": "Deletion started"
}
cURL
curl -s -X DELETE "http://YOUR_PANEL_DOMAIN/api/v1/nodes/1" \
-H "X-API-KEY: YOUR_MAIN_ADMIN_API_KEY"
Response
{
"success": false,
"message": "Deletion in progress..."
}
cURL
curl -s -X DELETE "http://YOUR_PANEL_DOMAIN/api/v1/nodes/999999" \
-H "X-API-KEY: YOUR_MAIN_ADMIN_API_KEY"
Response
{
"success": true,
"message": "Node not found"
}
مدیریت پورتهاPort Management
مدیریت پورتهای ورودی (TCP/UDP) و اختصاص به سرورهاManage inbound ports (TCP/UDP) and server assignments
لیست پورتهای پیشفرض و پورتهای سفارشی اختصاصدادهشده به سرورها. فقط main_admin. List default ports and custom port assignments per server. Main-admin only.
پارامترهای ورودی Input Parameters
این اندپوینت پارامتر ورودی ندارد (بهجز هدر X-API-KEY و پارامترهای مسیر).
This endpoint has no input parameters (except X-API-KEY header and path params).
مثالهای cURL (۳ نمونه) cURL Examples (3)
cURL
curl -s "http://YOUR_PANEL_DOMAIN/api/v1/public/ports" \
-H "X-API-KEY: YOUR_MAIN_ADMIN_API_KEY"
Response
{
"success": true,
"default_ports": [
{
"is_default": true,
"name": "Main Server",
"public_port": 1194,
"protocol": "udp"
}
],
"custom_ports": [
{
"port_id": 2,
"server_identifier": "node_1",
"public_port": 443,
"protocol": "tcp",
"server_name": "Node: Node A"
}
]
}
cURL
curl -s "http://YOUR_PANEL_DOMAIN/api/v1/public/ports" \
-H "X-API-KEY: YOUR_SUB_ADMIN_API_KEY"
Response
{
"success": false,
"message": "Permission denied: Main admin API key required."
}
cURL
curl -s "http://YOUR_PANEL_DOMAIN/api/v1/public/ports" \
-H "X-API-KEY: INVALID_KEY"
Response
{
"success": false,
"message": "Invalid or inactive API key"
}
لیست سرورها (Main + Nodeها) برای مدیریت پورتها. خروجی شامل idهای لازم مثل main و node_<id> است. فقط main_admin.
List servers (Main + Nodes) for port management. Returns IDs like main and node_<id>. Main-admin only.
پارامترهای ورودی Input Parameters
این اندپوینت پارامتر ورودی ندارد (بهجز هدر X-API-KEY و پارامترهای مسیر).
This endpoint has no input parameters (except X-API-KEY header and path params).
مثالهای cURL (۳ نمونه) cURL Examples (3)
cURL
curl -s "http://YOUR_PANEL_DOMAIN/api/v1/public/servers_for_ports" \
-H "X-API-KEY: YOUR_MAIN_ADMIN_API_KEY"
Response
{
"success": true,
"servers": [
{
"id": "main",
"name": "Main Server"
},
{
"id": "node_1",
"name": "Node: Node A"
}
]
}
cURL
curl -s "http://YOUR_PANEL_DOMAIN/api/v1/public/servers_for_ports" \
-H "X-API-KEY: YOUR_SUB_ADMIN_API_KEY"
Response
{
"success": false,
"message": "Permission denied: Main admin API key required."
}
cURL
curl -s "http://YOUR_PANEL_DOMAIN/api/v1/public/servers_for_ports" \
-H "X-API-KEY: YOUR_MAIN_ADMIN_API_KEY"
Response
{
"success": false,
"message": "An internal error occurred."
}
ایجاد/ثبت پورت و اختصاص آن به سرورهای انتخابشده (server_ids). اگر پورت/پروتکل قبلاً وجود داشته باشد، فقط Assignmentها اضافه میشوند. فقط main_admin.
Create/register a port and assign it to selected servers (server_ids). If the port/protocol already exists, only assignments are added. Main-admin only.
پارامترهای ورودی Input Parameters
مثالهای cURL (۳ نمونه) cURL Examples (3)
cURL
curl -s -X POST "http://YOUR_PANEL_DOMAIN/api/v1/public/ports" \
-H "X-API-KEY: YOUR_MAIN_ADMIN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"public_port": 443,
"protocol": "tcp",
"server_ids": [
"main",
"node_1"
]
}'
Response
{
"success": true,
"message": "Port configured on selected servers."
}
cURL
curl -s -X POST "http://YOUR_PANEL_DOMAIN/api/v1/public/ports" \
-H "X-API-KEY: YOUR_MAIN_ADMIN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"public_port": 443,
"protocol": "tcp",
"server_ids": []
}'
Response
{
"success": false,
"message": "Missing info."
}
cURL
curl -s -X POST "http://YOUR_PANEL_DOMAIN/api/v1/public/ports" \
-H "X-API-KEY: YOUR_SUB_ADMIN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"public_port": 443,
"protocol": "tcp",
"server_ids": [
"main"
]
}'
Response
{
"success": false,
"message": "Permission denied"
}
حذف یک assignment از پورت روی یک سرور مشخص. ورودی شامل port_id و server_identifier است. فقط main_admin.
Delete a port assignment on a specific server. Input includes port_id and server_identifier. Main-admin only.
پارامترهای ورودی Input Parameters
مثالهای cURL (۳ نمونه) cURL Examples (3)
cURL
curl -s -X DELETE "http://YOUR_PANEL_DOMAIN/api/v1/public/ports/assignment" \
-H "X-API-KEY: YOUR_MAIN_ADMIN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"port_id": 2,
"server_identifier": "node_1"
}'
Response
{
"success": true,
"message": "Port assignment deleted."
}
cURL
curl -s -X DELETE "http://YOUR_PANEL_DOMAIN/api/v1/public/ports/assignment" \
-H "X-API-KEY: YOUR_MAIN_ADMIN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"port_id": 2
}'
Response
{
"success": false,
"message": "Missing info."
}
cURL
curl -s -X DELETE "http://YOUR_PANEL_DOMAIN/api/v1/public/ports/assignment" \
-H "X-API-KEY: YOUR_SUB_ADMIN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"port_id": 2,
"server_identifier": "main"
}'
Response
{
"success": false,
"message": "Permission denied"
}
مدیریت نمایندگانSub-Admin Management
فقط ادمین اصلیMain Admin Only
لیست تمام نمایندگان (Sub-Admins). فقط main_admin. List all sub-admins. Main-admin only.
پارامترهای ورودی Input Parameters
این اندپوینت پارامتر ورودی ندارد (بهجز هدر X-API-KEY و پارامترهای مسیر).
This endpoint has no input parameters (except X-API-KEY header and path params).
مثالهای cURL (۳ نمونه) cURL Examples (3)
cURL
curl -s "http://YOUR_PANEL_DOMAIN/api/v1/sub_admins" \
-H "X-API-KEY: YOUR_MAIN_ADMIN_API_KEY"
Response
{
"success": true,
"sub_admins": [
{
"id": 1,
"username": "sa1",
"subscription_port": 2096,
"panel_port": 8888,
"max_users_limit": 100,
"total_usage_quota_gb": 500
}
]
}
cURL
curl -s "http://YOUR_PANEL_DOMAIN/api/v1/sub_admins" \
-H "X-API-KEY: YOUR_SUB_ADMIN_API_KEY"
Response
{
"success": false,
"message": "Permission denied"
}
cURL
curl -s "http://YOUR_PANEL_DOMAIN/api/v1/sub_admins" \
-H "X-API-KEY: INVALID_KEY"
Response
{
"success": false,
"message": "Invalid or inactive API key"
}
ایجاد نماینده جدید با اعتبارسنجی پورتها و تنظیم فایروال. فقط main_admin. Create a new sub-admin with port validation and firewall setup. Main-admin only.
پارامترهای ورودی Input Parameters
مثالهای cURL (۳ نمونه) cURL Examples (3)
cURL
curl -s -X POST "http://YOUR_PANEL_DOMAIN/api/v1/sub_admins" \
-H "X-API-KEY: YOUR_MAIN_ADMIN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"username": "sa1",
"password": "pass",
"subscription_port": 2096,
"panel_port": 8888,
"max_users_limit": 100,
"total_usage_quota_gb": 500,
"is_active": true,
"notes": "Reseller A",
"allowed_servers": [
"main",
"node_1"
]
}'
Response
{
"success": true,
"message": "Sub-admin created successfully and ports configured.",
"sub_admin": {
"id": 1,
"username": "sa1"
}
}
cURL
curl -s -X POST "http://YOUR_PANEL_DOMAIN/api/v1/sub_admins" \
-H "X-API-KEY: YOUR_MAIN_ADMIN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"username": "sa1",
"password": "pass"
}'
Response
{
"success": false,
"message": "A sub-admin with this username already exists."
}
cURL
curl -s -X POST "http://YOUR_PANEL_DOMAIN/api/v1/sub_admins" \
-H "X-API-KEY: YOUR_MAIN_ADMIN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"username": "sa2"
}'
Response
{
"success": false,
"message": "Username and password are required."
}
ویرایش نماینده با منطق مدیریت پورتها (در صورت تغییر) و بهروزرسانی فایروال. فقط main_admin. Edit sub-admin with port management (if changed) and firewall updates. Main-admin only.
پارامترهای ورودی Input Parameters
مثالهای cURL (۳ نمونه) cURL Examples (3)
cURL
curl -s -X PUT "http://YOUR_PANEL_DOMAIN/api/v1/sub_admins/1" \
-H "X-API-KEY: YOUR_MAIN_ADMIN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"max_users_limit": 200,
"total_usage_quota_gb": 1000,
"notes": "Upgraded"
}'
Response
{
"success": true,
"message": "Sub-admin updated successfully.",
"sub_admin": {
"id": 1
}
}
cURL
curl -s -X PUT "http://YOUR_PANEL_DOMAIN/api/v1/sub_admins/1" \
-H "X-API-KEY: YOUR_MAIN_ADMIN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"subscription_port": 2097,
"panel_port": 8890
}'
Response
{
"success": true,
"message": "Sub-admin updated successfully.",
"sub_admin": {
"id": 1
}
}
cURL
curl -s -X PUT "http://YOUR_PANEL_DOMAIN/api/v1/sub_admins/999999" \
-H "X-API-KEY: YOUR_MAIN_ADMIN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"notes": "x"
}'
Response
{
"success": false,
"message": "Sub-admin not found"
}
ریست مصرف ترافیک نماینده به صفر و تلاش برای فعالسازی مجدد کاربران نماینده. فقط main_admin. Reset sub-admin total usage to zero and attempt to re-enable their users. Main-admin only.
پارامترهای ورودی Input Parameters
مثالهای cURL (۳ نمونه) cURL Examples (3)
cURL
curl -s -X POST "http://YOUR_PANEL_DOMAIN/api/v1/sub_admins/1/reset_usage" \
-H "X-API-KEY: YOUR_MAIN_ADMIN_API_KEY"
Response
{
"success": true,
"message": "Total data usage reset successfully. 5 user(s) were re-enabled."
}
cURL
curl -s -X POST "http://YOUR_PANEL_DOMAIN/api/v1/sub_admins/999999/reset_usage" \
-H "X-API-KEY: YOUR_MAIN_ADMIN_API_KEY"
Response
{
"success": false,
"message": "Sub-admin not found."
}
cURL
curl -s -X POST "http://YOUR_PANEL_DOMAIN/api/v1/sub_admins/1/reset_usage" \
-H "X-API-KEY: YOUR_SUB_ADMIN_API_KEY"
Response
{
"success": false,
"message": "Permission denied"
}
حذف نماینده و تمام کاربران وابسته با منطق مرکزی. فقط main_admin. Delete a sub-admin and all their users via central logic. Main-admin only.
پارامترهای ورودی Input Parameters
مثالهای cURL (۳ نمونه) cURL Examples (3)
cURL
curl -s -X DELETE "http://YOUR_PANEL_DOMAIN/api/v1/sub_admins/1" \
-H "X-API-KEY: YOUR_MAIN_ADMIN_API_KEY"
Response
{
"success": true,
"message": "Sub-admin deleted successfully."
}
cURL
curl -s -X DELETE "http://YOUR_PANEL_DOMAIN/api/v1/sub_admins/999999" \
-H "X-API-KEY: YOUR_MAIN_ADMIN_API_KEY"
Response
{
"success": false,
"message": "Sub-admin not found"
}
cURL
curl -s -X DELETE "http://YOUR_PANEL_DOMAIN/api/v1/sub_admins/1" \
-H "X-API-KEY: YOUR_SUB_ADMIN_API_KEY"
Response
{
"success": false,
"message": "Permission denied"
}
تنظیمات سرورServer Settings
مدیریت تنظیمات هسته VPN (مانند کلیدهای امنیتی)Manage Core VPN Settings (Security Keys)
دریافت تنظیمات عمومی سرور (فعلاً PSK). فقط main_admin. Get server settings (currently PSK). Main-admin only.
پارامترهای ورودی Input Parameters
این اندپوینت پارامتر ورودی ندارد (بهجز هدر X-API-KEY و پارامترهای مسیر).
This endpoint has no input parameters (except X-API-KEY header and path params).
مثالهای cURL (۳ نمونه) cURL Examples (3)
cURL
curl -s "http://YOUR_PANEL_DOMAIN/api/v1/server_settings" \
-H "X-API-KEY: YOUR_MAIN_ADMIN_API_KEY"
Response
{
"success": true,
"settings": {
"ipsec_psk": "EylanPanelKey123"
}
}
cURL
curl -s "http://YOUR_PANEL_DOMAIN/api/v1/server_settings" \
-H "X-API-KEY: YOUR_SUB_ADMIN_API_KEY"
Response
{
"success": false,
"message": "Permission denied: Main admin API key required."
}
cURL
curl -s "http://YOUR_PANEL_DOMAIN/api/v1/server_settings" \
-H "X-API-KEY: INVALID_KEY"
Response
{
"success": false,
"message": "Invalid or inactive API key"
}
بهروزرسانی PSK برای IPsec روی سرور اصلی و تلاش برای اعمال روی نودها. فقط main_admin. مقدار PSK نباید خالی باشد و نباید شامل کوتیشن دابل (") باشد. Update IPsec PSK on main server and attempt to apply on nodes. Main-admin only. PSK must be non-empty and must not contain double quotes (").
پارامترهای ورودی Input Parameters
مثالهای cURL (۳ نمونه) cURL Examples (3)
cURL
curl -s -X POST "http://YOUR_PANEL_DOMAIN/api/v1/update_ipsec_psk" \
-H "X-API-KEY: YOUR_MAIN_ADMIN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"new_psk": "MyNewSecurePSK_2026"
}'
Response
{
"success": true,
"message": "IPsec PSK updated locally and on 2 nodes."
}
cURL
curl -s -X POST "http://YOUR_PANEL_DOMAIN/api/v1/update_ipsec_psk" \
-H "X-API-KEY: YOUR_MAIN_ADMIN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"new_psk": ""
}'
Response
{
"success": false,
"message": "Invalid PSK. Cannot be empty or contain double quotes."
}
cURL
curl -s -X POST "http://YOUR_PANEL_DOMAIN/api/v1/update_ipsec_psk" \
-H "X-API-KEY: YOUR_SUB_ADMIN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"new_psk": "X"
}'
Response
{
"success": false,
"message": "Permission denied: Main admin API key required."
}
API مخصوص رباتBot Integration API
ابزارهای کمکی برای توسعه رباتهای تلگرام و پنلهای نمایندگی Helper tools for Telegram bots and Reseller panels development
لیست کامل سرورهای قابل انتخاب برای نمایندگان (برای پر کردن فیلد allowed_servers). فقط main_admin.
Return all selectable servers for sub-admin creation (used for allowed_servers). Main-admin only.
پارامترهای ورودی Input Parameters
این اندپوینت پارامتر ورودی ندارد (بهجز هدر X-API-KEY و پارامترهای مسیر).
This endpoint has no input parameters (except X-API-KEY header and path params).
مثالهای cURL (۳ نمونه) cURL Examples (3)
cURL
curl -s "http://YOUR_PANEL_DOMAIN/api/v1/public/all_selectable_servers" \
-H "X-API-KEY: YOUR_MAIN_ADMIN_API_KEY"
Response
{
"success": true,
"servers": [
{
"id": "main",
"name": "Main Server"
},
{
"id": "node_1",
"name": "Node: Node A"
}
]
}
cURL
curl -s "http://YOUR_PANEL_DOMAIN/api/v1/public/all_selectable_servers" \
-H "X-API-KEY: YOUR_SUB_ADMIN_API_KEY"
Response
{
"success": false,
"message": "Permission denied: Main admin API key required."
}
cURL
curl -s "http://YOUR_PANEL_DOMAIN/api/v1/public/all_selectable_servers" \
-H "X-API-KEY: INVALID_KEY"
Response
{
"success": false,
"message": "Invalid or inactive API key"
}