NAV
XSServer GmbH
bash php python

Introduction

Our HTTP REST API allows you to manage vital details of your account and services in client portal. JSON is used for all API returns

Use left menu to browse trough available methods, use right menu to check required parameters, data to post and code samples in various languages.

Swagger Doc: You can download or display the JSON to generate documentation in Swagger.

Authentication

Basic Authentication

# pass the correct header with each request (-u option)
curl 'https://cp.xsserver.gmbh/api/details' \
    -u "username:password"
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://cp.xsserver.gmbh/api/',
    'auth' => ['username', 'password']
]);

$resp = $client->get('details');
# python requests module handles basic authentication if provided with auth parameter
payload = username
req = requests.get('https://cp.xsserver.gmbh/api/details', auth=('username', 'password'))
print(req.json())

Make sure to replace username and password with your client area details.

This authentication method requires that you send your client area username (email address) and password with each request.

API calls that require authentication expect a header in the form of Authorization: Basic <credentials>, where credentials is the Base64 encoding of username and password joined by a single colon :.

For example:
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==

You can find more info on this authentication method here: Basic HTTP Authentication

Clientarea

Login

Generate new authorization token

POST_DATA="{
    \"username\": \"user@example.com\",
    \"password\": \"secret\"
}"

curl -X POST "https://cp.xsserver.gmbh/api/login" \
   -H "Content-Type: application/json" \
   -d "${POST_DATA}"
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://cp.xsserver.gmbh/api/',
]);

$options = [
    'json' => [
        "username" => "user@example.com",
        "password" => "secret"
    ]
]
$resp = $client->post('login', $options);
echo $resp->getBody();
payload = {
    'username': "user@example.com",
    'password': "secret"
}


req = requests.post('https://cp.xsserver.gmbh/api/login', json=payload)
print(req.json())
Example Response:
{
    "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJodHRw(...)5lZ9T79ft9uwOkqRRmIBbtR51_w",
    "refresh": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiIzMD(...)ChwIAb3zvxBu6kvULa2AwAt9U-I"
}

HTTP Request

POST /login

Query Parameters

Parameter Type Description
username string

Your acount email address

password string

Account password

Logout

Invalidate authorization token


curl -X POST "https://cp.xsserver.gmbh/api/logout" \
   -u user:pass 
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://cp.xsserver.gmbh/api/',
    'auth' => ['username', 'password']
]);


$resp = $client->post('logout');
echo $resp->getBody();

auth=('username', 'password')

req = requests.post('https://cp.xsserver.gmbh/api/logout', auth=auth)
print(req.json())
Example Response:
{
    "status": true
}

HTTP Request

POST /logout

Refresh Token

Generate new authorization token using refresh token

POST_DATA="{
    \"refresh_token\": \"refresh_tokenValue\"
}"

curl -X POST "https://cp.xsserver.gmbh/api/token" \
   -H "Content-Type: application/json" \
   -d "${POST_DATA}"
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://cp.xsserver.gmbh/api/',
]);

$options = [
    'json' => [
        "refresh_token" => "refresh_tokenValue"
    ]
]
$resp = $client->post('token', $options);
echo $resp->getBody();
payload = {
    'refresh_token': "refresh_tokenValue"
}


req = requests.post('https://cp.xsserver.gmbh/api/token', json=payload)
print(req.json())
Example Response:
{
    "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJodHR(...)vY2xlYiHGvauCWZD9B0VwXgHEzXDllqY",
    "refresh": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJBQ(...)Rmivc_u3YA_kgDqOPtUuGNXOzueXYtZw"
}

HTTP Request

POST /token

Query Parameters

Parameter Type Description
refresh_token string

Refresh token previously obtained from POST /login

Revoke Token

Invalidate authorization and refresh token. Pass refresh token or call this method with valid access token

POST_DATA="{
    \"refresh_token\": \"refresh_tokenValue\"
}"

curl -X POST "https://cp.xsserver.gmbh/api/revoke" \
   -H "Content-Type: application/json" \
   -d "${POST_DATA}"
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://cp.xsserver.gmbh/api/',
]);

$options = [
    'json' => [
        "refresh_token" => "refresh_tokenValue"
    ]
]
$resp = $client->post('revoke', $options);
echo $resp->getBody();
payload = {
    'refresh_token': "refresh_tokenValue"
}


req = requests.post('https://cp.xsserver.gmbh/api/revoke', json=payload)
print(req.json())
Example Response:
{
    "status": true
}

HTTP Request

POST /revoke

Query Parameters

Parameter Type Description
refresh_token string

User Details

Return registration details for my account


curl -X GET "https://cp.xsserver.gmbh/api/details" \
   -u user:pass 
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://cp.xsserver.gmbh/api/',
    'auth' => ['username', 'password']
]);


$resp = $client->get('details');
echo $resp->getBody();

auth=('username', 'password')

