Servers

Manage your servers.



Get

HTTP Request

GET https://serverwand.com/api/servers        

Parameters

Parameter Value Description
Required

Sample Code

<?php
//post data
$data = array(
);

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "https://serverwand.com/api/servers");
curl_setopt($ch, CURLOPT_HTTPHEADER,  array(
    'Authorization: Bearer , "<?=$api_key;?>"
));
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);     

// receive server response
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$result = curl_exec($ch);        
curl_close ($ch);

print_r($result);
?>
        


Sample Response

{
	"success": true,
	"items":
	    [{
	        "id": (string),
	        "name": (string),
	        "hostname": (string),
	        "dns": (string)
	    }]
}
        



Create

HTTP Request

POST https://serverwand.com/api/servers/create        

Parameters

Parameter Value Description
Required
provider string
dns string
name string
host string
user string
pass string
port string
region string
type string

Sample Code

<?php
//post data
$data = array(
	'provider' => 'custom',
	'dns' => 'custom',
	'name' => 'new server',
	'host' => 'domain.com',
	'user' => 'root',
	'pass' => 'password',
	'port' => '22',
	'region' => '', // for linode / digital ocean
	'type' => '', // for linode / digital ocean
);

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "https://serverwand.com/api/servers/create");
curl_setopt($ch, CURLOPT_HTTPHEADER,  array(
    'Authorization: Bearer , "<?=$api_key;?>"
));
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);     

// receive server response
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$result = curl_exec($ch);        
curl_close ($ch);

print_r($result);
?>
        


Sample Response

{
	"success": true,
	"items":
	    [{
	        "id": (string)
	    }]
}
        



Install

HTTP Request

GET https://serverwand.com/api/servers/$server_id/install        

Parameters

Parameter Value Description
Required

Sample Code

<?php
//post data
$data = array(
);

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "https://serverwand.com/api/servers/$server_id/install");
curl_setopt($ch, CURLOPT_HTTPHEADER,  array(
    'Authorization: Bearer , "<?=$api_key;?>"
));
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);     

// receive server response
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$result = curl_exec($ch);        
curl_close ($ch);

print_r($result);
?>
        


Sample Response (server-side events)

id: 1
data: {
data: "message": "done",
data: "id": 1
data: }
        



Summary

HTTP Request

POST https://serverwand.com/api/servers/{$server_id}/summary        

Parameters

Parameter Value Description
Required

Sample Code

<?php
//post data
$data = array(
);

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "https://serverwand.com/api/servers/{$server_id}/summary");
curl_setopt($ch, CURLOPT_HTTPHEADER,  array(
    'Authorization: Bearer , "<?=$api_key;?>"
));
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);     

// receive server response
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$result = curl_exec($ch);        
curl_close ($ch);

print_r($result);
?>
        


Sample Response

{
	"success": true,
	"item": [{
        "name": (string),
        "dns": (string)
        "hostname": (string),
        "ip": (string),
        "ipv6": (string),
        "location": (string),
        "user": (string),
        "port": (string),
        "webserver": (string),
        "disk_space": (string),
        "disk_free": (string),
        "disk_total": (string),
        "mem_total": (string),
        "mem_free": (string),
        "kernel": (string),
        "cpu": (string),
        "cores": (string),
        "uptime": (string),
        "php": (string),
        "apache": (string),
        "mariadb": (string),
        "updates": (string),
        "security_updates": (string),
    }]
}
        



Update

HTTP Request

POST https://serverwand.com/api/servers/$server_id/update        

Parameters

Parameter Value Description
Required
name string
dns string

Sample Code

<?php
//post data
$data = array(
);

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "https://serverwand.com/api/servers/$server_id/update");
curl_setopt($ch, CURLOPT_HTTPHEADER,  array(
    'Authorization: Bearer , "<?=$api_key;?>"
));
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);     

// receive server response
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$result = curl_exec($ch);        
curl_close ($ch);

print_r($result);
?>
        


Sample Response

{
	"success": true
}
        



Hostname

HTTP Request

POST https://serverwand.com/api/servers/$server_id/hostname        

