Sites

Manage your sites.

Get

HTTP Request

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

Sample Code

<?php

$ch = curl_init();

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

// 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": "1",
            "domain": "example.com",
            "server": "1",
            "usage": "1024",
            "ip": "0.0.0.0",
            "mx": "mail.example.com"
        }
    ]
}



Create

HTTP Request

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

Parameters

Parameter Value Description
Required
domain string
server string
password string

Sample Code

<?php
$data = [
    "domain"=> "exmmple.com",
    "server"=> "1",
    "password"=> "password"
]
$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "https://serverwand.com/api/sites/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
}



Summary

HTTP Request

GET https://serverwand.com/api/sites/{$site_id}/summary

Sample Code

<?php

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "https://serverwand.com/api/sites/{$site_id}/summary");
curl_setopt($ch, CURLOPT_HTTPHEADER,  array(
    'Authorization: Bearer , "<?=$api_key;?>"
));

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

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

print_r($result);



Sample Response

{
    "success": true,
    "item": [
        {
            "domain": "example.com",
            "disk_usage": "1024",
            "dns": {
                "A": "0.0.0.0",
                "MX": "mail.example.com"
            },
            "server": {
                "name": "my-server",
                "ip": "0.0.0.0",
                "dns": "custom"
            }
        }
    ]
}



Settings

HTTP Request

GET https://serverwand.com/api/sites/{$site_id}/settings

Sample Code

<?php

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "https://serverwand.com/api/sites/{$site_id}/settings");
curl_setopt($ch, CURLOPT_HTTPHEADER,  array(
    'Authorization: Bearer , "<?=$api_key;?>"
));

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

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

print_r($result);



Sample Response

{
    "success": true,
    "item": [
        {
            "domain": "example.com",
            "ssl": true
        }
    ]
}



Set SSL

HTTP Request

POST https://serverwand.com/api/sites/{$site_id}/setssl

Parameters

Parameter Value Description
Required
status integer

Sample Code

<?php
$data = [
    "status"=> 1
]
$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "https://serverwand.com/api/sites/{$site_id}/setssl");
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
}



Database

HTTP Request

GET https://serverwand.com/api/sites/{$site_id}/database

Sample Code

<?php

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "https://serverwand.com/api/sites/{$site_id}/database");
curl_setopt($ch, CURLOPT_HTTPHEADER,  array(
    'Authorization: Bearer , "<?=$api_key;?>"
));

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

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

print_r($result);



Sample Response

{
    "success": true,
    "item": [
        {
            "domain": "example.com",
            "db_name": "example_com",
            "server": {
                "ip": "0.0.0.0"
            }
        }
    ]
}



Database Tables

HTTP Request

GET https://serverwand.com/api/sites/{$site_id}/database/tables

Sample Code

<?php

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "https://serverwand.com/api/sites/{$site_id}/database/tables");
curl_setopt($ch, CURLOPT_HTTPHEADER,  array(
    'Authorization: Bearer , "<?=$api_key;?>"
));

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

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

print_r($result);



Sample Response

{
    "success": true,
    "tables": [
        "table1",
        "table2"
    ]
}



Save Database

HTTP Request

POST https://serverwand.com/api/sites/{$site_id}/savedatabase

Parameters

Parameter Value Description
Required
password string

Sample Code

<?php
$data = [
    "password"=> "password"
]
$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "https://serverwand.com/api/sites/{$site_id}/savedatabase");
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
}



Apps

HTTP Request

GET https://serverwand.com/api/sites/{$site_id}/apps

Sample Code

<?php

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "https://serverwand.com/api/sites/{$site_id}/apps");
curl_setopt($ch, CURLOPT_HTTPHEADER,  array(
    'Authorization: Bearer , "<?=$api_key;?>"
));

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

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

print_r($result);



Sample Response

{
    "success": true,
    "item": [
        {
            "domain": "example.com",
            "app": {
                "name": "wordpress",
                "version": "1.0"
            }
        }
    ]
}



Pull

HTTP Request

POST https://serverwand.com/api/sites/{$site_id}/apps/pull

Parameters

Parameter Value Description
Required
files boolean
database boolean
tables array

Sample Code

<?php
$data = [
    "files"=> true,
    "database"=> true,
    "tables"=> [
        "users"
    ]
]
$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "https://serverwand.com/api/sites/{$site_id}/apps/pull");
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
}



Push

HTTP Request

POST https://serverwand.com/api/sites/{$site_id}/apps/push

Parameters

Parameter Value Description
Required
files boolean
database boolean
tables array

Sample Code

<?php
$data = [
    "files"=> true,
    "database"=> true,
    "tables"=> [
        "users"
    ]
]
$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "https://serverwand.com/api/sites/{$site_id}/apps/push");
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
}



Install

HTTP Request

GET https://serverwand.com/api/sites/{$site_id}/install/{$app}

Sample Code

<?php

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "https://serverwand.com/api/sites/{$site_id}/install/{$app}");
curl_setopt($ch, CURLOPT_HTTPHEADER,  array(
    'Authorization: Bearer , "<?=$api_key;?>"
));

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

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

print_r($result);



Sample Response

{
    "success": true
}



Aliases

HTTP Request

GET https://serverwand.com/api/sites/{$site_id}/aliases

Sample Code