req = requests.get('https://cp.xsserver.gmbh/api/details', auth=auth)
print(req.json())
Example Response:
{
    "client": {
        "id": "26",
        "email": "api@example.com",
        "lastlogin": "2016-12-30 12:24:28",
        "ip": "172.100.2.1",
        "host": "hostname",
        "firstname": "Joe",
        "lastname": "Doe",
        "companyname": "",
        "address1": "Pretty View Lane",
        "address2": "3294",
        "city": "Santa Rosa",
        "state": "California",
        "postcode": "95401",
        "country": "US",
        "phonenumber": "+1.24123123"
    }
}

HTTP Request

GET /details

User Logs

Returns logs from history


curl -X GET "https://cp.xsserver.gmbh/api/logs" \
   -u user:pass 
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://cp.xsserver.gmbh/api/',
    'auth' => ['username', 'password']
]);


$resp = $client->get('logs');
echo $resp->getBody();

auth=('username', 'password')

req = requests.get('https://cp.xsserver.gmbh/api/logs', auth=auth)
print(req.json())

HTTP Request

GET /logs

Get Affiliate summary


curl -X GET "https://cp.xsserver.gmbh/api/affiliates/summary" \
   -u user:pass 
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://cp.xsserver.gmbh/api/',
    'auth' => ['username', 'password']
]);


$resp = $client->get('affiliates/summary');
echo $resp->getBody();

auth=('username', 'password')

req = requests.get('https://cp.xsserver.gmbh/api/affiliates/summary', auth=auth)
print(req.json())

HTTP Request

GET /affiliates/summary

Get Affiliate campaigns


curl -X GET "https://cp.xsserver.gmbh/api/affiliates/campaigns" \
   -u user:pass 
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://cp.xsserver.gmbh/api/',
    'auth' => ['username', 'password']
]);


$resp = $client->get('affiliates/campaigns');
echo $resp->getBody();

auth=('username', 'password')

req = requests.get('https://cp.xsserver.gmbh/api/affiliates/campaigns', auth=auth)
print(req.json())

HTTP Request

GET /affiliates/campaigns

Get Affiliate commissions


curl -X GET "https://cp.xsserver.gmbh/api/affiliates/commissions" \
   -u user:pass 
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://cp.xsserver.gmbh/api/',
    'auth' => ['username', 'password']
]);


$resp = $client->get('affiliates/commissions');
echo $resp->getBody();

auth=('username', 'password')

req = requests.get('https://cp.xsserver.gmbh/api/affiliates/commissions', auth=auth)
print(req.json())

HTTP Request

GET /affiliates/commissions

Get Affiliate payouts


curl -X GET "https://cp.xsserver.gmbh/api/affiliates/payouts" \
   -u user:pass 
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://cp.xsserver.gmbh/api/',
    'auth' => ['username', 'password']
]);


$resp = $client->get('affiliates/payouts');
echo $resp->getBody();

auth=('username', 'password')

req = requests.get('https://cp.xsserver.gmbh/api/affiliates/payouts', auth=auth)
print(req.json())

HTTP Request

GET /affiliates/payouts

Get Affiliate vouchers


curl -X GET "https://cp.xsserver.gmbh/api/affiliates/vouchers" \
   -u user:pass 
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://cp.xsserver.gmbh/api/',
    'auth' => ['username', 'password']
]);


$resp = $client->get('affiliates/vouchers');
echo $resp->getBody();

auth=('username', 'password')

req = requests.get('https://cp.xsserver.gmbh/api/affiliates/vouchers', auth=auth)
print(req.json())

HTTP Request

GET /affiliates/vouchers

Get Affiliate commission plans


curl -X GET "https://cp.xsserver.gmbh/api/affiliates/commissionplans" \
   -u user:pass 
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://cp.xsserver.gmbh/api/',
    'auth' => ['username', 'password']
]);


$resp = $client->get('affiliates/commissionplans');
echo $resp->getBody();

auth=('username', 'password')

req = requests.get('https://cp.xsserver.gmbh/api/affiliates/commissionplans', auth=auth)
print(req.json())

HTTP Request

GET /affiliates/commissionplans

Billing

Account balance

Get current account balance(unpaid invoices total), account credit


curl -X GET "https://cp.xsserver.gmbh/api/balance" \
   -u user:pass 
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://cp.xsserver.gmbh/api/',
    'auth' => ['username', 'password']
]);


$resp = $client->get('balance');
echo $resp->getBody();

auth=('username', 'password')

req = requests.get('https://cp.xsserver.gmbh/api/balance', auth=auth)
print(req.json())
Example Response:
{
    {
        "success": true,
        "details": {
            "currency": "USD",
            "acc_balance": "123456.55",
            "acc_credit": "0.00"
        }
    }
}

HTTP Request

GET /balance

List Invoices

List all invoices under my account


curl -X GET "https://cp.xsserver.gmbh/api/invoice" \
   -u user:pass 
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://cp.xsserver.gmbh/api/',
    'auth' => ['username', 'password']
]);


$resp = $client->get('invoice');
echo $resp->getBody();

