Server Api Administrators
Manage MidnightStreamer Pro administrators using the Server API. Learn how to create, edit and list admin accounts programmatically.
🛠️ MidnightStreamer Pro API – Administrators Management
MidnightStreamer Pro allows panel administrators to be fully managed through the Server API. You can add new admins, update existing ones or fetch a complete list of administrator accounts.
✅ API Access Prerequisite
Before using any administrator-related API endpoint:
- Go to General Settings → API Settings
- Add your server IP under Allowed IPs
- Generate or copy your API Key
You can pass the API key via:
- POST parameter
api_key - Or the 4th segment in the URL
➕ Add New Administrator
Endpoint:
http://your-domain:8000/api/administrators/new
Required Parameters:
- username
- password
- group_id
Optional: reseller_id
Example PHP Code:
$panel_url = 'http://your-domain:8000/';
$api_key = 'your_api_key';
$username = 'test_username';
$password = 'test_password';
$email = '[email protected]';
$group_id = 1;
$reseller_id = 0;
$post_data = array(
'api_key' => $api_key,
'data' => array(
'username' => $username,
'password' => $password,
'email' => $email,
'group_id' => $group_id,
'reseller_id' => $reseller_id
)
);
$opts = array('http' => array(
'method' => 'POST',
'header' => 'Content-type: application/x-www-form-urlencoded',
'content' => http_build_query($post_data)
));
$context = stream_context_create($opts);
$api_result = json_decode(file_get_contents($panel_url . "api/administrators/new", false, $context), true);
✏️ Edit Administrator
Endpoint:
http://your-domain:8000/api/administrators/update
Required: id or username
$panel_url = 'http://your-domain:8000/';
$api_key = 'your_api_key';
$id = 1;
$email = '[email protected]';
$post_data = array(
'api_key' => $api_key,
'id' => $id,
'data' => array('email' => $email)
);
$opts = array('http' => array(
'method' => 'POST',
'header' => 'Content-type: application/x-www-form-urlencoded',
'content' => http_build_query($post_data)
));
$context = stream_context_create($opts);
$api_result = json_decode(file_get_contents($panel_url . "api/administrators/update", false, $context), true);
📋 List All Administrators
Endpoint:
http://your-domain:8000/api/administrators/list
No parameters required.
$panel_url = 'http://your-domain:8000/';
$api_key = 'your_api_key';
$post_data = array('api_key' => $api_key);
$opts = array('http' => array(
'method' => 'POST',
'header' => 'Content-type: application/x-www-form-urlencoded',
'content' => http_build_query($post_data)
));
$context = stream_context_create($opts);
$api_result = json_decode(file_get_contents($panel_url . "api/administrators/list", false, $context), true);
This guide provides the essential endpoints for managing administrator accounts via the MidnightStreamer Pro Server API.