Skip to main content

MidnightStreamer Docs & API

Server API Administrators

šŸ› ļø MidnightStreamer Pro API – Administrators Management

MidnightStreamer Pro allows full API-based management of panel administrators. You can programmatically create, update, or list admin accounts using secure HTTP POST requests.


āœ… API Access Prerequisite

Before using the Admin API:

  1. Go to General Settings → API Settings
  2. Whitelist your server IP address
  3. Generate or copy your API Key

You can pass the api_key via POST or by appending it as the 4th segment in the URL.


āž• Add New Administrator

Endpoint:

http://your-domain:8000/api/administrators/new

Required Parameters:

  • username
  • password
  • email
  • 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

Example PHP Code:

$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.

Example PHP Code:

$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);