auth=('username', 'password')

req = requests.get('https://cp.xsserver.gmbh/api/invoice', auth=auth)
print(req.json())
Example Response:
{
    "invoices": [
        {
            "id": "308976",
            "date": "2016-12-30",
            "dateorig": "2016-12-30",
            "duedate": "2017-01-06",
            "paybefore": "2017-01-06",
            "total": "19.65",
            "datepaid": "2016-12-30 12:40:47",
            "status": "Paid",
            "merge_id": null,
            "number": "2016\/12\/1",
            "currency": "USD"
        }
    ]
}

HTTP Request

GET /invoice

Invoice Details

Get invoice details


curl -X GET "https://cp.xsserver.gmbh/api/invoice/@id" \
   -u user:pass 
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://cp.xsserver.gmbh/api/',
    'auth' => ['username', 'password']
]);


$resp = $client->get('invoice/@id');
echo $resp->getBody();

auth=('username', 'password')

req = requests.get('https://cp.xsserver.gmbh/api/invoice/@id', auth=auth)
print(req.json())
Example Response:
{
    "invoice": {
        "id": "308976",
        "status": "Paid",
        "date": "2016-12-30",
        "duedate": "2017-01-06",
        "paybefore": "2017-01-06",
        "datepaid": "2016-12-30 12:40:47",
        "subtotal": 16.24,
        "credit": 0,
        "tax": 3.41,
        "taxrate": 21,
        "tax2": 0,
        "taxrate2": 0,
        "taxexempt": "0",
        "total": 19.65,
        "rate": 1,
        "rate2": 0,
        "rate3": 1,
        "notes": "",
        "items": [
            {
                "id": "12305",
                "invoice_id": "308976",
                "type": "Other",
                "item_id": "0",
                "description": "Example Service",
                "amount": "15.00",
                "taxed": "1",
                "qty": "1.00",
                "linetotal": "15.00"
            },
            {
                "id": "12309",
                "invoice_id": "308976",
                "type": "Other",
                "item_id": "-2",
                "description": "PayPal Payment Fee",
                "amount": "1.24",
                "taxed": "1",
                "qty": "1.00",
                "linetotal": "1.24"
            }
        ],
        "client": {
            "id": "26",
            "email": "api@example.com",
            "firstname": "Joe",
            "lastname": "Doe",
            "companyname": "",
            "address1": "Pretty View Lane",
            "address2": "3194",
            "city": "Santa Rosa",
            "state": "California",
            "postcode": "95401",
            "country": "US",
            "phonenumber": "+1.24123123"
        },
        "number": "2016\/12\/1",
        "currency": "USD"
    }
}

HTTP Request

GET /invoice/@id

Query Parameters

Parameter Type Description
id int

Apply credit

Apply account credit to invoice

POST_DATA="{
    \"amount\": \"amountValue\"
}"

curl -X POST "https://cp.xsserver.gmbh/api/invoice/@id/credit" \
   -u user:pass \
   -H "Content-Type: application/json" \
   -d "${POST_DATA}"
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://cp.xsserver.gmbh/api/',
    'auth' => ['username', 'password']
]);

$options = [
    'json' => [
        "amount" => "amountValue"
    ]
]
$resp = $client->post('invoice/@id/credit', $options);
echo $resp->getBody();
payload = {
    'amount': "amountValue"
}

auth=('username', 'password')

req = requests.post('https://cp.xsserver.gmbh/api/invoice/@id/credit', json=payload, auth=auth)
print(req.json())
Example Response:
{
    "success": true,
    "invoice_status": "Paid",
    "applied": 2.1
}

HTTP Request

POST /invoice/@id/credit

Query Parameters

Parameter Type Description
id int
amount number

Optional credit amount, when no value is specified maximum amount to fully pay the invoice will be used

Support

List Tickets

List support tickets under my account


curl -X GET "https://cp.xsserver.gmbh/api/tickets" \
   -u user:pass 
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://cp.xsserver.gmbh/api/',
    'auth' => ['username', 'password']
]);


$resp = $client->get('tickets');
echo $resp->getBody();

auth=('username', 'password')

req = requests.get('https://cp.xsserver.gmbh/api/tickets', auth=auth)
print(req.json())
Example Response:
{
    "tickets": [
        {
            "client_read": "1",
            "ticket_number": "736633",
            "date": "2016-12-30 12:48:13",
            "deptname": "Billing",
            "subject": "Lore Ipsum",
            "status": "Open"
        }
    ]
}

HTTP Request

GET /tickets

Ticket details

Get ticket details, including all replies


curl -X GET "https://cp.xsserver.gmbh/api/tickets/@number" \
   -u user:pass 
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://cp.xsserver.gmbh/api/',
    'auth' => ['username', 'password']
]);


$resp = $client->get('tickets/@number');
echo $resp->getBody();

auth=('username', 'password')