Parameters

Parameter Value Description
Required
hostname string

Sample Code

<?php
//post data
$data = array(
	'hostname' => 'mydomain.com'
);

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "https://serverwand.com/api/servers/$server_id/hostname");
curl_setopt($ch, CURLOPT_HTTPHEADER,  array(
    'Authorization: Bearer , "<?=$api_key;?>"
));
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);     

// receive server response
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$result = curl_exec($ch);        
curl_close ($ch);

print_r($result);
?>
        


Sample Response

{
	"success": true
}
        



Reset key

HTTP Request

POST https://serverwand.com/api/servers/$server_id/hostname        

Parameters

Parameter Value Description
Required
user string
pass string

Sample Code

<?php
//post data
$data = array(
	'user' => 'root',
	'pass' => 'password'
);

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "https://serverwand.com/api/servers/$server_id/hostname");
curl_setopt($ch, CURLOPT_HTTPHEADER,  array(
    'Authorization: Bearer , "<?=$api_key;?>"
));
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);     

// receive server response
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$result = curl_exec($ch);        
curl_close ($ch);

print_r($result);
?>
        


Sample Response

{
	"success": true
}
        



Cron jobs

HTTP Request

GET https://serverwand.com/api/servers/$server_id/cronjobs        

Parameters

Parameter Value Description
Required

Sample Code

<?php
//post data
$data = array(
);

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "https://serverwand.com/api/servers/$server_id/cronjobs");
curl_setopt($ch, CURLOPT_HTTPHEADER,  array(
    'Authorization: Bearer , "<?=$api_key;?>"
));
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);     

// receive server response
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$result = curl_exec($ch);        
curl_close ($ch);

print_r($result);
?>
        


Sample Response

{
	"success": true,
	"name": "my server",
	"dns": "custom",
	"host": "domain.com",
	"ip": "0.0.0.0",
	"user": "serverwand",
	"port": "22",
	"cronjobs": {
		"line": "1",
		"command": "whoami",
		"user": "root",
		"minute": "0",
		"hour": "*",
		"dom": "*",
		"mon": "*",
		"dow": "*"
	}
}
        



Save Cron Job

HTTP Request

POST https://serverwand.com/api/servers/$server_id/savecronjob        

Parameters

Parameter Value Description
Required
minute string
hour string
dom string
mon string
dow string
user string
command string

Sample Code

<?php
//post data
$data = array(
	'minute' => '0',
	'hour' => '*',
	'dom' => '*',
	'mon' => '*',
	'dow' => '*',
	'user' => 'root',
	'command' => 'whoami'
);

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "https://serverwand.com/api/servers/$server_id/savecronjob");
curl_setopt($ch, CURLOPT_HTTPHEADER,  array(
    'Authorization: Bearer , "<?=$api_key;?>"
));
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);     

// receive server response
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$result = curl_exec($ch);        
curl_close ($ch);

print_r($result);
?>
        


Sample Response

{
	"success": true
}
        



Delete Cron Job

HTTP Request

POST https://serverwand.com/api/servers/$server_id/deletecronjob        

Parameters

Parameter Value Description
Required
line string

Sample Code

<?php
//post data
$data = array(
	'line' => '1'
);

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "https://serverwand.com/api/servers/$server_id/deletecronjob");
curl_setopt($ch, CURLOPT_HTTPHEADER,  array(
    'Authorization: Bearer , "<?=$api_key;?>"
));
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);     

// receive server response
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$result = curl_exec($ch);        
curl_close ($ch);

print_r($result);
?>
        


Sample Response

{
	"success": true
}
        



System users

HTTP Request

GET https://serverwand.com/api/servers/$server_id/systemusers        

Parameters

Parameter Value Description
Required

Sample Code

<?php
//post data
$data = array(
);

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "https://serverwand.com/api/servers/$server_id/systemusers");
curl_setopt($ch, CURLOPT_HTTPHEADER,  array(
    'Authorization: Bearer , "<?=$api_key;?>"
));
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);     

// receive server response
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$result = curl_exec($ch);        
curl_close ($ch);