<?php

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "https://serverwand.com/api/sites/{$site_id}/aliases");
curl_setopt($ch, CURLOPT_HTTPHEADER,  array(
    'Authorization: Bearer , "<?=$api_key;?>"
));

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

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

print_r($result);



Sample Response

{
    "success": true,
    "item": [
        {
            "domain": "example.com",
            "aliases": [
                {
                    "domain": "example.org",
                    "dns": {
                        "A": "0.0.0.0",
                        "MX": "mail.example.com"
                    }
                }
            ],
            "server": {
                "name": "my-server",
                "ip": "0.0.0.0",
                "dns": "custom"
            }
        }
    ]
}



Save Alias

HTTP Request

POST https://serverwand.com/api/sites/{$site_id}/savealias

Parameters

Parameter Value Description
Required
alias string

Sample Code

<?php
$data = [
    "alias"=> "example.org"
]
$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "https://serverwand.com/api/sites/{$site_id}/savealias");
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 Alias

HTTP Request

POST https://serverwand.com/api/sites/{$site_id}/deletealias

Parameters

Parameter Value Description
Required
alias string

Sample Code

<?php
$data = [
    "alias"=> "example.org"
]
$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "https://serverwand.com/api/sites/{$site_id}/deletealias");
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/sites/{$site_id}/backups

Sample Code

<?php

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "https://serverwand.com/api/sites/{$site_id}/backups");
curl_setopt($ch, CURLOPT_HTTPHEADER,  array(
    'Authorization: Bearer , "<?=$api_key;?>"
));

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

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

print_r($result);



Sample Response

{
    "success": true,
    "domain": "acme.com",
    "ip": "1.1.1.1",
    "items": [
        {
            "name": "acme.com.202106111706.tar.gz",
            "size": 1024,
            "date": "mar 24 17:04"
        }
    ]
}



Create Backup

HTTP Request

GET https://serverwand.com/api/sites/{$site_id}/backup/creates

Sample Code

<?php

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "https://serverwand.com/api/sites/{$site_id}/backup/creates");
curl_setopt($ch, CURLOPT_HTTPHEADER,  array(
    'Authorization: Bearer , "<?=$api_key;?>"
));

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

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

print_r($result);



Sample Response

{
    "success": true
}



Restore Backup

HTTP Request

POST https://serverwand.com/api/sites/{$site_id}

Parameters

Parameter Value Description
Required
restore string

Sample Code

<?php
$data = [
    "restore"=> "acme.com.202106111706.tar.gz"
]
$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "https://serverwand.com/api/sites/{$site_id}");
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 Backup

HTTP Request

POST https://serverwand.com/api/sites/{$site_id}/backups

Parameters

Parameter Value Description
Required
ids array

Sample Code

<?php
$data = [
    "ids"=> [
        "acme.com.202106111706.tar.gz"
    ]
]
$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "https://serverwand.com/api/sites/{$site_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
}



Email

HTTP Request

GET https://serverwand.com/api/sites/{$site_id}/email

Sample Code

<?php

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "https://serverwand.com/api/sites/{$site_id}/email");
curl_setopt($ch, CURLOPT_HTTPHEADER,  array(
    'Authorization: Bearer , "<?=$api_key;?>"
));

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

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

print_r($result);



Sample Response

{
    "success": true,
    "item": [
        {
            "domain": "example.com",
            "email": true,
            "emails": [
                {
                    "user": "info",
                    "destination": "forwarding@myemail.com"
                }
            ],
            "server": {
                "hostname": "example.com",
                "dns": "custom"
            }
        }
    ]
}



Set Email

HTTP Request

POST https://serverwand.com/api/sites/{$site_id}/setemail

Parameters

Parameter Value Description
Required
status integer

Sample Code

<?php
$data = [
    "status"=> 1
]
$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "https://serverwand.com/api/sites/{$site_id}/setemail");
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 Email

HTTP Request

POST https://serverwand.com/api/sites/{$site_id}/saveemail

Parameters

Parameter Value Description
Required
user string
password string
destination string

Sample Code

<?php
$data = [
    "user"=> "info",
    "password"=> "password",
    "destination"=> "forwarding@myemail.com"
]
$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "https://serverwand.com/api/sites/{$site_id}/saveemail");
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 Email

HTTP Request

POST https://serverwand.com/api/sites/{$site_id}/deleteemail

Parameters

Parameter Value Description
Required
user string

Sample Code

<?php
$data = [
    "user"=> "info"
]
$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "https://serverwand.com/api/sites/{$site_id}/deleteemail");
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
}



Download

HTTP Request

GET https://serverwand.com/api/sites/{$site_id}/download

Sample Code

<?php

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "https://serverwand.com/api/sites/{$site_id}/download");
curl_setopt($ch, CURLOPT_HTTPHEADER,  array(
    'Authorization: Bearer , "<?=$api_key;?>"
));

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

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

print_r($result);



Sample Response

{
    "success": true,
    "download_url": "http:\/\/0.0.0.0\/backups\/example.org.zip"
}



Delete

HTTP Request

GET https://serverwand.com/api/sites/{$site_id}/delete

Sample Code

<?php

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "https://serverwand.com/api/sites/{$site_id}/delete");
curl_setopt($ch, CURLOPT_HTTPHEADER,  array(
    'Authorization: Bearer , "<?=$api_key;?>"
));

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

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

print_r($result);



Sample Response

{
    "success": true
}