req = requests.get('https://cp.xsserver.gmbh/api/tickets/@number', auth=auth)
print(req.json())
Example Response:
{
    "ticket": {
        "date": "2016-12-30 12:48:13",
        "ticket_number": "736633",
        "name": "Joe Doe",
        "email": "api@example.com",
        "subject": "Lore Ipsum",
        "body": "Donec sollicitudin molestie malesuada. \r\nSed porttitor lectus nibh. Vivamus magna justo, \r\nlacinia eget consectetur sed, convallis at tellus.",
        "status": "Answered",
        "client_read": "1",
        "deptname": "Billing"
    },
    "replies": [
        {
            "id": "929",
            "name": "Suppport Staff",
            "date": "2016-12-30 12:51:04",
            "body": "Vestibulum ac diam sit amet quam \r\nvehicula elementum sed sit amet dui. \r\nPraesent sapien massa\r\n\r\n-- Maecenas efficitur elit est --",
            "status": "Sent",
            "type": "Admin"
        }
    ]
}

HTTP Request

GET /tickets/@number

Query Parameters

Parameter Type Description
number int

Ticket number

Create Ticket

Submit new ticket

POST_DATA="{
    \"dept_id\": 1,
    \"subject\": \"Subject\",
    \"body\": \"Message ...\"
}"

curl -X POST "https://cp.xsserver.gmbh/api/tickets" \
   -u user:pass \
   -H "Content-Type: application/json" \
   -d "${POST_DATA}"
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://cp.xsserver.gmbh/api/',
    'auth' => ['username', 'password']
]);

$options = [
    'json' => [
        "dept_id" => 1,
        "subject" => "Subject",
        "body" => "Message ..."
    ]
]
$resp = $client->post('tickets', $options);
echo $resp->getBody();
payload = {
    'dept_id': 1,
    'subject': "Subject",
    'body': "Message ..."
}

auth=('username', 'password')

req = requests.post('https://cp.xsserver.gmbh/api/tickets', json=payload, auth=auth)
print(req.json())
Example Response:
{
    "ticket": 865650
}

HTTP Request

POST /tickets

Query Parameters

Parameter Type Description
dept_id int

Department id

subject string

Ticket subject

body string

Ticket message

Create Reply

Reply to ticket

POST_DATA="{
    \"body\": \"reply text ..\"
}"

curl -X POST "https://cp.xsserver.gmbh/api/tickets/@number" \
   -u user:pass \
   -H "Content-Type: application/json" \
   -d "${POST_DATA}"
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://cp.xsserver.gmbh/api/',
    'auth' => ['username', 'password']
]);

$options = [
    'json' => [
        "body" => "reply text .."
    ]
]
$resp = $client->post('tickets/@number', $options);
echo $resp->getBody();
payload = {
    'body': "reply text .."
}

auth=('username', 'password')

req = requests.post('https://cp.xsserver.gmbh/api/tickets/@number', json=payload, auth=auth)
print(req.json())
Example Response:
{
    "info": [
        "reply_added"
    ]
}

HTTP Request

POST /tickets/@number

Query Parameters

Parameter Type Description
number int

Ticket number

body string

Reply message

Re-open ticket

Try to re-open closed ticket


curl -X PUT "https://cp.xsserver.gmbh/api/tickets/@number/open" \
   -u user:pass 
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://cp.xsserver.gmbh/api/',
    'auth' => ['username', 'password']
]);


$resp = $client->put('tickets/@number/open');
echo $resp->getBody();

auth=('username', 'password')

req = requests.put('https://cp.xsserver.gmbh/api/tickets/@number/open', auth=auth)
print(req.json())
Example Response:
{
    "status": true
}

HTTP Request

PUT /tickets/@number/open

Query Parameters

Parameter Type Description
number int

Ticket number

Close ticket

Send request to close a ticket


curl -X PUT "https://cp.xsserver.gmbh/api/tickets/@number/close" \
   -u user:pass 
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://cp.xsserver.gmbh/api/',
    'auth' => ['username', 'password']
]);


$resp = $client->put('tickets/@number/close');
echo $resp->getBody();

auth=('username', 'password')

req = requests.put('https://cp.xsserver.gmbh/api/tickets/@number/close', auth=auth)
print(req.json())
Example Response:
{
    "status": true
}

HTTP Request

PUT /tickets/@number/close

Query Parameters

Parameter Type Description
number int

Ticket number

List ticket departments

Get the list of ticket departments


curl -X GET "https://cp.xsserver.gmbh/api/ticket/departments" \
   -u user:pass 
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://cp.xsserver.gmbh/api/',
    'auth' => ['username', 'password']
]);


$resp = $client->get('ticket/departments');
echo $resp->getBody();

auth=('username', 'password')

req = requests.get('https://cp.xsserver.gmbh/api/ticket/departments', auth=auth)
print(req.json())

HTTP Request

GET /ticket/departments

Domains

List Domains

List domains under your account


curl -X GET "https://cp.xsserver.gmbh/api/domain" \
   -u user:pass 
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://cp.xsserver.gmbh/api/',
    'auth' => ['username', 'password']
]);