print_r($result);
?>
        


Sample Response

{
	"success": true,
	"name": "my server",
	"dns": "custom",
	"host": "domain.com",
	"ip": "0.0.0.0",
	"user": "serverwand",
	"port": "22",
	"users": {
		"name": "example-user"
	}
}
        



Save System User

HTTP Request

POST https://serverwand.com/api/servers/$server_id/savesystemuser        

Parameters

Parameter Value Description
Required
user string
pass string

Sample Code

<?php
//post data
$data = array(
	'user' => 'example-user',
	'pass' => 'password'
);

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "https://serverwand.com/api/servers/$server_id/savesystemuser");
curl_setopt($ch, CURLOPT_HTTPHEADER,  array(
    'Authorization: Bearer , "<?=$api_key;?>"
));
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);     

// receive server response
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$result = curl_exec($ch);        
curl_close ($ch);

print_r($result);
?>
        


Sample Response

{
	"success": true
}
        



Delete System User

HTTP Request

POST https://serverwand.com/api/servers/$server_id/deletesystemuser        

Parameters

Parameter Value Description
Required
user string

Sample Code

<?php
//post data
$data = array(
	'user' => 'example-user'
);

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "https://serverwand.com/api/servers/$server_id/deletesystemuser");
curl_setopt($ch, CURLOPT_HTTPHEADER,  array(
    'Authorization: Bearer , "<?=$api_key;?>"
));
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);     

// receive server response
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$result = curl_exec($ch);        
curl_close ($ch);

print_r($result);
?>
        


Sample Response

{
	"success": true
}
        



Firewall

HTTP Request

GET https://serverwand.com/api/servers/$server_id/firewall        

Parameters

Parameter Value Description
Required

Sample Code

<?php
//post data
$data = array(
);

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "https://serverwand.com/api/servers/$server_id/firewall");
curl_setopt($ch, CURLOPT_HTTPHEADER,  array(
    'Authorization: Bearer , "<?=$api_key;?>"
));
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);     

// receive server response
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$result = curl_exec($ch);        
curl_close ($ch);

print_r($result);
?>
        


Sample Response

{
	"success": true,
	"active": true,
	"rules": {
		"id": "1",
		"port": "25",
		"protocol": "tcp",
		"v6": "",
		"action": "allow",
		"from": "any",
	}
}
        



Toggle Firewall

HTTP Request

POST https://serverwand.com/api/servers/$server_id/savesystemuser        

Parameters

Parameter Value Description
Required
status string

Sample Code

<?php
//post data
$data = array(
	'status' => 1
);

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "https://serverwand.com/api/servers/$server_id/savesystemuser");
curl_setopt($ch, CURLOPT_HTTPHEADER,  array(
    'Authorization: Bearer , "<?=$api_key;?>"
));
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);     

// receive server response
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$result = curl_exec($ch);        
curl_close ($ch);

print_r($result);
?>
        


Sample Response

{
	"success": true
}
        



Save Firewall Rule

HTTP Request

POST https://serverwand.com/api/servers/$server_id/savefirewallrule        

Parameters

Parameter Value Description
Required
action string
from string
port string
protocol string

Sample Code

<?php
//post data
$data = array(
	'action' => 'allow',
	'from' => 'any',
	'port' => '25',
	'protocol' => 'tcp'
);

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "https://serverwand.com/api/servers/$server_id/savefirewallrule");
curl_setopt($ch, CURLOPT_HTTPHEADER,  array(
    'Authorization: Bearer , "<?=$api_key;?>"
));
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);     

// receive server response
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$result = curl_exec($ch);        
curl_close ($ch);

print_r($result);
?>
        


Sample Response

{
	"success": true
}
        



Delete Firewall Rule

HTTP Request

POST https://serverwand.com/api/servers/$server_id/deletefirewallrule        

Parameters

Parameter Value Description
Required
id string

Sample Code

<?php
//post data
$data = array(
	'id' => '1'
);

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "https://serverwand.com/api/servers/$server_id/deletefirewallrule");
curl_setopt($ch, CURLOPT_HTTPHEADER,  array(
    'Authorization: Bearer , "<?=$api_key;?>"
));
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);     