$resp = $client->get('domain');
echo $resp->getBody();

auth=('username', 'password')

req = requests.get('https://cp.xsserver.gmbh/api/domain', auth=auth)
print(req.json())
Example Response:
{
    "domains": [
        {
            "id": "47",
            "name": "testname.com",
            "expires": "2017-12-30",
            "recurring_amount": "15.00",
            "date_created": "2016-12-30",
            "status": "Active",
            "period": "1",
            "autorenew": "1",
            "daytoexpire": "365"
        }
    ]
}

HTTP Request

GET /domain

Domain details

Get domain details


curl -X GET "https://cp.xsserver.gmbh/api/domain/@id" \
   -u user:pass 
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://cp.xsserver.gmbh/api/',
    'auth' => ['username', 'password']
]);


$resp = $client->get('domain/@id');
echo $resp->getBody();

auth=('username', 'password')

req = requests.get('https://cp.xsserver.gmbh/api/domain/@id', auth=auth)
print(req.json())
Example Response:
{
    "details": {
        "id": "47",
        "name": "testname.com",
        "date_created": "2016-12-30",
        "firstpayment": "10.00",
        "recurring_amount": "15.00",
        "period": "1",
        "expires": "2017-12-30",
        "status": "Active",
        "next_due": "2017-12-30",
        "next_invoice": "2017-11-30",
        "idprotection": "0",
        "nameservers": [
            "ns1.example.com",
            "ns2.example.com",
            "ns3.example.com",
            "ns4.example.com"
        ],
        "autorenew": "1"
    }
}

HTTP Request

GET /domain/@id

Query Parameters

Parameter Type Description
id int

Domain id

Domain details by name

Get domain details by name


curl -X GET "https://cp.xsserver.gmbh/api/domain/name/@name" \
   -u user:pass 
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://cp.xsserver.gmbh/api/',
    'auth' => ['username', 'password']
]);


$resp = $client->get('domain/name/@name');
echo $resp->getBody();

auth=('username', 'password')

req = requests.get('https://cp.xsserver.gmbh/api/domain/name/@name', auth=auth)
print(req.json())
Example Response:
{
    "details": [
        {
            "id": "47",
            "name": "testname.com",
            "date_created": "2016-12-30",
            "firstpayment": "10.00",
            "recurring_amount": "15.00",
            "period": "1",
            "expires": "2017-12-30",
            "status": "Active",
            "next_due": "2017-12-30",
            "next_invoice": "2017-11-30",
            "idprotection": "0",
            "nameservers": [
                "ns1.example.com",
                "ns2.example.com",
                "ns3.example.com",
                "ns4.example.com"
            ],
            "autorenew": "1"
        },
        {
            "id": "48",
            "name": "testname.com",
            "date_created": "2016-05-30",
            "firstpayment": "10.00",
            "recurring_amount": "15.00",
            "period": "1",
            "expires": "2017-05-30",
            "status": "Expired",
            "next_due": "2017-05-30",
            "next_invoice": "2017-04-30",
            "idprotection": "0",
            "nameservers": [
                "ns1.example.com",
                "ns2.example.com",
                "ns3.example.com",
                "ns4.example.com"
            ],
            "autorenew": "1"
        },
    ]
}

HTTP Request

GET /domain/name/@name

Query Parameters

Parameter Type Description
name string

Domain name

Update domain nameservers

Change domain nameservers, if $nameservers is left empty, default namesevers will be used

POST_DATA="{
    \"nameservers\": \"nameserversValue\"
}"

curl -X PUT "https://cp.xsserver.gmbh/api/domain/@id/ns" \
   -u user:pass \
   -H "Content-Type: application/json" \
   -d "${POST_DATA}"
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://cp.xsserver.gmbh/api/',
    'auth' => ['username', 'password']
]);

$options = [
    'json' => [
        "nameservers" => "nameserversValue"
    ]
]
$resp = $client->put('domain/@id/ns', $options);
echo $resp->getBody();
payload = {
    'nameservers': "nameserversValue"
}

auth=('username', 'password')

req = requests.put('https://cp.xsserver.gmbh/api/domain/@id/ns', json=payload, auth=auth)
print(req.json())
Example Response:
{
    "info": [
        "success_changes_save"
    ]
}

HTTP Request

PUT /domain/@id/ns

Query Parameters

Parameter Type Description
id int

Domain id

nameservers array

List of nameservers to use

DNS RecordsDNS Records

List DNS records


curl -X GET "https://cp.xsserver.gmbh/api/domain/@id/dns" \
   -u user:pass 
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://cp.xsserver.gmbh/api/',
    'auth' => ['username', 'password']
]);


$resp = $client->get('domain/@id/dns');
echo $resp->getBody();

auth=('username', 'password')

req = requests.get('https://cp.xsserver.gmbh/api/domain/@id/dns', auth=auth)
print(req.json())
Example Response:
{
    "records": [
        {
            "id": 1,
            "name": "test",
            "ttl": 0,
            "priority": 0,
            "type": "A",
            "content": "100.100.10.1"
        }
    ]
}

HTTP Request

GET /domain/@id/dns

Query Parameters

Parameter Type Description
id int

Domain id

Create DNS Records

Add a new DNS record

POST_DATA="{
    \"name\": \"nameValue\",
    \"type\": \"typeValue\",
    \"priority\": \"priorityValue\",
    \"content\": \"contentValue\"
}"

curl -X POST "https://cp.xsserver.gmbh/api/domain/@id/dns" \
   -u user:pass \
   -H "Content-Type: application/json" \
   -d "${POST_DATA}"
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://cp.xsserver.gmbh/api/',
    'auth' => ['username', 'password']
]);

$options = [
    'json' => [
        "name" => "nameValue",
        "type" => "typeValue",
        "priority" => "priorityValue",
        "content" => "contentValue"
    ]
]
$resp = $client->post('domain/@id/dns', $options);
echo $resp->getBody();
payload = {
    'name': "nameValue",
    'type': "typeValue",
    'priority': "priorityValue",
    'content': "contentValue"
}

auth=('username', 'password')

req = requests.post('https://cp.xsserver.gmbh/api/domain/@id/dns', json=payload, auth=auth)
print(req.json())
Example Response:
{
    "info": [
        "DNS Management updated successfully"
    ]
}

HTTP Request

POST /domain/@id/dns

Query Parameters

Parameter Type Description
id int

Domain id

name string

Reord name

type string

Reord type

priority string

Reord priority

content string

Reord content eg. IP addres for A records

Update DNS Records

Change a DNS record

POST_DATA="{
    \"name\": \"nameValue\",
    \"type\": \"typeValue\",
    \"priority\": \"priorityValue\",
    \"content\": \"contentValue\"
}"

curl -X PUT "https://cp.xsserver.gmbh/api/domain/@id/dns/@index" \
   -u user:pass \
   -H "Content-Type: application/json" \
   -d "${POST_DATA}"
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://cp.xsserver.gmbh/api/',
    'auth' => ['username', 'password']
]);

$options = [
    'json' => [
        "name" => "nameValue",
        "type" => "typeValue",
        "priority" => "priorityValue",
        "content" => "contentValue"
    ]
]
$resp = $client->put('domain/@id/dns/@index', $options);
echo $resp->getBody();
payload = {
    'name': "nameValue",
    'type': "typeValue",
    'priority': "priorityValue",
    'content': "contentValue"
}

auth=('username', 'password')

req = requests.put('https://cp.xsserver.gmbh/api/domain/@id/dns/@index', json=payload, auth=auth)
print(req.json())
Example Response:
{
    "info": [
        "DNS Management updated successfully"
    ]
}

HTTP Request

PUT /domain/@id/dns/@index

Query Parameters

Parameter Type Description
id int

Domain id

record_id int

Recod index

name string

Record name

type string

Record type

priority string

Record priority

content string

Record content eg. IP address for A records

Remove DNS Records

Remove a DNS record


curl -X DELETE "https://cp.xsserver.gmbh/api/domain/@id/dns/@index" \
   -u user:pass 
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://cp.xsserver.gmbh/api/',
    'auth' => ['username', 'password']
]);


$resp = $client->delete('domain/@id/dns/@index');
echo $resp->getBody();

auth=('username', 'password')

req = requests.delete('https://cp.xsserver.gmbh/api/domain/@id/dns/@index', auth=auth)
print(req.json())
Example Response:
{
    "info": [
        "DNS Management updated successfully"
    ]
}

HTTP Request

DELETE /domain/@id/dns/@index

Query Parameters

Parameter Type Description
id int

Domain id

record_id int

Recod index

DNS

List DNS for service

Returns a list of DNS zones under the service


curl -X GET "https://cp.xsserver.gmbh/api/service/@service_id/dns" \
   -u user:pass 
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://cp.xsserver.gmbh/api/',
    'auth' => ['username', 'password']
]);


$resp = $client->get('service/@service_id/dns');
echo $resp->getBody();

auth=('username', 'password')

req = requests.get('https://cp.xsserver.gmbh/api/service/@service_id/dns', auth=auth)
print(req.json())
Example Response:
{
    "error": [
        "invalid method"
    ]
}

HTTP Request

GET /service/@service_id/dns

Query Parameters

Parameter Type Description
service_id int

Service ID

Services

IP Addresses

List Service IP Addresses


curl -X GET "https://cp.xsserver.gmbh/api/service/@id/ip" \
   -u user:pass 
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://cp.xsserver.gmbh/api/',
    'auth' => ['username', 'password']
]);


$resp = $client->get('service/@id/ip');
echo $resp->getBody();

auth=('username', 'password')

req = requests.get('https://cp.xsserver.gmbh/api/service/@id/ip', auth=auth)
print(req.json())

HTTP Request

GET /service/@id/ip

Query Parameters