// receive server response
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$result = curl_exec($ch);        
curl_close ($ch);

print_r($result);
?>
        


Sample Response

{
	"success": true
}
        



Fetchlog

HTTP Request

POST https://serverwand.com/api/servers/$server_id/fetchlog        

Parameters

Parameter Value Description
Required
auth string

Sample Code

<?php
//post data
$data = array(
	'log' => 'auth'
);

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "https://serverwand.com/api/servers/$server_id/fetchlog");
curl_setopt($ch, CURLOPT_HTTPHEADER,  array(
    'Authorization: Bearer , "<?=$api_key;?>"
));
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);     

// receive server response
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$result = curl_exec($ch);        
curl_close ($ch);

print_r($result);
?>
        


Sample Response

{
	"success": true
}
        



Messages

HTTP Request

GET https://serverwand.com/api/servers/$server_id/messages        

Parameters

Parameter Value Description
Required

Sample Code

<?php
//post data
$data = array(
);

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "https://serverwand.com/api/servers/$server_id/messages");
curl_setopt($ch, CURLOPT_HTTPHEADER,  array(
    'Authorization: Bearer , "<?=$api_key;?>"
));
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);     

// receive server response
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$result = curl_exec($ch);        
curl_close ($ch);

print_r($result);
?>
        


Sample Response

{
	"success": true,
	"messages": {
		"id": "1",
		"size": "100",
		"date": "2019-01-01 23:00:00",
		"sender": "example@example.org",
		"recipient": "example@example.org"
	}
}
        



Delete Messages

HTTP Request

POST https://serverwand.com/api/servers/$server_id/deletemessages        

Parameters

Parameter Value Description
Required
ids string

Sample Code

<?php
//post data
$data = array(
	'ids' => array(
		'1'
	)
);

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "https://serverwand.com/api/servers/$server_id/deletemessages");
curl_setopt($ch, CURLOPT_HTTPHEADER,  array(
    'Authorization: Bearer , "<?=$api_key;?>"
));
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);     

// receive server response
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$result = curl_exec($ch);        
curl_close ($ch);

print_r($result);
?>
        


Sample Response

{
	"success": true
}
        



Backups

HTTP Request

GET https://serverwand.com/api/servers/$server_id/backups        

Parameters

Parameter Value Description
Required

Sample Code

<?php
//post data
$data = array(
);

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "https://serverwand.com/api/servers/$server_id/backups");
curl_setopt($ch, CURLOPT_HTTPHEADER,  array(
    'Authorization: Bearer , "<?=$api_key;?>"
));
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);     

// receive server response
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$result = curl_exec($ch);        
curl_close ($ch);

print_r($result);
?>
        


Sample Response

{
	"success": true,
	"items": {
		"name": "1.zip",
		"size": "100"
	}
}
        



Delete Backup

HTTP Request

POST https://serverwand.com/api/servers/$server_id/deletebackup        

Parameters

Parameter Value Description
Required
ids string

Sample Code

<?php
//post data
$data = array(
	'ids' => array(
		'1.zip'
	)
);

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "https://serverwand.com/api/servers/$server_id/deletebackup");
curl_setopt($ch, CURLOPT_HTTPHEADER,  array(
    'Authorization: Bearer , "<?=$api_key;?>"
));
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);     

// receive server response
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$result = curl_exec($ch);        
curl_close ($ch);

print_r($result);
?>
        


Sample Response

{
	"success": true
}
        



Delete

HTTP Request

GET https://serverwand.com/api/servers/{$server_id}/delete        

Parameters

Parameter Value Description
Required

Sample Code

<?php
//post data
$data = array(
);

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "https://serverwand.com/api/servers/{$server_id}/delete");
curl_setopt($ch, CURLOPT_HTTPHEADER,  array(
    'Authorization: Bearer , "<?=$api_key;?>"
));
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);     

// receive server response
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$result = curl_exec($ch);        
curl_close ($ch);

print_r($result);
?>
        


Sample Response

{
	"success": true
}