Parameter Type Description
id int

Service ID

Reverse DNS

Get reverse DNS entries for service's IP addresses


curl -X GET "https://cp.xsserver.gmbh/api/service/@id/rdns" \
   -u user:pass 
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://cp.xsserver.gmbh/api/',
    'auth' => ['username', 'password']
]);


$resp = $client->get('service/@id/rdns');
echo $resp->getBody();

auth=('username', 'password')

req = requests.get('https://cp.xsserver.gmbh/api/service/@id/rdns', auth=auth)
print(req.json())

HTTP Request

GET /service/@id/rdns

Query Parameters

Parameter Type Description
id int

Service ID

Update rDNS

Update reverse DNS entries service's IP addresses

POST_DATA="{
    \"ipaddress\": \"ipaddressValue\"
}"

curl -X POST "https://cp.xsserver.gmbh/api/service/@id/rdns" \
   -u user:pass \
   -H "Content-Type: application/json" \
   -d "${POST_DATA}"
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://cp.xsserver.gmbh/api/',
    'auth' => ['username', 'password']
]);

$options = [
    'json' => [
        "ipaddress" => "ipaddressValue"
    ]
]
$resp = $client->post('service/@id/rdns', $options);
echo $resp->getBody();
payload = {
    'ipaddress': "ipaddressValue"
}

auth=('username', 'password')

req = requests.post('https://cp.xsserver.gmbh/api/service/@id/rdns', json=payload, auth=auth)
print(req.json())

HTTP Request

POST /service/@id/rdns

Query Parameters

Parameter Type Description
id int

Service ID

ipaddress array

Use Ip address as parameter key and hostname as value

PDU ports

List PDU ports assigned to service


curl -X GET "https://cp.xsserver.gmbh/api/service/@id/pdu" 
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://cp.xsserver.gmbh/api/',
]);


$resp = $client->get('service/@id/pdu');
echo $resp->getBody();


req = requests.get('https://cp.xsserver.gmbh/api/service/@id/pdu')
print(req.json())

HTTP Request

GET /service/@id/pdu

Query Parameters

Parameter Type Description
id int

Service id

List IPs

List virtual machine IPs


curl -X GET "https://cp.xsserver.gmbh/api/service/@id/vms/@vmid/ips" \
   -u user:pass 
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://cp.xsserver.gmbh/api/',
    'auth' => ['username', 'password']
]);


$resp = $client->get('service/@id/vms/@vmid/ips');
echo $resp->getBody();

auth=('username', 'password')

req = requests.get('https://cp.xsserver.gmbh/api/service/@id/vms/@vmid/ips', auth=auth)
print(req.json())

HTTP Request

GET /service/@id/vms/@vmid/ips

Query Parameters

Parameter Type Description
id int
vmid int
type

string ipv4 or ipv6

iface

int Interface number [optional]

bridge

string Bridge name [optional, ignored if interface provided]

List IPs

List virtual machine IPs


curl -X GET "https://cp.xsserver.gmbh/api/service/@id/vms/@vmid/ippool" \
   -u user:pass 
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://cp.xsserver.gmbh/api/',
    'auth' => ['username', 'password']
]);


$resp = $client->get('service/@id/vms/@vmid/ippool');
echo $resp->getBody();

auth=('username', 'password')

req = requests.get('https://cp.xsserver.gmbh/api/service/@id/vms/@vmid/ippool', auth=auth)
print(req.json())

HTTP Request

GET /service/@id/vms/@vmid/ippool

Query Parameters

Parameter Type Description
id int
vmid int
iface

int Interface number [optional]

bridge

string Bridge name [optional, ignored if interface provided]

Assign IPs

Assign new IP for network interface.

POST_DATA="{
    \"type\": \"typeValue\",
    \"iface\": \"ifaceValue\"
}"

curl -X POST "https://cp.xsserver.gmbh/api/service/@id/vms/@vmid/ippool/@pool" \
   -u user:pass \
   -H "Content-Type: application/json" \
   -d "${POST_DATA}"
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://cp.xsserver.gmbh/api/',
    'auth' => ['username', 'password']
]);

$options = [
    'json' => [
        "type" => "typeValue",
        "iface" => "ifaceValue"
    ]
]
$resp = $client->post('service/@id/vms/@vmid/ippool/@pool', $options);
echo $resp->getBody();
payload = {
    'type': "typeValue",
    'iface': "ifaceValue"
}

auth=('username', 'password')

req = requests.post('https://cp.xsserver.gmbh/api/service/@id/vms/@vmid/ippool/@pool', json=payload, auth=auth)
print(req.json())

HTTP Request

POST /service/@id/vms/@vmid/ippool/@pool

Query Parameters

Parameter Type Description
id int
vmid int
pool

string|int List ID to allocate new IP from

type

string ipv4 or ipv6

iface

int Interface number

List VM Network Interfaces

Get network Interfaces assigned to virtual servers


curl -X GET "https://cp.xsserver.gmbh/api/service/@id/vms/@vmid/interfaces" \
   -u user:pass 
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://cp.xsserver.gmbh/api/',
    'auth' => ['username', 'password']
]);


$resp = $client->get('service/@id/vms/@vmid/interfaces');
echo $resp->getBody();

auth=('username', 'password')

req = requests.get('https://cp.xsserver.gmbh/api/service/@id/vms/@vmid/interfaces', auth=auth)
print(req.json())

HTTP Request

GET /service/@id/vms/@vmid/interfaces

Query Parameters

Parameter Type Description
id int
vmid int

Get Network Interfaces

Get network Interface details


curl -X GET "https://cp.xsserver.gmbh/api/service/@id/vms/@vmid/interfaces/@iface" \
   -u user:pass 
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://cp.xsserver.gmbh/api/',
    'auth' => ['username', 'password']
]);


$resp = $client->get('service/@id/vms/@vmid/interfaces/@iface');
echo $resp->getBody();

auth=('username', 'password')

req = requests.get('https://cp.xsserver.gmbh/api/service/@id/vms/@vmid/interfaces/@iface', auth=auth)
print(req.json())

HTTP Request

GET /service/@id/vms/@vmid/interfaces/@iface

Query Parameters

Parameter Type Description
id int
vmid int
iface

string Interface name or id, ie '0' or 'net0'

Update Network Interfaces

Update network interface details

POST_DATA="{
    \"firewall\": \"firewallValue\",
    \"ipv4\": \"ipv4Value\",
    \"ipv6\": \"ipv6Value\"
}"

curl -X PUT "https://cp.xsserver.gmbh/api/service/@id/vms/@vmid/interfaces/@iface" \
   -u user:pass \
   -H "Content-Type: application/json" \
   -d "${POST_DATA}"
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://cp.xsserver.gmbh/api/',
    'auth' => ['username', 'password']
]);

$options = [
    'json' => [
        "firewall" => "firewallValue",
        "ipv4" => "ipv4Value",
        "ipv6" => "ipv6Value"
    ]
]
$resp = $client->put('service/@id/vms/@vmid/interfaces/@iface', $options);
echo $resp->getBody();
payload = {
    'firewall': "firewallValue",
    'ipv4': "ipv4Value",
    'ipv6': "ipv6Value"
}

auth=('username', 'password')

req = requests.put('https://cp.xsserver.gmbh/api/service/@id/vms/@vmid/interfaces/@iface', json=payload, auth=auth)
print(req.json())

HTTP Request

PUT /service/@id/vms/@vmid/interfaces/@iface

Query Parameters

Parameter Type Description
id int
vmid int
iface

int Interface number

firewall

int Enable or disable firewall (may require specific permissions)

ipv4

int[] List of IP v4 IDs

ipv6

int[] List of IP v6 IDs

Add Network Interface

Add new network interface to VM

POST_DATA="{
    \"firewall\": \"firewallValue\",
    \"ipv4\": \"ipv4Value\",
    \"ipv6\": \"ipv6Value\"
}"

curl -X POST "https://cp.xsserver.gmbh/api/service/@id/vms/@vmid/interfaces" \
   -u user:pass \
   -H "Content-Type: application/json" \
   -d "${POST_DATA}"
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://cp.xsserver.gmbh/api/',
    'auth' => ['username', 'password']
]);

$options = [
    'json' => [
        "firewall" => "firewallValue",
        "ipv4" => "ipv4Value",
        "ipv6" => "ipv6Value"
    ]
]
$resp = $client->post('service/@id/vms/@vmid/interfaces', $options);
echo $resp->getBody();
payload = {
    'firewall': "firewallValue",
    'ipv4': "ipv4Value",
    'ipv6': "ipv6Value"
}

auth=('username', 'password')

req = requests.post('https://cp.xsserver.gmbh/api/service/@id/vms/@vmid/interfaces', json=payload, auth=auth)
print(req.json())

HTTP Request

POST /service/@id/vms/@vmid/interfaces

Query Parameters

Parameter Type Description
id int
vmid int
firewall

int Enable or disable firewall (may require specific permissions)

ipv4

int[] List of IP v4 IDs

ipv6

int[] List of IP v6 IDs

Remove Network Interface

Remove network interface from VM


curl -X DELETE "https://cp.xsserver.gmbh/api/service/@id/vms/@vmid/interfaces/@iface" \
   -u user:pass 
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://cp.xsserver.gmbh/api/',
    'auth' => ['username', 'password']
]);


$resp = $client->delete('service/@id/vms/@vmid/interfaces/@iface');
echo $resp->getBody();

auth=('username', 'password')

req = requests.delete('https://cp.xsserver.gmbh/api/service/@id/vms/@vmid/interfaces/@iface', auth=auth)
print(req.json())

HTTP Request

DELETE /service/@id/vms/@vmid/interfaces/@iface

Query Parameters

Parameter Type Description
id int
vmid int
iface string
list

string|int List to allocate new IP from