MENU navbar-image

Introduction

Tenantos API

This documentation aims to provide all the information you need to work with our API. Depending on the user's permissions, some endpoints may not be accessible or only certain parameters may be available.

The following additional resources are available:

If any parameters are unclear, you can perform the action via the Tenantos interface and view the request in the browser development tools. The Tenantos web interface uses the same API.

Legal:

Base URL

domain.com

Authenticating requests

Authenticate requests to this API's endpoints by sending an Authorization header with the value "Bearer {YOUR_AUTH_KEY}".

All authenticated endpoints are marked with a requires authentication badge in the documentation below.

You can retrieve your token by opening your account settings and clicking API Keys.

Brands

Feature: https://documentation.tenantos.com/Tenantos/branding/branding/

GET api/system/brands

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/system/brands',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/system/brands"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "domain.com/api/system/brands" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200):


{
    "result": [
        {
            "id": 1,
            "user_id": 1,
            "domain": "domain.com",
            "login_page_text": "Server Management",
            "top_navbar_header_title": "Tenantos",
            "page_title": "Control",
            "color_scheme": {
                "light": {
                    "primary": "#0C47A0",
                    "...": "..."
                },
                "dark": {
                    "primary": "#536DFE",
                    "...": "..."
                }
            },
            "languageOverrides": [],
            "languageData": [
                {
                    "en": {
                        "common_table_nodata_reload": "No data available. Reload?",
                        "...": "..."
                    }
                }
            ]
        }
    ],
    "message": "success"
}
 

Request   

GET api/system/brands

POST api/system/brands

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'domain.com/api/system/brands',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'domain' => 'app.domain.com',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/system/brands"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "domain": "app.domain.com"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
    "domain.com/api/system/brands" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"domain\": \"app.domain.com\"
}"

Request   

POST api/system/brands

Body Parameters

domain  string  

The domain for the new brand.

GET api/system/brands/{id}

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/system/brands/1',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/system/brands/1"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "domain.com/api/system/brands/1" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200):


{
    "result": {
        "id": 1,
        "user_id": 1,
        "domain": "domain.com",
        "login_page_text": "Server Management",
        "top_navbar_header_title": "Tenantos",
        "page_title": "Control",
        "color_scheme": {
            "light": {
                "primary": "#0C47A0",
                "...": "..."
            },
            "dark": {
                "primary": "#536DFE",
                "...": "..."
            }
        },
        "languageOverrides": [],
        "languageData": [
            {
                "en": {
                    "common_table_nodata_reload": "No data available. Reload?",
                    "...": "..."
                }
            }
        ]
    },
    "message": "success"
}
 

Request   

GET api/system/brands/{id}

URL Parameters

id  integer  

The ID of the brand.

PUT api/system/brands/{id}

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->put(
    'domain.com/api/system/brands/20',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'login_page_text' => 'Login To App',
            'page_title' => 'Tenantos',
            'top_navbar_header_title' => 'Tenantos',
            'color_scheme' => [
                'dark' => [
                    'primary' => '#536DFE',
                ],
                'light' => [
                    'primary' => '#0C47A0',
                ],
            ],
            'user_id' => 11,
            'languageOverrides' => [
                'en' => [
                    'common_table_nodata_reload' => 'No data available. Reload?',
                ],
            ],
            'navbar_text_instead_logo' => false,
            'navbar_logo_always_dark' => true,
            'loginpage_text_instead_logo' => true,
            'loginpage_logo_always_dark' => true,
            'loginpage_logo_above_form' => true,
            'loginpage_show_text_within_form' => true,
            'navbar_logo_max_height' => 17,
            'loginpage_logo_max_height' => 18,
            'theme_flat_buttons' => false,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/system/brands/20"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "login_page_text": "Login To App",
    "page_title": "Tenantos",
    "top_navbar_header_title": "Tenantos",
    "color_scheme": {
        "dark": {
            "primary": "#536DFE"
        },
        "light": {
            "primary": "#0C47A0"
        }
    },
    "user_id": 11,
    "languageOverrides": {
        "en": {
            "common_table_nodata_reload": "No data available. Reload?"
        }
    },
    "navbar_text_instead_logo": false,
    "navbar_logo_always_dark": true,
    "loginpage_text_instead_logo": true,
    "loginpage_logo_always_dark": true,
    "loginpage_logo_above_form": true,
    "loginpage_show_text_within_form": true,
    "navbar_logo_max_height": 17,
    "loginpage_logo_max_height": 18,
    "theme_flat_buttons": false
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request PUT \
    "domain.com/api/system/brands/20" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"login_page_text\": \"Login To App\",
    \"page_title\": \"Tenantos\",
    \"top_navbar_header_title\": \"Tenantos\",
    \"color_scheme\": {
        \"dark\": {
            \"primary\": \"#536DFE\"
        },
        \"light\": {
            \"primary\": \"#0C47A0\"
        }
    },
    \"user_id\": 11,
    \"languageOverrides\": {
        \"en\": {
            \"common_table_nodata_reload\": \"No data available. Reload?\"
        }
    },
    \"navbar_text_instead_logo\": false,
    \"navbar_logo_always_dark\": true,
    \"loginpage_text_instead_logo\": true,
    \"loginpage_logo_always_dark\": true,
    \"loginpage_logo_above_form\": true,
    \"loginpage_show_text_within_form\": true,
    \"navbar_logo_max_height\": 17,
    \"loginpage_logo_max_height\": 18,
    \"theme_flat_buttons\": false
}"

Request   

PUT api/system/brands/{id}

PATCH api/system/brands/{id}

URL Parameters

id  integer  

The ID of the brand.

Body Parameters

login_page_text  string optional  

Text which is shown above the login form.

page_title  string optional  

The page title.

top_navbar_header_title  string optional  

Text which is shown at the left sidebar.

color_scheme  object optional  

Custom color scheme for this brand.

color_scheme.dark  string[] optional  

color_scheme.light  string[] optional  

user_id  integer optional  

The owner of the brand. The owner is usually a reseller.

languageOverrides  object optional  

The owner of the brand. The owner is usually a reseller.

navbar_text_instead_logo  boolean optional  

navbar_logo_always_dark  boolean optional  

loginpage_text_instead_logo  boolean optional  

loginpage_logo_always_dark  boolean optional  

loginpage_logo_above_form  boolean optional  

loginpage_show_text_within_form  boolean optional  

navbar_logo_max_height  integer optional  

loginpage_logo_max_height  integer optional  

theme_flat_buttons  boolean optional  

DELETE api/system/brands/{id}

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->delete(
    'domain.com/api/system/brands/10',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/system/brands/10"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());
curl --request DELETE \
    "domain.com/api/system/brands/10" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Request   

DELETE api/system/brands/{id}

URL Parameters

id  integer  

The ID of the brand.

POST api/system/brands/{brand}/logos/store

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'domain.com/api/system/brands/quos/logos/store',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'multipart/form-data',
            'Accept' => 'application/json',
        ],
        'multipart' => [
            [
                'name' => 'lightlogo',
                'contents' => fopen('/tmp/phpSqQm2T', 'r')
            ],
            [
                'name' => 'darklogo',
                'contents' => fopen('/tmp/phprW7ZXT', 'r')
            ],
            [
                'name' => 'favicon',
                'contents' => fopen('/tmp/phpM1ku5S', 'r')
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/system/brands/quos/logos/store"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "multipart/form-data",
    "Accept": "application/json",
};

const body = new FormData();
body.append('lightlogo', document.querySelector('input[name="lightlogo"]').files[0]);
body.append('darklogo', document.querySelector('input[name="darklogo"]').files[0]);
body.append('favicon', document.querySelector('input[name="favicon"]').files[0]);

fetch(url, {
    method: "POST",
    headers,
    body,
}).then(response => response.json());
curl --request POST \
    "domain.com/api/system/brands/quos/logos/store" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: multipart/form-data" \
    --header "Accept: application/json" \
    --form "lightlogo=@/tmp/phpSqQm2T" \
    --form "darklogo=@/tmp/phprW7ZXT" \
    --form "favicon=@/tmp/phpM1ku5S" 

Request   

POST api/system/brands/{brand}/logos/store

URL Parameters

brand  string  

The brand.

Body Parameters

lightlogo  file optional  

Must be an image. Must not be greater than 512 kilobytes.

darklogo  file optional  

Must be an image. Must not be greater than 512 kilobytes.

favicon  file optional  

Must be an image. Must not be greater than 512 kilobytes.

DELETE api/system/brands/{brand}/logos/delete

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->delete(
    'domain.com/api/system/brands/non/logos/delete',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'lightlogo' => false,
            'darklogo' => true,
            'favicon' => true,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/system/brands/non/logos/delete"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "lightlogo": false,
    "darklogo": true,
    "favicon": true
};

fetch(url, {
    method: "DELETE",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request DELETE \
    "domain.com/api/system/brands/non/logos/delete" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"lightlogo\": false,
    \"darklogo\": true,
    \"favicon\": true
}"

Request   

DELETE api/system/brands/{brand}/logos/delete

URL Parameters

brand  string  

The brand.

Body Parameters

lightlogo  boolean optional  

darklogo  boolean optional  

favicon  boolean optional  

External Providers

Feature: https://documentation.tenantos.com/Tenantos/external-providers/about-external-providers/

GET api/externalProviders

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/externalProviders',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/externalProviders"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "domain.com/api/externalProviders" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200):


{
    "result": [
        {
            "id": 1,
            "provider": "proxmox",
            "name": "host-01",
            "apiUrl": "proxmox01.domain.com",
            "apiUser": "root",
            "apiPassword": "**************",
            "meta": null,
            "usage": {
                "serverIds": [
                    2,
                    3,
                    4,
                    5
                ]
            }
        }
    ],
    "message": "success"
}
 

Request   

GET api/externalProviders

POST api/externalProviders

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'domain.com/api/externalProviders',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'provider' => 'hetznercloud',
            'name' => 'Host-01',
            'apiUrl' => 'proxmox01.domain.com',
            'apiUser' => 'root',
            'apiPassword' => 'secret',
            'meta' => [],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/externalProviders"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "provider": "hetznercloud",
    "name": "Host-01",
    "apiUrl": "proxmox01.domain.com",
    "apiUser": "root",
    "apiPassword": "secret",
    "meta": []
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
    "domain.com/api/externalProviders" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"provider\": \"hetznercloud\",
    \"name\": \"Host-01\",
    \"apiUrl\": \"proxmox01.domain.com\",
    \"apiUser\": \"root\",
    \"apiPassword\": \"secret\",
    \"meta\": []
}"

Request   

POST api/externalProviders

Body Parameters

provider  string  

Must be one of proxmox, hetznercloud, vmwarevsphere, ovhdedicated, novoserve, or mylocdedicated.

name  string  

User definable name. Should be an easily identifiable name.

apiUrl  string optional  

apiUser  string optional  

apiPassword  string optional  

meta  string[] optional  

Depending on the provider, additional meta information must be set.

GET api/externalProviders/{id}

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/externalProviders/1',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/externalProviders/1"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "domain.com/api/externalProviders/1" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200):


{
    "result": {
        "id": 1,
        "provider": "proxmox",
        "name": "Host 01",
        "apiUrl": "proxmox01.domain.com",
        "apiUser": "root",
        "apiPassword": "**************",
        "meta": null,
        "providerDetails": {
            "nodes": [
                {
                    "value": "host01",
                    "name": "host01"
                },
                {
                    "value": "host02",
                    "name": "host02"
                }
            ],
            "storages": {
                "host01": [
                    {
                        "shared": 0,
                        "used": 1719563468800,
                        "content": [
                            "snippets",
                            "images",
                            "iso",
                            "rootdir",
                            "vztmpl",
                            "backup"
                        ],
                        "used_fraction": 0.881667875391091,
                        "type": "dir",
                        "total": 1950352867328,
                        "avail": 220859899904,
                        "enabled": 1,
                        "storage": "local",
                        "active": 1,
                        "backendId": "local"
                    }
                ],
                "host02": [
                    {
                        "avail": 87191961600,
                        "active": 1,
                        "total": 468513751040,
                        "enabled": 1,
                        "content": [
                            "iso",
                            "snippets",
                            "vztmpl",
                            "rootdir",
                            "images",
                            "backup"
                        ],
                        "storage": "local",
                        "used_fraction": 0.811824328459309,
                        "type": "dir",
                        "used": 380350861312,
                        "shared": 0,
                        "backendId": "local"
                    }
                ]
            },
            "networks": {
                "host02": [
                    {
                        "bridge_stp": "off",
                        "bridge_ports": "enp2s0",
                        "options": [
                            "hwaddress 44:aa:5b:2c:3c:dc",
                            "pointopoint 192.168.100.1",
                            "bridge_hello 2",
                            "bridge_maxage 12"
                        ],
                        "cidr": "10.10.11.10/24",
                        "address": "10.10.11.10",
                        "type": "bridge",
                        "autostart": 1,
                        "method6": "manual",
                        "iface": "vmbr0",
                        "bridge_fd": "1",
                        "families": [
                            "inet"
                        ],
                        "priority": 4,
                        "method": "static",
                        "netmask": "32",
                        "gateway": "10.10.11.1",
                        "active": 1,
                        "backendId": "vmbr0"
                    },
                    {
                        "method6": "manual",
                        "autostart": 1,
                        "type": "bridge",
                        "mtu": "1400",
                        "bridge_fd": 0,
                        "iface": "vmbr2",
                        "bridge_ports": "enp2s0.4000",
                        "bridge_stp": "off",
                        "address": "10.10.11.2",
                        "cidr": "10.10.11.2/24",
                        "method": "static",
                        "active": 1,
                        "netmask": "24",
                        "priority": 6,
                        "families": [
                            "inet"
                        ],
                        "backendId": "vmbr2"
                    }
                ],
                "host01": [
                    {
                        "netmask": "29",
                        "bridge_fd": "0",
                        "bridge_ports": "",
                        "address": "10.20.10.5",
                        "active": 1,
                        "autostart": 1,
                        "cidr": "10.20.10.5/24",
                        "method6": "manual",
                        "bridge_stp": "off",
                        "iface": "vmbr0",
                        "families": [
                            "inet"
                        ],
                        "type": "bridge",
                        "method": "static",
                        "priority": 12,
                        "backendId": "vmbr3"
                    }
                ]
            }
        },
        "usage": {
            "serverIds": [
                2,
                3,
                4,
                5
            ]
        }
    },
    "message": "success"
}
 

Request   

GET api/externalProviders/{id}

URL Parameters

id  integer  

The ID of the provider.

PUT api/externalProviders/{id}

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->put(
    'domain.com/api/externalProviders/15',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => 'Host-01',
            'apiUrl' => 'proxmox01.domain.com',
            'apiUser' => 'root',
            'apiPassword' => 'secret',
            'meta' => [],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/externalProviders/15"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Host-01",
    "apiUrl": "proxmox01.domain.com",
    "apiUser": "root",
    "apiPassword": "secret",
    "meta": []
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request PUT \
    "domain.com/api/externalProviders/15" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Host-01\",
    \"apiUrl\": \"proxmox01.domain.com\",
    \"apiUser\": \"root\",
    \"apiPassword\": \"secret\",
    \"meta\": []
}"

Request   

PUT api/externalProviders/{id}

PATCH api/externalProviders/{id}

URL Parameters

id  integer  

The ID of the provider.

Body Parameters

name  string optional  

User definable name. Should be an easily identifiable name.

apiUrl  string optional  

apiUser  string optional  

apiPassword  string optional  

meta  string[] optional  

Depending on the provider, additional meta information must be set.

DELETE api/externalProviders/{id}

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->delete(
    'domain.com/api/externalProviders/16',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/externalProviders/16"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());
curl --request DELETE \
    "domain.com/api/externalProviders/16" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Request   

DELETE api/externalProviders/{id}

URL Parameters

id  integer  

The ID of the provider.

IP Management

These API endpoints are, by default, only accessible as admin and are not intended for normal users.

POST api/ip/massaction

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'domain.com/api/ip/massaction',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'mode' => 'reserve',
            'ips' => [
                '10.10.10.28',
                '10.10.10.29',
            ],
            'type' => 'singleIp',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/ip/massaction"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "mode": "reserve",
    "ips": [
        "10.10.10.28",
        "10.10.10.29"
    ],
    "type": "singleIp"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
    "domain.com/api/ip/massaction" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"mode\": \"reserve\",
    \"ips\": [
        \"10.10.10.28\",
        \"10.10.10.29\"
    ],
    \"type\": \"singleIp\"
}"

Request   

POST api/ip/massaction

Body Parameters

mode  string  

Must be one of reserve or unreserve.

ips  string[]  

An array of IPs or subnets where the action should be performed:

type  string  

Must be one of singleIp or subnet. Use singleIp if the listed values at the "ips" param are IP addresses, or subnet if the values are subnets.

POST api/ip/reserve

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'domain.com/api/ip/reserve',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'adminIp' => '10.10.10.20',
            'type' => 'singleIp',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/ip/reserve"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "adminIp": "10.10.10.20",
    "type": "singleIp"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
    "domain.com/api/ip/reserve" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"adminIp\": \"10.10.10.20\",
    \"type\": \"singleIp\"
}"

Request   

POST api/ip/reserve

Body Parameters

adminIp  string  

Must be a valid IP address.

type  string  

Must be one of singleIp or subnet.

POST api/ip/unreserve

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'domain.com/api/ip/unreserve',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'adminIp' => '10.10.10.20',
            'type' => 'singleIp',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/ip/unreserve"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "adminIp": "10.10.10.20",
    "type": "singleIp"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
    "domain.com/api/ip/unreserve" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"adminIp\": \"10.10.10.20\",
    \"type\": \"singleIp\"
}"

Request   

POST api/ip/unreserve

Body Parameters

adminIp  string  

Must be a valid IP address.

type  string  

Must be one of singleIp or subnet.

POST api/ip/comment

requires authentication

If a user wants to create a comment for an IP, the PUT api/servers/{server_id}/ipassignments/{id} endpoint can be used.

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'domain.com/api/ip/comment',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'comment' => 'VPN IP',
            'adminIp' => '10.10.10.20',
            'type' => 'singleIp',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/ip/comment"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "comment": "VPN IP",
    "adminIp": "10.10.10.20",
    "type": "singleIp"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
    "domain.com/api/ip/comment" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"comment\": \"VPN IP\",
    \"adminIp\": \"10.10.10.20\",
    \"type\": \"singleIp\"
}"

Request   

POST api/ip/comment

Body Parameters

comment  string optional  

The comment to store. Leave blank to remove the existing comment.

adminIp  string  

Must be a valid IP address.

type  string  

Must be one of singleIp or subnet.

Inventory

Feature: https://documentation.tenantos.com/Tenantos/inventory-manager/inventory-manager/

GET api/inventorycomponents/customfields

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/inventorycomponents/customfields',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/inventorycomponents/customfields"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "domain.com/api/inventorycomponents/customfields" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200):

Show headers
cache-control: no-cache, private
content-type: application/json
referrer-policy: no-referrer
x-xss-protection: 1; mode=block
x-frame-options: DENY
x-content-type-options: nosniff
vary: Origin
 

{
    "result": [
        {
            "id": 1,
            "name": "Disk Type",
            "type": "dropdown",
            "availableValues": [
                {
                    "id": "1",
                    "value": "HDD"
                },
                {
                    "id": "2",
                    "value": "SSD"
                },
                {
                    "id": "3",
                    "value": "NVMe"
                }
            ],
            "notdeletable": 1,
            "created_at": "2021-12-25T23:14:22.000000Z",
            "updated_at": "2021-12-25T23:14:22.000000Z"
        },
        {
            "id": 2,
            "name": "Cores",
            "type": "input",
            "availableValues": [],
            "notdeletable": 1,
            "created_at": "2021-12-27T00:00:00.000000Z",
            "updated_at": "2021-12-27T22:41:28.000000Z"
        },
        {
            "id": 3,
            "name": "MHz Turbo",
            "type": "input",
            "availableValues": [],
            "notdeletable": 1,
            "created_at": "2021-12-27T00:00:00.000000Z",
            "updated_at": "2021-12-27T22:41:30.000000Z"
        },
        {
            "id": 4,
            "name": "MHz Normal",
            "type": "input",
            "availableValues": [],
            "notdeletable": 1,
            "created_at": "2021-12-27T00:00:00.000000Z",
            "updated_at": "2021-12-27T22:41:32.000000Z"
        },
        {
            "id": 5,
            "name": "Threads",
            "type": "input",
            "availableValues": [],
            "notdeletable": 1,
            "created_at": "2021-12-27T00:00:00.000000Z",
            "updated_at": "2021-12-27T22:41:33.000000Z"
        }
    ],
    "message": "success"
}
 

Request   

GET api/inventorycomponents/customfields

POST api/inventorycomponents/customfields

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'domain.com/api/inventorycomponents/customfields',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => 'Datacenter',
            'type' => 'dropdown',
            'availableValues' => [
                'Datacenter-1',
                'Datacenter-2',
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/inventorycomponents/customfields"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Datacenter",
    "type": "dropdown",
    "availableValues": [
        "Datacenter-1",
        "Datacenter-2"
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
    "domain.com/api/inventorycomponents/customfields" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Datacenter\",
    \"type\": \"dropdown\",
    \"availableValues\": [
        \"Datacenter-1\",
        \"Datacenter-2\"
    ]
}"

Request   

POST api/inventorycomponents/customfields

Body Parameters

name  string  

The name of the custom field.

type  string  

Must be one of input, checkbox, or dropdown.

availableValues  string[] optional  

If the type is dropdown, the submitted values are attached to the custom field.

GET api/inventorycomponents/customfields/{id}

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/inventorycomponents/customfields/1',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/inventorycomponents/customfields/1"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "domain.com/api/inventorycomponents/customfields/1" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200):

Show headers
cache-control: no-cache, private
content-type: application/json
referrer-policy: no-referrer
x-xss-protection: 1; mode=block
x-frame-options: DENY
x-content-type-options: nosniff
vary: Origin
 

{
    "result": {
        "id": 1,
        "name": "Disk Type",
        "type": "dropdown",
        "availableValues": [
            {
                "id": "1",
                "value": "HDD"
            },
            {
                "id": "2",
                "value": "SSD"
            },
            {
                "id": "3",
                "value": "NVMe"
            }
        ],
        "notdeletable": 1,
        "created_at": "2021-12-25T23:14:22.000000Z",
        "updated_at": "2021-12-25T23:14:22.000000Z"
    },
    "message": "success"
}
 

Request   

GET api/inventorycomponents/customfields/{id}

URL Parameters

id  integer  

The ID of the inventory component custom field.

PUT api/inventorycomponents/customfields/{id}

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->put(
    'domain.com/api/inventorycomponents/customfields/1',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => 'Datacenter',
            'type' => 'dropdown',
            'availableValues' => [
                'Datacenter-1',
                'Datacenter-2',
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/inventorycomponents/customfields/1"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Datacenter",
    "type": "dropdown",
    "availableValues": [
        "Datacenter-1",
        "Datacenter-2"
    ]
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request PUT \
    "domain.com/api/inventorycomponents/customfields/1" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Datacenter\",
    \"type\": \"dropdown\",
    \"availableValues\": [
        \"Datacenter-1\",
        \"Datacenter-2\"
    ]
}"

Request   

PUT api/inventorycomponents/customfields/{id}

PATCH api/inventorycomponents/customfields/{id}

URL Parameters

id  integer  

The ID of the inventory component custom field.

Body Parameters

name  string optional  

The name of the custom field.

type  string optional  

Must be one of input, checkbox, or dropdown.

availableValues  string[] optional  

If the type is dropdown, the submitted values are attached to the custom field.

DELETE api/inventorycomponents/customfields/{id}

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->delete(
    'domain.com/api/inventorycomponents/customfields/1',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/inventorycomponents/customfields/1"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());
curl --request DELETE \
    "domain.com/api/inventorycomponents/customfields/1" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Request   

DELETE api/inventorycomponents/customfields/{id}

URL Parameters

id  integer  

The ID of the inventory component custom field.

GET api/inventorycomponents

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/inventorycomponents',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/inventorycomponents"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "domain.com/api/inventorycomponents" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200):

Show headers
cache-control: no-cache, private
content-type: application/json
referrer-policy: no-referrer
x-xss-protection: 1; mode=block
x-frame-options: DENY
x-content-type-options: nosniff
vary: Origin
 

{
    "result": [
        {
            "id": 1,
            "created_at": "2022-11-15T15:16:00.000000Z",
            "updated_at": "2022-11-15T15:16:00.000000Z",
            "componentname": "cpu",
            "description": "CPU Model",
            "notdeletable": 1,
            "groupname": "Hardware",
            "valueType": "MHz",
            "customfieldsRelations": [
                2,
                3,
                4,
                5
            ],
            "customfields": [
                {
                    "field_id": 2,
                    "name": "Cores",
                    "type": "input",
                    "values": []
                },
                {
                    "field_id": 3,
                    "name": "MHz Turbo",
                    "type": "input",
                    "values": []
                },
                {
                    "field_id": 4,
                    "name": "MHz Normal",
                    "type": "input",
                    "values": []
                },
                {
                    "field_id": 5,
                    "name": "Threads",
                    "type": "input",
                    "values": []
                }
            ]
        },
        {
            "id": 2,
            "created_at": "2022-11-15T15:16:00.000000Z",
            "updated_at": "2022-11-15T15:16:00.000000Z",
            "componentname": "memory",
            "description": "RAM",
            "notdeletable": 1,
            "groupname": "Hardware",
            "valueType": "mb",
            "customfieldsRelations": [],
            "customfields": []
        },
        {
            "id": 3,
            "created_at": "2022-11-15T15:16:00.000000Z",
            "updated_at": "2022-11-15T15:16:00.000000Z",
            "componentname": "system",
            "description": "System",
            "notdeletable": 1,
            "groupname": "Hardware",
            "valueType": "text",
            "customfieldsRelations": [],
            "customfields": []
        },
        {
            "id": 4,
            "created_at": "2022-11-15T15:16:00.000000Z",
            "updated_at": "2022-11-15T15:16:00.000000Z",
            "componentname": "bios",
            "description": "BIOS",
            "notdeletable": 1,
            "groupname": "Hardware",
            "valueType": "text",
            "customfieldsRelations": [],
            "customfields": []
        },
        {
            "id": 5,
            "created_at": "2022-11-15T15:16:00.000000Z",
            "updated_at": "2022-11-15T15:16:00.000000Z",
            "componentname": "storage_controller",
            "description": "Storage Controller",
            "notdeletable": 1,
            "groupname": "Hardware",
            "valueType": "text",
            "customfieldsRelations": [],
            "customfields": []
        },
        {
            "id": 6,
            "created_at": "2022-11-15T15:16:00.000000Z",
            "updated_at": "2022-11-15T15:16:00.000000Z",
            "componentname": "mainboard",
            "description": "Mainboard Model",
            "notdeletable": 1,
            "groupname": "Hardware",
            "valueType": "text",
            "customfieldsRelations": [],
            "customfields": []
        },
        {
            "id": 7,
            "created_at": "2022-11-15T15:16:00.000000Z",
            "updated_at": "2022-11-15T15:16:00.000000Z",
            "componentname": "disk",
            "description": "Disk",
            "notdeletable": 1,
            "groupname": "Hardware",
            "valueType": "mb",
            "customfieldsRelations": [
                1
            ],
            "customfields": [
                {
                    "field_id": 1,
                    "name": "Disk Type",
                    "type": "dropdown",
                    "values": [
                        {
                            "id": "1",
                            "value": "HDD"
                        },
                        {
                            "id": "2",
                            "value": "SSD"
                        },
                        {
                            "id": "3",
                            "value": "NVMe"
                        }
                    ]
                }
            ]
        },
        {
            "id": 8,
            "created_at": "2022-11-15T15:16:00.000000Z",
            "updated_at": "2022-11-15T15:16:00.000000Z",
            "componentname": "nic",
            "description": "NIC",
            "notdeletable": 1,
            "groupname": "Hardware",
            "valueType": "text",
            "customfieldsRelations": [],
            "customfields": []
        }
    ],
    "message": "success"
}
 

Request   

GET api/inventorycomponents

POST api/inventorycomponents

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'domain.com/api/inventorycomponents',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'groupname' => 'Software',
            'description' => 'Software licenses',
            'componentname' => 'Software name',
            'customfieldsRelations' => [
                1,
                3,
            ],
            'valueType' => 'text',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/inventorycomponents"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "groupname": "Software",
    "description": "Software licenses",
    "componentname": "Software name",
    "customfieldsRelations": [
        1,
        3
    ],
    "valueType": "text"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
    "domain.com/api/inventorycomponents" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"groupname\": \"Software\",
    \"description\": \"Software licenses\",
    \"componentname\": \"Software name\",
    \"customfieldsRelations\": [
        1,
        3
    ],
    \"valueType\": \"text\"
}"

Request   

POST api/inventorycomponents

Body Parameters

groupname  string  

The name of the group. For example, "Hardware". Any name can be entered.

description  string  

A short description.

componentname  string  

The name of the component.

customfieldsRelations  string[] optional  

Multiple custom fields can be attached to a component.

valueType  string  

The type of the value. Must be one of text, mb (megabyte) or MHz.

GET api/inventorycomponents/{id}

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/inventorycomponents/1',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/inventorycomponents/1"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "domain.com/api/inventorycomponents/1" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200):

Show headers
cache-control: no-cache, private
content-type: application/json
referrer-policy: no-referrer
x-xss-protection: 1; mode=block
x-frame-options: DENY
x-content-type-options: nosniff
vary: Origin
 

{
    "result": {
        "id": 1,
        "created_at": "2022-11-15T15:16:00.000000Z",
        "updated_at": "2022-11-15T15:16:00.000000Z",
        "componentname": "cpu",
        "description": "CPU Model",
        "notdeletable": 1,
        "groupname": "Hardware",
        "valueType": "MHz",
        "customfieldsRelations": [
            2,
            3,
            4,
            5
        ],
        "customfields": [
            {
                "field_id": 2,
                "name": "Cores",
                "type": "input",
                "values": []
            },
            {
                "field_id": 3,
                "name": "MHz Turbo",
                "type": "input",
                "values": []
            },
            {
                "field_id": 4,
                "name": "MHz Normal",
                "type": "input",
                "values": []
            },
            {
                "field_id": 5,
                "name": "Threads",
                "type": "input",
                "values": []
            }
        ]
    },
    "message": "success"
}
 

Request   

GET api/inventorycomponents/{id}

URL Parameters

id  integer  

The ID of the inventory component.

PUT api/inventorycomponents/{id}

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->put(
    'domain.com/api/inventorycomponents/6',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'groupname' => 'Software',
            'description' => 'Software licenses',
            'componentname' => 'Software name',
            'customfieldsRelations' => [
                1,
                3,
            ],
            'valueType' => 'text',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/inventorycomponents/6"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "groupname": "Software",
    "description": "Software licenses",
    "componentname": "Software name",
    "customfieldsRelations": [
        1,
        3
    ],
    "valueType": "text"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request PUT \
    "domain.com/api/inventorycomponents/6" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"groupname\": \"Software\",
    \"description\": \"Software licenses\",
    \"componentname\": \"Software name\",
    \"customfieldsRelations\": [
        1,
        3
    ],
    \"valueType\": \"text\"
}"

Request   

PUT api/inventorycomponents/{id}

PATCH api/inventorycomponents/{id}

URL Parameters

id  integer  

The ID of the inventory component.

Body Parameters

groupname  string optional  

The name of the group. For example, "Hardware". Any name can be entered.

description  string optional  

A short description.

componentname  string optional  

The name of the component.

customfieldsRelations  string[] optional  

Multiple custom fields can be attached to a component.

valueType  string optional  

The type of the value. Must be one of text, mb (megabyte) or MHz.

DELETE api/inventorycomponents/{id}

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->delete(
    'domain.com/api/inventorycomponents/5',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/inventorycomponents/5"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());
curl --request DELETE \
    "domain.com/api/inventorycomponents/5" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Request   

DELETE api/inventorycomponents/{id}

URL Parameters

id  integer  

The ID of the inventory component.

Network Devices

Feature: https://documentation.tenantos.com/Tenantos/network-devices/network-devices/

POST api/networkDevices/{networkDevice}/actions/testConnectivity

requires authentication

Tests if the connection between the Tenantos main server and the network device does work.

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'domain.com/api/networkDevices/19/actions/testConnectivity',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'useCache' => true,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/networkDevices/19/actions/testConnectivity"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "useCache": true
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
    "domain.com/api/networkDevices/19/actions/testConnectivity" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"useCache\": true
}"

Request   

POST api/networkDevices/{networkDevice}/actions/testConnectivity

URL Parameters

networkDevice  integer  

The ID of the network device.

Body Parameters

useCache  boolean optional  

The last status of network devices is cached for at least 15 minutes. Submit true to receive the cached status (for faster response).

GET api/networkDevices

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/networkDevices',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/networkDevices"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "domain.com/api/networkDevices" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200):


{
    "result": [
        {
            "id": 1,
            "name": "EX3200",
            "host": "192.168.188.1",
            "deviceType": "snmp_switch",
            "snmpCommunity": "secret",
            "snmpVersion": "2c",
            "agentId": 1,
            "features": [
                "bw_collection"
            ],
            "meta": {
                "flip_in_out": true
            },
            "username": "",
            "password": "",
            "port": null
        }
    ],
    "message": "success"
}
 

Request   

GET api/networkDevices

POST api/networkDevices

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'domain.com/api/networkDevices',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'deviceType' => 'snmp_switch',
            'name' => 'est',
            'host' => 'switch01.domain.com',
            'snmpCommunity' => 'perferendis',
            'snmpVersion' => '2c',
            'agentId' => 1,
            'features' => [
                'bw_collection',
            ],
            'meta' => [
                'flip_in_out' => 'true',
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/networkDevices"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "deviceType": "snmp_switch",
    "name": "est",
    "host": "switch01.domain.com",
    "snmpCommunity": "perferendis",
    "snmpVersion": "2c",
    "agentId": 1,
    "features": [
        "bw_collection"
    ],
    "meta": {
        "flip_in_out": "true"
    }
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
    "domain.com/api/networkDevices" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"deviceType\": \"snmp_switch\",
    \"name\": \"est\",
    \"host\": \"switch01.domain.com\",
    \"snmpCommunity\": \"perferendis\",
    \"snmpVersion\": \"2c\",
    \"agentId\": 1,
    \"features\": [
        \"bw_collection\"
    ],
    \"meta\": {
        \"flip_in_out\": \"true\"
    }
}"

Request   

POST api/networkDevices

Body Parameters

deviceType  string  

Must be one of snmp_switch, telejetDigiOne, apc, racktivityEnergySwitch, racktivityPowerManager, cyberpowerAts, dellrPdu, enlogicv1, intertechSw, intertechSm, or ipoman.

name  string  

host  string  

The hostname or IP of the device.

port  integer optional  

This field is required when deviceType is telejetDigiOne. Must be between 1 and 65535.

username  string optional  

This field is required when deviceType is telejetDigiOne.

password  string optional  

Optional field. Currently only available for telejet.

snmpCommunity  string optional  

This field is required when deviceType is snmp_switch, apc, racktivityEnergySwitch, racktivityPowerManager, cyberpowerAts, dellrPdu, enlogicv1, intertechSw, intertechSm, or ipoman.

snmpVersion  string optional  

This field is required when deviceType is snmp_switch. The SNMP version for PDUs is detected automatically.

agentId  integer  

The specificated agent will handle the connection.

features  string[] optional  

Some devices have additional features available.

meta  object optional  

Some devices support additional meta flags.

GET api/networkDevices/{id}

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/networkDevices/2',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/networkDevices/2"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "domain.com/api/networkDevices/2" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200):


{
    "result": {
        "id": 2,
        "name": "EdgeSwitch WZ",
        "host": "192.168.188.215",
        "deviceType": "snmp_switch",
        "snmpCommunity": "secret",
        "snmpVersion": "2c",
        "agentId": 1,
        "features": [
            "bw_collection"
        ],
        "meta": [],
        "username": "",
        "password": "",
        "port": null,
        "ports": [
            {
                "id": 1,
                "name": "GigabitEthernet1"
            },
            {
                "id": 2,
                "name": "GigabitEthernet2"
            }
        ]
    },
    "message": "success"
}
 

Request   

GET api/networkDevices/{id}

URL Parameters

id  integer  

The ID of the network device.

PUT api/networkDevices/{id}

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->put(
    'domain.com/api/networkDevices/7',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'deviceType' => 'snmp_switch',
            'name' => 'laudantium',
            'host' => 'switch01.domain.com',
            'snmpCommunity' => 'deserunt',
            'snmpVersion' => '2c',
            'agentId' => 1,
            'features' => [
                'bw_collection',
            ],
            'meta' => [
                'flip_in_out' => 'true',
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/networkDevices/7"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "deviceType": "snmp_switch",
    "name": "laudantium",
    "host": "switch01.domain.com",
    "snmpCommunity": "deserunt",
    "snmpVersion": "2c",
    "agentId": 1,
    "features": [
        "bw_collection"
    ],
    "meta": {
        "flip_in_out": "true"
    }
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request PUT \
    "domain.com/api/networkDevices/7" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"deviceType\": \"snmp_switch\",
    \"name\": \"laudantium\",
    \"host\": \"switch01.domain.com\",
    \"snmpCommunity\": \"deserunt\",
    \"snmpVersion\": \"2c\",
    \"agentId\": 1,
    \"features\": [
        \"bw_collection\"
    ],
    \"meta\": {
        \"flip_in_out\": \"true\"
    }
}"

Request   

PUT api/networkDevices/{id}

PATCH api/networkDevices/{id}

URL Parameters

id  integer optional  

The ID of the network device.

Body Parameters

deviceType  string optional  

Must be one of snmp_switch, telejetDigiOne, apc, racktivityEnergySwitch, racktivityPowerManager, cyberpowerAts, dellrPdu, enlogicv1, intertechSw, intertechSm, or ipoman.

name  string optional  

host  string optional  

The hostname or IP of the device.

port  integer optional  

This field is required when deviceType is telejetDigiOne. Must be between 1 and 65535.

username  string optional  

This field is required when deviceType is telejetDigiOne.

password  string optional  

Optional field. Currently only available for telejet.

snmpCommunity  string optional  

This field is required when deviceType is snmp_switch, apc, racktivityEnergySwitch, racktivityPowerManager, cyberpowerAts, dellrPdu, enlogicv1, intertechSw, intertechSm, or ipoman.

snmpVersion  string optional  

This field is required when deviceType is snmp_switch. The SNMP version for PDUs is detected automatically.

agentId  integer optional  

The specificated agent will handle the connection.

features  string[] optional  

Some devices have additional features available.

meta  object optional  

Some devices support additional meta flags.

DELETE api/networkDevices/{id}

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->delete(
    'domain.com/api/networkDevices/3',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/networkDevices/3"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());
curl --request DELETE \
    "domain.com/api/networkDevices/3" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Request   

DELETE api/networkDevices/{id}

URL Parameters

id  integer  

The ID of the network device.

Others

GET api/ping

requires authentication

This endpoint provides a simple and resource-efficient way to check if the API is reachable.

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/ping',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/ping"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "domain.com/api/ping" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200):

Show headers
cache-control: no-cache, private
content-type: application/json
referrer-policy: no-referrer
x-xss-protection: 1; mode=block
x-frame-options: DENY
x-content-type-options: nosniff
vary: Origin
 

{
    "result": "pong",
    "message": "success"
}
 

Request   

GET api/ping

GET api/system/version

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/system/version',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/system/version"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "domain.com/api/system/version" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200):

Show headers
cache-control: no-cache, private
content-type: application/json
referrer-policy: no-referrer
x-xss-protection: 1; mode=block
x-frame-options: DENY
x-content-type-options: nosniff
vary: Origin
 

{
    "result": {
        "app_version": "1.0.11",
        "updateAvailable": 0,
        "updateVersion": "1.0.11"
    },
    "message": "success"
}
 

Request   

GET api/system/version

GET api/system/listTimezones

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/system/listTimezones',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/system/listTimezones"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "domain.com/api/system/listTimezones" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200):


{
    "result": [
        "Africa/Abidjan",
        "Africa/Accra",
        "..."
    ],
    "message": "success"
}
 

Request   

GET api/system/listTimezones

GET api/system/listTimeDateFormats

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/system/listTimeDateFormats',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/system/listTimeDateFormats"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "domain.com/api/system/listTimeDateFormats" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200):

Show headers
cache-control: no-cache, private
content-type: application/json
referrer-policy: no-referrer
x-xss-protection: 1; mode=block
x-frame-options: DENY
x-content-type-options: nosniff
vary: Origin
 

{
    "result": [
        {
            "format": "DD.MM.YYYY HH:mm:ss",
            "example": "15.11.2022 15:16:16"
        },
        {
            "format": "YYYY-MM-DD HH:mm:ss",
            "example": "2022-11-15 15:16:16"
        }
    ],
    "message": "success"
}
 

Request   

GET api/system/listTimeDateFormats

GET api/system/ui/version

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/system/ui/version',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/system/ui/version"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "domain.com/api/system/ui/version" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200):

Show headers
cache-control: no-cache, private
content-type: application/json
referrer-policy: no-referrer
x-xss-protection: 1; mode=block
x-frame-options: DENY
x-content-type-options: nosniff
vary: Origin
 

{
    "result": {
        "frontend_version": "e0c65243204ca9c8e11c732c37c0455878c777ac450c1e273a688ebb77a1eeac"
    },
    "message": "success"
}
 

Request   

GET api/system/ui/version

GET api/system/ui/settings

requires authentication

This endpoint is queried by the browser before logging into the Tenantos interface. The response contains various settings for the user interface, such as the color scheme and various texts. The response may differ depending on the brand/domain.

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/system/ui/settings',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/system/ui/settings"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "domain.com/api/system/ui/settings" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200):


{
    "result": {
        "top_navbar_header_title": "Tenantos",
        "page_title": "Control",
        "login_page_text": "Server Management",
        "theme_dark": {
            "primary": "#536DFE",
            "...": "..."
        },
        "theme_light": {
            "primary": "#0C47A0",
            "...": "..."
        }
    },
    "message": "success"
}
 

Request   

GET api/system/ui/settings

GET api/system/ui/uiLanguage

requires authentication

This endpoint is queried by the browser before and after logging into the Tenantos interface. The response contains the language files and may differ depending on the brand/domain.

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/system/ui/uiLanguage',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/system/ui/uiLanguage"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "domain.com/api/system/ui/uiLanguage" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200):


{
    "result": {
        "en": {
            "common_table_nodata_reload": "No data available. Reload?",
            "common_table_placeholder_search": "Search...",
            "...": "..."
        }
    },
    "message": "success"
}
 

Request   

GET api/system/ui/uiLanguage

GET api/system/settingsAfterLogin

requires authentication

This endpoint is queried by the browser after logging in into the Tenantos web interface. The response contains various settings for the user interface, such as which checkboxes should be activated by default.

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/system/settingsAfterLogin',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/system/settingsAfterLogin"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "domain.com/api/system/settingsAfterLogin" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200):

Show headers
cache-control: no-cache, private
content-type: application/json
referrer-policy: no-referrer
x-xss-protection: 1; mode=block
x-frame-options: DENY
x-content-type-options: nosniff
vary: Origin
 

{
    "result": {
        "precheck_addserver_redirect_to_server": "off",
        "precheck_adduser_redirect_to_user": "off",
        "precheck_deleteserver_delete_vm_on_node": "off",
        "server_console_show_dialog": "on",
        "ui_connection_assignments_dont_show_already_assigned_items": "off"
    },
    "message": "success"
}
 

Request   

GET api/system/settingsAfterLogin

PXE Basic Operations

POST api/os/list

requires authentication

Normally the available profiles are queried via the api/servers/{server}/provisioning/getProfiles endpoint, but there are situations where all available profiles need to be queried (e.g. for billing integrations).

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'domain.com/api/os/list',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'type' => 'pxe',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/os/list"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "type": "pxe"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
    "domain.com/api/os/list" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"type\": \"pxe\"
}"

Request   

POST api/os/list

Body Parameters

type  string  

Must be one of pxe.

POST api/pxe/profiles/{pxeProfileId}/duplicate

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'domain.com/api/pxe/profiles/13/duplicate',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => 'debitis',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/pxe/profiles/13/duplicate"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "debitis"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
    "domain.com/api/pxe/profiles/13/duplicate" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"debitis\"
}"

Request   

POST api/pxe/profiles/{pxeProfileId}/duplicate

URL Parameters

pxeProfileId  integer  

The ID of the PXE profile which should be duplicated.

Body Parameters

name  string  

POST api/pxe/scripts/{pxeScriptId}/duplicate

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'domain.com/api/pxe/scripts/11/duplicate',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => 'eum',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/pxe/scripts/11/duplicate"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "eum"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
    "domain.com/api/pxe/scripts/11/duplicate" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"eum\"
}"

Request   

POST api/pxe/scripts/{pxeScriptId}/duplicate

URL Parameters

pxeScriptId  integer  

The ID of the PXE script which should be duplicated.

Body Parameters

name  string  

POST api/pxe/disklayouts/{pxeDisklayoutId}/duplicate

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'domain.com/api/pxe/disklayouts/5/duplicate',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => 'adipisci',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/pxe/disklayouts/5/duplicate"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "adipisci"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
    "domain.com/api/pxe/disklayouts/5/duplicate" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"adipisci\"
}"

Request   

POST api/pxe/disklayouts/{pxeDisklayoutId}/duplicate

URL Parameters

pxeDisklayoutId  integer  

The ID of the PXE script which should be duplicated.

Body Parameters

name  string  

PXE Disklayouts

Feature: https://documentation.tenantos.com/Tenantos/pxe-manager/disklayouts/disklayouts/

GET api/pxe/disklayouts

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/pxe/disklayouts',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/pxe/disklayouts"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "domain.com/api/pxe/disklayouts" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200):


{
    "result": [
        {
            "id": 2,
            "tags": [
                "preseed",
                "kickstart"
            ],
            "disklayout": "",
            "name": "Auto RAID",
            "isDisabled": 0,
            "isStockTemplate": 1,
            "internal_key": "auto_raid",
            "isAutoRaid": 1,
            "min_disks": null,
            "offer_if_has_tag": [],
            "dont_offer_if_has_tag": []
        },
        {
            "id": 4,
            "tags": [
                "kickstart",
                "preseed"
            ],
            "disklayout": "",
            "name": "RAID 1",
            "isDisabled": 0,
            "isStockTemplate": 1,
            "internal_key": "auto_raid_1",
            "isAutoRaid": 1,
            "min_disks": 2,
            "offer_if_has_tag": [],
            "dont_offer_if_has_tag": []
        }
    ],
    "message": "success"
}
 

Request   

GET api/pxe/disklayouts

POST api/pxe/disklayouts

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'domain.com/api/pxe/disklayouts',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'tags' => [
                'itaque',
            ],
            'disklayout' => 'autopart --type=lvm',
            'name' => 'rem',
            'min_disks' => 3,
            'isDisabled' => false,
            'offer_if_has_tag' => [
                'dolores',
            ],
            'dont_offer_if_has_tag' => [
                'labore',
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/pxe/disklayouts"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "tags": [
        "itaque"
    ],
    "disklayout": "autopart --type=lvm",
    "name": "rem",
    "min_disks": 3,
    "isDisabled": false,
    "offer_if_has_tag": [
        "dolores"
    ],
    "dont_offer_if_has_tag": [
        "labore"
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
    "domain.com/api/pxe/disklayouts" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"tags\": [
        \"itaque\"
    ],
    \"disklayout\": \"autopart --type=lvm\",
    \"name\": \"rem\",
    \"min_disks\": 3,
    \"isDisabled\": false,
    \"offer_if_has_tag\": [
        \"dolores\"
    ],
    \"dont_offer_if_has_tag\": [
        \"labore\"
    ]
}"

Request   

POST api/pxe/disklayouts

Body Parameters

tags  string[]  

disklayout  string  

The kickstart or preseed configuration.

name  string  

min_disks  integer optional  

The profile will only be offered if the server has the specificated minimum amount of disks. Leave empty to always offer.

isDisabled  boolean optional  

offer_if_has_tag  string[] optional  

dont_offer_if_has_tag  string[] optional  

GET api/pxe/disklayouts/{id}

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/pxe/disklayouts/2',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/pxe/disklayouts/2"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "domain.com/api/pxe/disklayouts/2" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200):


{
    "result": {
        "id": 2,
        "tags": [
            "preseed",
            "kickstart"
        ],
        "disklayout": "",
        "name": "Auto RAID",
        "isDisabled": 0,
        "isStockTemplate": 1,
        "internal_key": "auto_raid",
        "isAutoRaid": 1,
        "min_disks": null,
        "offer_if_has_tag": [],
        "dont_offer_if_has_tag": []
    },
    "message": "success"
}
 

Request   

GET api/pxe/disklayouts/{id}

URL Parameters

id  integer  

The ID of the disk layout.

PUT api/pxe/disklayouts/{id}

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->put(
    'domain.com/api/pxe/disklayouts/17',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'tags' => '',
            'disklayout' => 'autopart --type=lvm',
            'name' => 'qui',
            'min_disks' => 3,
            'isDisabled' => true,
            'offer_if_has_tag' => [
                'rerum',
            ],
            'dont_offer_if_has_tag' => [
                'ut',
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/pxe/disklayouts/17"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "tags": "",
    "disklayout": "autopart --type=lvm",
    "name": "qui",
    "min_disks": 3,
    "isDisabled": true,
    "offer_if_has_tag": [
        "rerum"
    ],
    "dont_offer_if_has_tag": [
        "ut"
    ]
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request PUT \
    "domain.com/api/pxe/disklayouts/17" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"tags\": \"\",
    \"disklayout\": \"autopart --type=lvm\",
    \"name\": \"qui\",
    \"min_disks\": 3,
    \"isDisabled\": true,
    \"offer_if_has_tag\": [
        \"rerum\"
    ],
    \"dont_offer_if_has_tag\": [
        \"ut\"
    ]
}"

Request   

PUT api/pxe/disklayouts/{id}

PATCH api/pxe/disklayouts/{id}

URL Parameters

id  integer  

The ID of the disk layout.

Body Parameters

tags  string[] optional  

Must have at least 1 items.

disklayout  string optional  

The kickstart or preseed configuration.

name  string optional  

min_disks  integer optional  

The profile will only be offered if the server has the specificated minimum amount of disks. Leave empty to always offer.

isDisabled  boolean optional  

offer_if_has_tag  string[] optional  

dont_offer_if_has_tag  string[] optional  

DELETE api/pxe/disklayouts/{id}

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->delete(
    'domain.com/api/pxe/disklayouts/3',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/pxe/disklayouts/3"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());
curl --request DELETE \
    "domain.com/api/pxe/disklayouts/3" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Request   

DELETE api/pxe/disklayouts/{id}

URL Parameters

id  integer  

The ID of the disk layout.

PXE Profiles

Feature: https://documentation.tenantos.com/Tenantos/pxe-manager/profiles/profile/

GET api/pxe/tags

requires authentication

Returns all available PXE tags (aggregated from all PXE profiles).

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/pxe/tags',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/pxe/tags"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "domain.com/api/pxe/tags" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200):


{
    "result": {
        "tags": [
            {
                "id": "kickstart",
                "name": "kickstart"
            },
            {
                "id": "centos",
                "name": "centos"
            }
        ]
    },
    "message": "success"
}
 

Request   

GET api/pxe/tags

POST api/pxe/tags/getPxeProfilesByTags

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'domain.com/api/pxe/tags/getPxeProfilesByTags',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'tags' => [
                'voluptates',
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/pxe/tags/getPxeProfilesByTags"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "tags": [
        "voluptates"
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
    "domain.com/api/pxe/tags/getPxeProfilesByTags" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"tags\": [
        \"voluptates\"
    ]
}"

Request   

POST api/pxe/tags/getPxeProfilesByTags

Body Parameters

tags  string[]  

GET api/pxe/profiles/{pxeProfileId}/clearcache

requires authentication

Deletes all cached OS data from all remote agents for this profile. Tenantos caches the files necessary for the installation of the respective operating system.

Windows operating system installation files cannot be deleted because Windows is imported from an ISO and not downloaded from a remote server.

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/pxe/profiles/1/clearcache',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/pxe/profiles/1/clearcache"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "domain.com/api/pxe/profiles/1/clearcache" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200):

Show headers
cache-control: no-cache, private
content-type: application/json
referrer-policy: no-referrer
x-xss-protection: 1; mode=block
x-frame-options: DENY
x-content-type-options: nosniff
vary: Origin
 

{
    "result": "ok",
    "message": "success"
}
 

Request   

GET api/pxe/profiles/{pxeProfileId}/clearcache

URL Parameters

pxeProfileId  integer  

The ID of the PXE profile.

GET api/pxe/profiles

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/pxe/profiles',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/pxe/profiles"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "domain.com/api/pxe/profiles" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200):


{
    "result": [
        {
            "id": 2,
            "tags": [
                "kickstart",
                "centos"
            ],
            "osName": "CentOS 8",
            "pxeConfig": "...",
            "pxeType": "kickstart",
            "networkConfigMode": null,
            "defaultDiskLayout": "...",
            "customPostScript": "",
            "customFirstBoot": "",
            "packages": "...",
            "language": "en_US",
            "autoInstallTemplate": "...",
            "timezone": "Etc/UTC",
            "mirrorUrl": "...",
            "cacheDirectory": "centos8",
            "httpdirectory": "",
            "version": null,
            "isStockTemplate": 1,
            "isDisabled": 0,
            "allow_ssh_keys": 1,
            "default_disklayout_template": 2,
            "enforced_default_disklayout_template": 0,
            "default_run_scripts": [
                1
            ],
            "enforced_default_run_scripts": 1,
            "default_run_scripts_hide_others": 0,
            "allow_set_hostname": 1,
            "set_root_password": 1,
            "completeAfterDownload": null,
            "configure_all_ipvfour_ask_user": null,
            "configure_all_ipvfour_enforce": 1,
            "configure_all_ipvsix_ask_user": null,
            "configure_all_ipvsix_enforce": 1,
            "offer_if_has_tag": [],
            "dont_offer_if_has_tag": [],
            "windows_activation_key": null,
            "windows_use_empty_activation_key": null,
            "windows_key_location_userdata": null,
            "windows_key_location_specialize": null,
            "windows_skip_oobe": null,
            "windows_bypass_system_requirements_check": null,
            "allow_for_vps": 1,
            "allow_for_dedicated": 1,
            "disklayouts": [
                {
                    "id": 2,
                    "name": "Auto RAID"
                }
            ],
            "scripts": [
                {
                    "id": 1,
                    "name": "System Upgrade"
                }
            ],
            "isRescue": 0
        }
    ],
    "message": "success"
}
 

Request   

GET api/pxe/profiles

POST api/pxe/profiles

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'domain.com/api/pxe/profiles',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'tags' => [
                'kickstart ',
            ],
            'osName' => 'corrupti',
            'pxeType' => 'kickstart',
            'pxeConfig' => '#!ipxe',
            'defaultDiskLayout' => 'autopart --type=lvm',
            'packages' => 'kexec-tools',
            'language' => 'asperiores',
            'autoInstallTemplate' => 'network --bootproto=static',
            'timezone' => 'eos',
            'mirrorUrl' => 'http://mirror.fra10.de.leaseweb.net/centos/8-stream/BaseOS/x86_64/os',
            'cacheDirectory' => 'centos8',
            'networkConfigMode' => 'maxime',
            'httpdirectory' => 'nihil',
            'version' => 'quae',
            'customFirstBoot' => 'touch /root/123',
            'customPostScript' => 'touch /root/123',
            'isDisabled' => false,
            'allow_ssh_keys' => false,
            'allow_set_hostname' => true,
            'allow_for_vps' => true,
            'allow_for_dedicated' => true,
            'set_root_password' => false,
            'completeAfterDownload' => false,
            'default_disklayout_template' => 15,
            'fallback_to_default_disklayout_if_unset' => false,
            'enforced_default_disklayout_template' => false,
            'default_run_scripts' => [
                'autem',
            ],
            'enforced_default_run_scripts' => false,
            'default_run_scripts_hide_others' => false,
            'configure_all_ipvfour_ask_user' => true,
            'configure_all_ipvfour_enforce' => false,
            'configure_all_ipvsix_ask_user' => false,
            'configure_all_ipvsix_enforce' => true,
            'offer_if_has_tag' => [
                'quam',
            ],
            'dont_offer_if_has_tag' => [
                'tempora',
            ],
            'windows_activation_key' => 'doloremque',
            'windows_use_empty_activation_key' => true,
            'windows_key_location_userdata' => false,
            'windows_key_location_specialize' => true,
            'windows_bypass_system_requirements_check' => false,
            'windows_skip_oobe' => true,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/pxe/profiles"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "tags": [
        "kickstart "
    ],
    "osName": "corrupti",
    "pxeType": "kickstart",
    "pxeConfig": "#!ipxe",
    "defaultDiskLayout": "autopart --type=lvm",
    "packages": "kexec-tools",
    "language": "asperiores",
    "autoInstallTemplate": "network --bootproto=static",
    "timezone": "eos",
    "mirrorUrl": "http:\/\/mirror.fra10.de.leaseweb.net\/centos\/8-stream\/BaseOS\/x86_64\/os",
    "cacheDirectory": "centos8",
    "networkConfigMode": "maxime",
    "httpdirectory": "nihil",
    "version": "quae",
    "customFirstBoot": "touch \/root\/123",
    "customPostScript": "touch \/root\/123",
    "isDisabled": false,
    "allow_ssh_keys": false,
    "allow_set_hostname": true,
    "allow_for_vps": true,
    "allow_for_dedicated": true,
    "set_root_password": false,
    "completeAfterDownload": false,
    "default_disklayout_template": 15,
    "fallback_to_default_disklayout_if_unset": false,
    "enforced_default_disklayout_template": false,
    "default_run_scripts": [
        "autem"
    ],
    "enforced_default_run_scripts": false,
    "default_run_scripts_hide_others": false,
    "configure_all_ipvfour_ask_user": true,
    "configure_all_ipvfour_enforce": false,
    "configure_all_ipvsix_ask_user": false,
    "configure_all_ipvsix_enforce": true,
    "offer_if_has_tag": [
        "quam"
    ],
    "dont_offer_if_has_tag": [
        "tempora"
    ],
    "windows_activation_key": "doloremque",
    "windows_use_empty_activation_key": true,
    "windows_key_location_userdata": false,
    "windows_key_location_specialize": true,
    "windows_bypass_system_requirements_check": false,
    "windows_skip_oobe": true
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
    "domain.com/api/pxe/profiles" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"tags\": [
        \"kickstart \"
    ],
    \"osName\": \"corrupti\",
    \"pxeType\": \"kickstart\",
    \"pxeConfig\": \"#!ipxe\",
    \"defaultDiskLayout\": \"autopart --type=lvm\",
    \"packages\": \"kexec-tools\",
    \"language\": \"asperiores\",
    \"autoInstallTemplate\": \"network --bootproto=static\",
    \"timezone\": \"eos\",
    \"mirrorUrl\": \"http:\\/\\/mirror.fra10.de.leaseweb.net\\/centos\\/8-stream\\/BaseOS\\/x86_64\\/os\",
    \"cacheDirectory\": \"centos8\",
    \"networkConfigMode\": \"maxime\",
    \"httpdirectory\": \"nihil\",
    \"version\": \"quae\",
    \"customFirstBoot\": \"touch \\/root\\/123\",
    \"customPostScript\": \"touch \\/root\\/123\",
    \"isDisabled\": false,
    \"allow_ssh_keys\": false,
    \"allow_set_hostname\": true,
    \"allow_for_vps\": true,
    \"allow_for_dedicated\": true,
    \"set_root_password\": false,
    \"completeAfterDownload\": false,
    \"default_disklayout_template\": 15,
    \"fallback_to_default_disklayout_if_unset\": false,
    \"enforced_default_disklayout_template\": false,
    \"default_run_scripts\": [
        \"autem\"
    ],
    \"enforced_default_run_scripts\": false,
    \"default_run_scripts_hide_others\": false,
    \"configure_all_ipvfour_ask_user\": true,
    \"configure_all_ipvfour_enforce\": false,
    \"configure_all_ipvsix_ask_user\": false,
    \"configure_all_ipvsix_enforce\": true,
    \"offer_if_has_tag\": [
        \"quam\"
    ],
    \"dont_offer_if_has_tag\": [
        \"tempora\"
    ],
    \"windows_activation_key\": \"doloremque\",
    \"windows_use_empty_activation_key\": true,
    \"windows_key_location_userdata\": false,
    \"windows_key_location_specialize\": true,
    \"windows_bypass_system_requirements_check\": false,
    \"windows_skip_oobe\": true
}"

Request   

POST api/pxe/profiles

Body Parameters

tags  string[]  

osName  string  

pxeType  string  

pxeConfig  string  

The iPXE boot configuration.

defaultDiskLayout  string optional  

optional The disk layout configuration.

packages  string optional  

A list of packages which should be installed.

language  string optional  

autoInstallTemplate  string optional  

The answer file for the OS installer.

timezone  string optional  

mirrorUrl  string optional  

The URL to the OS mirror.

cacheDirectory  string  

The OS files will be stored in this directory.

networkConfigMode  string optional  

httpdirectory  string optional  

version  string optional  

The version of the operating system. Only required for Ubuntu / Windows.

customFirstBoot  string optional  

Script will be executed on first operating system boot.

customPostScript  string optional  

Script will be executed on after the installation has been completed, but within the installer environment.

isDisabled  boolean optional  

allow_ssh_keys  boolean optional  

allow_set_hostname  boolean optional  

allow_for_vps  boolean optional  

allow_for_dedicated  boolean optional  

set_root_password  boolean optional  

completeAfterDownload  boolean optional  

default_disklayout_template  integer optional  

fallback_to_default_disklayout_if_unset  boolean optional  

enforced_default_disklayout_template  boolean optional  

default_run_scripts  string[] optional  

enforced_default_run_scripts  boolean optional  

default_run_scripts_hide_others  boolean optional  

configure_all_ipvfour_ask_user  boolean optional  

configure_all_ipvfour_enforce  boolean optional  

configure_all_ipvsix_ask_user  boolean optional  

configure_all_ipvsix_enforce  boolean optional  

offer_if_has_tag  string[] optional  

dont_offer_if_has_tag  string[] optional  

windows_activation_key  string optional  

windows_use_empty_activation_key  boolean optional  

windows_key_location_userdata  boolean optional  

windows_key_location_specialize  boolean optional  

windows_bypass_system_requirements_check  boolean optional  

windows_skip_oobe  boolean optional  

GET api/pxe/profiles/{id}

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/pxe/profiles/2',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/pxe/profiles/2"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "domain.com/api/pxe/profiles/2" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200):


{
    "result": {
        "id": 2,
        "tags": [
            "kickstart",
            "centos"
        ],
        "osName": "CentOS 8",
        "pxeConfig": "...",
        "pxeType": "kickstart",
        "networkConfigMode": null,
        "defaultDiskLayout": "...",
        "customPostScript": "",
        "customFirstBoot": "",
        "packages": "...",
        "language": "en_US",
        "autoInstallTemplate": "...",
        "timezone": "Etc/UTC",
        "mirrorUrl": "...",
        "cacheDirectory": "centos8",
        "httpdirectory": "",
        "version": null,
        "isStockTemplate": 1,
        "isDisabled": 0,
        "allow_ssh_keys": 1,
        "default_disklayout_template": 2,
        "enforced_default_disklayout_template": 0,
        "default_run_scripts": [
            1
        ],
        "enforced_default_run_scripts": 1,
        "default_run_scripts_hide_others": 0,
        "allow_set_hostname": 1,
        "set_root_password": 1,
        "completeAfterDownload": null,
        "configure_all_ipvfour_ask_user": null,
        "configure_all_ipvfour_enforce": 1,
        "configure_all_ipvsix_ask_user": null,
        "configure_all_ipvsix_enforce": 1,
        "offer_if_has_tag": [],
        "dont_offer_if_has_tag": [],
        "windows_activation_key": null,
        "windows_use_empty_activation_key": null,
        "windows_key_location_userdata": null,
        "windows_key_location_specialize": null,
        "windows_skip_oobe": null,
        "windows_bypass_system_requirements_check": null,
        "allow_for_vps": 1,
        "allow_for_dedicated": 1,
        "disklayouts": [
            {
                "id": 2,
                "name": "Auto RAID"
            }
        ],
        "scripts": [
            {
                "id": 1,
                "name": "System Upgrade"
            }
        ],
        "isRescue": 0
    },
    "message": "success"
}
 

Request   

GET api/pxe/profiles/{id}

URL Parameters

id  integer  

The ID of the PXE profile.

PUT api/pxe/profiles/{id}

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->put(
    'domain.com/api/pxe/profiles/10',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'tags' => [
                'kickstart ',
            ],
            'osName' => 'itaque',
            'pxeType' => 'kickstart',
            'pxeConfig' => '#!ipxe',
            'defaultDiskLayout' => 'autopart --type=lvm',
            'packages' => 'kexec-tools',
            'language' => 'et',
            'autoInstallTemplate' => 'network --bootproto=static',
            'timezone' => 'eos',
            'mirrorUrl' => 'http://mirror.fra10.de.leaseweb.net/centos/8-stream/BaseOS/x86_64/os',
            'cacheDirectory' => 'centos8',
            'networkConfigMode' => 'mollitia',
            'httpdirectory' => 'eaque',
            'version' => 'omnis',
            'customFirstBoot' => 'touch /root/123',
            'customPostScript' => 'touch /root/123',
            'isDisabled' => true,
            'allow_ssh_keys' => false,
            'allow_for_vps' => true,
            'allow_for_dedicated' => true,
            'allow_set_hostname' => true,
            'set_root_password' => false,
            'completeAfterDownload' => true,
            'default_disklayout_template' => 13,
            'fallback_to_default_disklayout_if_unset' => true,
            'enforced_default_disklayout_template' => false,
            'default_run_scripts' => [
                'impedit',
            ],
            'enforced_default_run_scripts' => true,
            'default_run_scripts_hide_others' => true,
            'configure_all_ipvfour_ask_user' => true,
            'configure_all_ipvfour_enforce' => true,
            'configure_all_ipvsix_ask_user' => true,
            'configure_all_ipvsix_enforce' => true,
            'offer_if_has_tag' => [
                'voluptas',
            ],
            'dont_offer_if_has_tag' => [
                'incidunt',
            ],
            'windows_activation_key' => 'enim',
            'windows_use_empty_activation_key' => true,
            'windows_key_location_userdata' => false,
            'windows_key_location_specialize' => false,
            'windows_bypass_system_requirements_check' => false,
            'windows_skip_oobe' => false,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/pxe/profiles/10"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "tags": [
        "kickstart "
    ],
    "osName": "itaque",
    "pxeType": "kickstart",
    "pxeConfig": "#!ipxe",
    "defaultDiskLayout": "autopart --type=lvm",
    "packages": "kexec-tools",
    "language": "et",
    "autoInstallTemplate": "network --bootproto=static",
    "timezone": "eos",
    "mirrorUrl": "http:\/\/mirror.fra10.de.leaseweb.net\/centos\/8-stream\/BaseOS\/x86_64\/os",
    "cacheDirectory": "centos8",
    "networkConfigMode": "mollitia",
    "httpdirectory": "eaque",
    "version": "omnis",
    "customFirstBoot": "touch \/root\/123",
    "customPostScript": "touch \/root\/123",
    "isDisabled": true,
    "allow_ssh_keys": false,
    "allow_for_vps": true,
    "allow_for_dedicated": true,
    "allow_set_hostname": true,
    "set_root_password": false,
    "completeAfterDownload": true,
    "default_disklayout_template": 13,
    "fallback_to_default_disklayout_if_unset": true,
    "enforced_default_disklayout_template": false,
    "default_run_scripts": [
        "impedit"
    ],
    "enforced_default_run_scripts": true,
    "default_run_scripts_hide_others": true,
    "configure_all_ipvfour_ask_user": true,
    "configure_all_ipvfour_enforce": true,
    "configure_all_ipvsix_ask_user": true,
    "configure_all_ipvsix_enforce": true,
    "offer_if_has_tag": [
        "voluptas"
    ],
    "dont_offer_if_has_tag": [
        "incidunt"
    ],
    "windows_activation_key": "enim",
    "windows_use_empty_activation_key": true,
    "windows_key_location_userdata": false,
    "windows_key_location_specialize": false,
    "windows_bypass_system_requirements_check": false,
    "windows_skip_oobe": false
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request PUT \
    "domain.com/api/pxe/profiles/10" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"tags\": [
        \"kickstart \"
    ],
    \"osName\": \"itaque\",
    \"pxeType\": \"kickstart\",
    \"pxeConfig\": \"#!ipxe\",
    \"defaultDiskLayout\": \"autopart --type=lvm\",
    \"packages\": \"kexec-tools\",
    \"language\": \"et\",
    \"autoInstallTemplate\": \"network --bootproto=static\",
    \"timezone\": \"eos\",
    \"mirrorUrl\": \"http:\\/\\/mirror.fra10.de.leaseweb.net\\/centos\\/8-stream\\/BaseOS\\/x86_64\\/os\",
    \"cacheDirectory\": \"centos8\",
    \"networkConfigMode\": \"mollitia\",
    \"httpdirectory\": \"eaque\",
    \"version\": \"omnis\",
    \"customFirstBoot\": \"touch \\/root\\/123\",
    \"customPostScript\": \"touch \\/root\\/123\",
    \"isDisabled\": true,
    \"allow_ssh_keys\": false,
    \"allow_for_vps\": true,
    \"allow_for_dedicated\": true,
    \"allow_set_hostname\": true,
    \"set_root_password\": false,
    \"completeAfterDownload\": true,
    \"default_disklayout_template\": 13,
    \"fallback_to_default_disklayout_if_unset\": true,
    \"enforced_default_disklayout_template\": false,
    \"default_run_scripts\": [
        \"impedit\"
    ],
    \"enforced_default_run_scripts\": true,
    \"default_run_scripts_hide_others\": true,
    \"configure_all_ipvfour_ask_user\": true,
    \"configure_all_ipvfour_enforce\": true,
    \"configure_all_ipvsix_ask_user\": true,
    \"configure_all_ipvsix_enforce\": true,
    \"offer_if_has_tag\": [
        \"voluptas\"
    ],
    \"dont_offer_if_has_tag\": [
        \"incidunt\"
    ],
    \"windows_activation_key\": \"enim\",
    \"windows_use_empty_activation_key\": true,
    \"windows_key_location_userdata\": false,
    \"windows_key_location_specialize\": false,
    \"windows_bypass_system_requirements_check\": false,
    \"windows_skip_oobe\": false
}"

Request   

PUT api/pxe/profiles/{id}

PATCH api/pxe/profiles/{id}

URL Parameters

id  integer  

The ID of the PXE profile.

Body Parameters

tags  string[] optional  

osName  string optional  

pxeType  string optional  

pxeConfig  string optional  

The iPXE boot configuration.

defaultDiskLayout  string optional  

optional The disk layout configuration.

packages  string optional  

A list of packages which should be installed.

language  string optional  

autoInstallTemplate  string optional  

The answer file for the OS installer.

timezone  string optional  

mirrorUrl  string optional  

The URL to the OS mirror.

cacheDirectory  string optional  

The OS files will be stored in this directory.

networkConfigMode  string optional  

httpdirectory  string optional  

version  string optional  

The version of the operating system. Only required for Ubuntu / Windows.

customFirstBoot  string optional  

Script will be executed on first operating system boot.

customPostScript  string optional  

Script will be executed on after the installation has been completed, but within the installer environment.

isDisabled  boolean optional  

allow_ssh_keys  boolean optional  

allow_for_vps  boolean optional  

allow_for_dedicated  boolean optional  

allow_set_hostname  boolean optional  

set_root_password  boolean optional  

completeAfterDownload  boolean optional  

default_disklayout_template  integer optional  

fallback_to_default_disklayout_if_unset  boolean optional  

enforced_default_disklayout_template  boolean optional  

default_run_scripts  string[] optional  

enforced_default_run_scripts  boolean optional  

default_run_scripts_hide_others  boolean optional  

configure_all_ipvfour_ask_user  boolean optional  

configure_all_ipvfour_enforce  boolean optional  

configure_all_ipvsix_ask_user  boolean optional  

configure_all_ipvsix_enforce  boolean optional  

offer_if_has_tag  string[] optional  

dont_offer_if_has_tag  string[] optional  

windows_activation_key  string optional  

windows_use_empty_activation_key  boolean optional  

windows_key_location_userdata  boolean optional  

windows_key_location_specialize  boolean optional  

windows_bypass_system_requirements_check  boolean optional  

windows_skip_oobe  boolean optional  

DELETE api/pxe/profiles/{id}

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->delete(
    'domain.com/api/pxe/profiles/19',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/pxe/profiles/19"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());
curl --request DELETE \
    "domain.com/api/pxe/profiles/19" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Request   

DELETE api/pxe/profiles/{id}

URL Parameters

id  integer  

The ID of the PXE profile.

POST api/pxe/profiles/{pxeProfileId}/restore

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'domain.com/api/pxe/profiles/ipsum/restore',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/pxe/profiles/ipsum/restore"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());
curl --request POST \
    "domain.com/api/pxe/profiles/ipsum/restore" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Request   

POST api/pxe/profiles/{pxeProfileId}/restore

URL Parameters

pxeProfileId  string  

PXE Scripts

Feature: https://documentation.tenantos.com/Tenantos/pxe-manager/scripts/

GET api/pxe/scripts

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/pxe/scripts',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/pxe/scripts"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "domain.com/api/pxe/scripts" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200):


{
    "result": [
        {
            "id": 1,
            "tags": [
                "kickstart",
                "preseed",
                "openvz 7"
            ],
            "script": "...",
            "name": "System Upgrade",
            "isDisabled": 0,
            "isStockTemplate": 1,
            "offer_if_has_tag": [],
            "dont_offer_if_has_tag": []
        }
    ],
    "message": "success"
}
 

Request   

GET api/pxe/scripts

POST api/pxe/scripts

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'domain.com/api/pxe/scripts',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'tags' => [
                'kickstart',
            ],
            'script' => 'touch /root/123',
            'name' => 'dolorem',
            'isDisabled' => false,
            'offer_if_has_tag' => [
                'unde',
            ],
            'dont_offer_if_has_tag' => [
                'odit',
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/pxe/scripts"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "tags": [
        "kickstart"
    ],
    "script": "touch \/root\/123",
    "name": "dolorem",
    "isDisabled": false,
    "offer_if_has_tag": [
        "unde"
    ],
    "dont_offer_if_has_tag": [
        "odit"
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
    "domain.com/api/pxe/scripts" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"tags\": [
        \"kickstart\"
    ],
    \"script\": \"touch \\/root\\/123\",
    \"name\": \"dolorem\",
    \"isDisabled\": false,
    \"offer_if_has_tag\": [
        \"unde\"
    ],
    \"dont_offer_if_has_tag\": [
        \"odit\"
    ]
}"

Request   

POST api/pxe/scripts

Body Parameters

tags  string[]  

The script is linked to the operating systems via tags.

script  string  

Script will be executed on after the installation has been completed.

name  string  

isDisabled  boolean optional  

offer_if_has_tag  string[] optional  

dont_offer_if_has_tag  string[] optional  

GET api/pxe/scripts/{id}

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/pxe/scripts/1',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/pxe/scripts/1"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "domain.com/api/pxe/scripts/1" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200):


{
    "result": {
        "id": 1,
        "tags": [
            "kickstart",
            "preseed",
            "openvz 7"
        ],
        "script": "...",
        "name": "System Upgrade",
        "isDisabled": 0,
        "isStockTemplate": 1,
        "offer_if_has_tag": [],
        "dont_offer_if_has_tag": []
    },
    "message": "success"
}
 

Request   

GET api/pxe/scripts/{id}

URL Parameters

id  integer  

The ID of the PXE script.

PUT api/pxe/scripts/{id}

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->put(
    'domain.com/api/pxe/scripts/19',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'tags' => [
                'kickstart',
            ],
            'script' => 'touch /root/123',
            'name' => 'quia',
            'isDisabled' => false,
            'offer_if_has_tag' => [
                'maiores',
            ],
            'dont_offer_if_has_tag' => [
                'architecto',
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/pxe/scripts/19"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "tags": [
        "kickstart"
    ],
    "script": "touch \/root\/123",
    "name": "quia",
    "isDisabled": false,
    "offer_if_has_tag": [
        "maiores"
    ],
    "dont_offer_if_has_tag": [
        "architecto"
    ]
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request PUT \
    "domain.com/api/pxe/scripts/19" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"tags\": [
        \"kickstart\"
    ],
    \"script\": \"touch \\/root\\/123\",
    \"name\": \"quia\",
    \"isDisabled\": false,
    \"offer_if_has_tag\": [
        \"maiores\"
    ],
    \"dont_offer_if_has_tag\": [
        \"architecto\"
    ]
}"

Request   

PUT api/pxe/scripts/{id}

PATCH api/pxe/scripts/{id}

URL Parameters

id  integer  

The ID of the PXE script.

Body Parameters

tags  string[] optional  

The script is linked to the operating systems via tags.

script  string optional  

Script will be executed on after the installation has been completed.

name  string optional  

isDisabled  boolean optional  

offer_if_has_tag  string[] optional  

dont_offer_if_has_tag  string[] optional  

DELETE api/pxe/scripts/{id}

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->delete(
    'domain.com/api/pxe/scripts/2',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/pxe/scripts/2"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());
curl --request DELETE \
    "domain.com/api/pxe/scripts/2" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Request   

DELETE api/pxe/scripts/{id}

URL Parameters

id  integer  

The ID of the PXE script.

PXE Windows Profiles

Feature: https://documentation.tenantos.com/Tenantos/pxe-manager/profiles/windows/

GET api/pxe/windows/getWindowsInformation

requires authentication

Lists all available Windows versions of the ISO.

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/pxe/windows/getWindowsInformation',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/pxe/windows/getWindowsInformation"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "domain.com/api/pxe/windows/getWindowsInformation" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200):


{
    "result": {
        "data": [
            {
                "build": "Windows Server 2022 SERVERSTANDARDCORE",
                "name": "Windows Server 2022 Standard Evaluation",
                "languages": [
                    "en-us"
                ],
                "size": "4810.42 MB"
            }
        ]
    },
    "message": "success"
}
 

Request   

GET api/pxe/windows/getWindowsInformation

POST api/pxe/windows/importWindows

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'domain.com/api/pxe/windows/importWindows',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'editions' => [
                'Windows Server 2022 SERVERSTANDARD',
            ],
            'cacheDirectory' => 'win2k22',
            'language' => 'en-us',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/pxe/windows/importWindows"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "editions": [
        "Windows Server 2022 SERVERSTANDARD"
    ],
    "cacheDirectory": "win2k22",
    "language": "en-us"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
    "domain.com/api/pxe/windows/importWindows" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"editions\": [
        \"Windows Server 2022 SERVERSTANDARD\"
    ],
    \"cacheDirectory\": \"win2k22\",
    \"language\": \"en-us\"
}"

Request   

POST api/pxe/windows/importWindows

Body Parameters

editions  string[]  

The specificated editions will be imported.

cacheDirectory  string  

The Windows files will be placed in the specificated directory, regex: ^[a-z0-9]+$.

language  string  

The language which should be imported.

Remote Agents

Feature: https://documentation.tenantos.com/Tenantos/remote-agents/about-remote-agents/

POST api/remoteAgents/{agentId}/actions/testConnectivity

requires authentication

Tests if the connection between the Tenantos main server and the remote agent does work.

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'domain.com/api/remoteAgents/1/actions/testConnectivity',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'useCache' => true,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/remoteAgents/1/actions/testConnectivity"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "useCache": true
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
    "domain.com/api/remoteAgents/1/actions/testConnectivity" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"useCache\": true
}"

Request   

POST api/remoteAgents/{agentId}/actions/testConnectivity

URL Parameters

agentId  integer  

The ID of the agent.

Body Parameters

useCache  boolean optional  

The last status is cached for at least 15 minutes. Submit true to receive the cached status (for faster response).

GET api/remoteAgents/{agentId}/actions/getAssignments

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/remoteAgents/1/actions/getAssignments',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/remoteAgents/1/actions/getAssignments"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "domain.com/api/remoteAgents/1/actions/getAssignments" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200):


{
    "result": [
        {
            "deviceId": 1,
            "name": "USG 3G",
            "rootType": "Network Device",
            "assignmentType": "snmp_switch",
            "features": [
                "bw_collection"
            ]
        },
        {
            "deviceId": 1,
            "name": "server-001",
            "rootType": "Server",
            "assignmentType": "ipmi",
            "features": [
                "power_management"
            ]
        },
        {
            "deviceId": 1,
            "name": "server-001",
            "rootType": "Server",
            "assignmentType": "pxe",
            "features": [
                "installation"
            ]
        }
    ],
    "message": "success"
}
 

Request   

GET api/remoteAgents/{agentId}/actions/getAssignments

URL Parameters

agentId  integer  

The ID of the agent.

GET api/remoteAgents/ipmiKvmIsos

requires authentication

Feature: https://documentation.tenantos.com/Tenantos/remote-agents/ipmi-kvm-isos/

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/remoteAgents/ipmiKvmIsos',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/remoteAgents/ipmiKvmIsos"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "domain.com/api/remoteAgents/ipmiKvmIsos" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200):


{
    "result": [
        {
            "id": 1,
            "name": "grml64-full 2021.07",
            "filename": "789_grml64-full.iso",
            "type": "public_admin",
            "status": "Completed",
            "state": "complete",
            "expectedSize": 9547854,
            "filesize": 9547854
        }
    ],
    "message": "success"
}
 

Request   

GET api/remoteAgents/ipmiKvmIsos

POST api/remoteAgents/ipmiKvmIsos

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'domain.com/api/remoteAgents/ipmiKvmIsos',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => 'odit',
            'downloadUrl' => 'https://download.grml.org/grml64-full_2021.07.iso',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/remoteAgents/ipmiKvmIsos"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "odit",
    "downloadUrl": "https:\/\/download.grml.org\/grml64-full_2021.07.iso"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
    "domain.com/api/remoteAgents/ipmiKvmIsos" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"odit\",
    \"downloadUrl\": \"https:\\/\\/download.grml.org\\/grml64-full_2021.07.iso\"
}"

Request   

POST api/remoteAgents/ipmiKvmIsos

Body Parameters

name  string  

downloadUrl  string  

The URL to the ISO file.

GET api/remoteAgents/ipmiKvmIsos/{id}

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/remoteAgents/ipmiKvmIsos/1',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/remoteAgents/ipmiKvmIsos/1"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "domain.com/api/remoteAgents/ipmiKvmIsos/1" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200):


{
    "result": {
        "id": 1,
        "name": "grml64-full 2021.07",
        "filename": "789_grml64-full.iso",
        "type": "public_admin",
        "status": "Completed",
        "state": "complete",
        "expectedSize": 9547854,
        "filesize": 9547854
    },
    "message": "success"
}
 

Request   

GET api/remoteAgents/ipmiKvmIsos/{id}

URL Parameters

id  integer  

The ID of the ISO.

DELETE api/remoteAgents/ipmiKvmIsos/{id}

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->delete(
    'domain.com/api/remoteAgents/ipmiKvmIsos/20',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/remoteAgents/ipmiKvmIsos/20"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());
curl --request DELETE \
    "domain.com/api/remoteAgents/ipmiKvmIsos/20" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Request   

DELETE api/remoteAgents/ipmiKvmIsos/{id}

URL Parameters

id  integer  

The ID of the ISO.

GET api/remoteAgents

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/remoteAgents',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/remoteAgents"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "domain.com/api/remoteAgents" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200):


{
    "result": [
        {
            "id": 1,
            "name": "Local Agent",
            "ip": "10.99.1.5",
            "hostname": "local-agent.domain.com",
            "sshport": 22,
            "installStatus": 1
        }
    ],
    "message": "success"
}
 

Request   

GET api/remoteAgents

POST api/remoteAgents

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'domain.com/api/remoteAgents',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => 'nesciunt',
            'hostname' => 'alias',
            'password' => 'omnis',
            'sshport' => 2,
            'ip' => '3.124.87.199',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/remoteAgents"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "nesciunt",
    "hostname": "alias",
    "password": "omnis",
    "sshport": 2,
    "ip": "3.124.87.199"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
    "domain.com/api/remoteAgents" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"nesciunt\",
    \"hostname\": \"alias\",
    \"password\": \"omnis\",
    \"sshport\": 2,
    \"ip\": \"3.124.87.199\"
}"

Request   

POST api/remoteAgents

Body Parameters

name  string  

hostname  string  

password  string  

sshport  integer  

ip  string  

Must be a valid IP address.

GET api/remoteAgents/{id}

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/remoteAgents/1',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/remoteAgents/1"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "domain.com/api/remoteAgents/1" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200):


{
    "result": {
        "id": 1,
        "name": "Local Agent",
        "ip": "10.99.1.5",
        "hostname": "local-agent.domain.com",
        "sshport": 22,
        "installStatus": 1
    },
    "message": "success"
}
 

Request   

GET api/remoteAgents/{id}

URL Parameters

id  integer  

The ID of the agent.

PUT api/remoteAgents/{id}

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->put(
    'domain.com/api/remoteAgents/7',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => 'qui',
            'hostname' => 'et',
            'sshport' => 1,
            'ip' => '192.67.58.83',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/remoteAgents/7"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "qui",
    "hostname": "et",
    "sshport": 1,
    "ip": "192.67.58.83"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request PUT \
    "domain.com/api/remoteAgents/7" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"qui\",
    \"hostname\": \"et\",
    \"sshport\": 1,
    \"ip\": \"192.67.58.83\"
}"

Request   

PUT api/remoteAgents/{id}

PATCH api/remoteAgents/{id}

URL Parameters

id  integer  

The ID of the agent.

Body Parameters

name  string optional  

hostname  string optional  

sshport  integer optional  

ip  string optional  

Must be a valid IP address.

DELETE api/remoteAgents/{id}

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->delete(
    'domain.com/api/remoteAgents/8',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/remoteAgents/8"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());
curl --request DELETE \
    "domain.com/api/remoteAgents/8" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Request   

DELETE api/remoteAgents/{id}

URL Parameters

id  integer  

The ID of the agent.

Reverse DNS

Feature: https://documentation.tenantos.com/Tenantos/ip-manager/rdns-servers/

These API endpoints are, by default, only accessible as admin and are not intended for normal users.

DELETE api/subnets/{subnet_id}/rdnsAssignment

requires authentication

Removes the assigned RDNS server from the subnet.

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->delete(
    'domain.com/api/subnets/15/rdnsAssignment',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/subnets/15/rdnsAssignment"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());
curl --request DELETE \
    "domain.com/api/subnets/15/rdnsAssignment" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Request   

DELETE api/subnets/{subnet}/rdnsAssignment

URL Parameters

subnet  integer  

The ID of the subnet.

GET api/subnets/{subnet_id}/rdnsAssignment

requires authentication

Shows the current assigned RDNS server.

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/subnets/1/rdnsAssignment',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/subnets/1/rdnsAssignment"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "domain.com/api/subnets/1/rdnsAssignment" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200):


{}
 

Request   

GET api/subnets/{subnet_id}/rdnsAssignment

URL Parameters

subnet_id  integer  

The ID of the subnet.

POST api/subnets/{subnet}/rdnsAssignment

requires authentication

Assigns a RDNS server to the subnet.

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'domain.com/api/subnets/1/rdnsAssignment',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'serverId' => 1,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/subnets/1/rdnsAssignment"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "serverId": 1
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
    "domain.com/api/subnets/1/rdnsAssignment" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"serverId\": 1
}"

Request   

POST api/subnets/{subnet}/rdnsAssignment

URL Parameters

subnet  integer  

The ID of the subnet.

Body Parameters

serverId  integer  

The ID of the RDNS server.

POST api/rdns/providers/{provider}/configure

requires authentication

The features of this endpoint depends on the RDNS provider. For example, at PowerDNS, it is possible to create a reverse DNS zone using this endpoint.

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'domain.com/api/rdns/providers/1/configure',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/rdns/providers/1/configure"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());
curl --request POST \
    "domain.com/api/rdns/providers/1/configure" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Request   

POST api/rdns/providers/{provider}/configure

URL Parameters

provider  integer  

The ID of the RDNS provider.

POST api/rdns/providers/{provider}/addSubnetAssignment

requires authentication

An alternative way to assign a RDNS server to a subnet. The other way to do it is using the POST api/subnets/{subnet}/rdnsAssignment endpoint.

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'domain.com/api/rdns/providers/1/addSubnetAssignment',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'subnet' => '10.10.10.0',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/rdns/providers/1/addSubnetAssignment"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "subnet": "10.10.10.0"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
    "domain.com/api/rdns/providers/1/addSubnetAssignment" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"subnet\": \"10.10.10.0\"
}"

Request   

POST api/rdns/providers/{provider}/addSubnetAssignment

URL Parameters

provider  integer  

The ID of the RDNS server.

Body Parameters

subnet  string  

Must be a valid subnet (without CIDR).

POST api/rdns/ip

requires authentication

Get the RDNS entry. Users can query the RDNS entry via the POST api/servers/{server}/ipassignments/rdns endpoint.

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'domain.com/api/rdns/ip',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'adminIp' => '34.133.191.85',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/rdns/ip"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "adminIp": "34.133.191.85"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
    "domain.com/api/rdns/ip" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"adminIp\": \"34.133.191.85\"
}"

Request   

POST api/rdns/ip

Body Parameters

adminIp  string  

Must be a valid IP address.

PUT api/rdns/ip

requires authentication

Set the RDNS entry. Users can set the RDNS entry via the PUT api/servers/{server_id}/ipassignments/{id} endpoint.

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->put(
    'domain.com/api/rdns/ip',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'ptrRecord' => 'quam',
            'adminIp' => '248.122.80.151',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/rdns/ip"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "ptrRecord": "quam",
    "adminIp": "248.122.80.151"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request PUT \
    "domain.com/api/rdns/ip" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"ptrRecord\": \"quam\",
    \"adminIp\": \"248.122.80.151\"
}"

Request   

PUT api/rdns/ip

Body Parameters

ptrRecord  string optional  

adminIp  string  

Must be a valid IP address.

DELETE api/rdns/ip

requires authentication

Delete the RDNS entry. Users can delete the RDNS entry via the PUT api/servers/{server_id}/ipassignments/{id} endpoint.

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->delete(
    'domain.com/api/rdns/ip',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'adminIp' => '93.149.42.207',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/rdns/ip"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "adminIp": "93.149.42.207"
};

fetch(url, {
    method: "DELETE",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request DELETE \
    "domain.com/api/rdns/ip" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"adminIp\": \"93.149.42.207\"
}"

Request   

DELETE api/rdns/ip

Body Parameters

adminIp  string  

Must be a valid IP address.

GET api/rdns/providers

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/rdns/providers',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/rdns/providers"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "domain.com/api/rdns/providers" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200):

Show headers
cache-control: no-cache, private
content-type: application/json
referrer-policy: no-referrer
x-xss-protection: 1; mode=block
x-frame-options: DENY
x-content-type-options: nosniff
vary: Origin
 

{
    "result": [
        {
            "id": 1,
            "providerName": "PowerDNS",
            "serverName": "ns1.tenantos.com",
            "status": {
                "success": true
            },
            "detailedAssignments": [
                {
                    "subnet": "10.10.10.0",
                    "id": 1
                }
            ],
            "assignments": [
                "10.10.10.0"
            ]
        }
    ],
    "message": "success"
}
 

Request   

GET api/rdns/providers

POST api/rdns/providers

requires authentication

The body differs depending on the RDNS provider. Please add the provider via the interface to find out the required parameters.

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'domain.com/api/rdns/providers',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'type' => 'PowerDNS',
            'data' => [
                'serverName' => 'ns1.tenantos.com',
                'mysql_host' => '10.10.10.2',
                'mysql_port' => 9000,
                'mysql_username' => 'root',
                'mysql_password' => 'secret',
                'mysql_database' => 'powerdns',
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/rdns/providers"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "type": "PowerDNS",
    "data": {
        "serverName": "ns1.tenantos.com",
        "mysql_host": "10.10.10.2",
        "mysql_port": 9000,
        "mysql_username": "root",
        "mysql_password": "secret",
        "mysql_database": "powerdns"
    }
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
    "domain.com/api/rdns/providers" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"type\": \"PowerDNS\",
    \"data\": {
        \"serverName\": \"ns1.tenantos.com\",
        \"mysql_host\": \"10.10.10.2\",
        \"mysql_port\": 9000,
        \"mysql_username\": \"root\",
        \"mysql_password\": \"secret\",
        \"mysql_database\": \"powerdns\"
    }
}"

Request   

POST api/rdns/providers

Body Parameters

type  string  

The RDNS provider.

data  object  

The access details for the RDNS provider.

GET api/rdns/providers/{id}

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/rdns/providers/1',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/rdns/providers/1"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "domain.com/api/rdns/providers/1" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200):

Show headers
cache-control: no-cache, private
content-type: application/json
referrer-policy: no-referrer
x-xss-protection: 1; mode=block
x-frame-options: DENY
x-content-type-options: nosniff
vary: Origin
 

{
    "result": {
        "id": 1,
        "providerName": "PowerDNS",
        "serverName": "ns1.tenantos.com",
        "status": {
            "success": true
        },
        "detailedAssignments": [
            {
                "subnet": "10.10.10.0",
                "id": 1
            }
        ],
        "assignments": [
            "10.10.10.0"
        ]
    },
    "message": "success"
}
 

Request   

GET api/rdns/providers/{id}

URL Parameters

id  integer  

The ID of the RDNS provider.

PUT api/rdns/providers/{id}

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->put(
    'domain.com/api/rdns/providers/5',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'serverName' => 'minus',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/rdns/providers/5"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "serverName": "minus"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request PUT \
    "domain.com/api/rdns/providers/5" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"serverName\": \"minus\"
}"

Request   

PUT api/rdns/providers/{id}

PATCH api/rdns/providers/{id}

URL Parameters

id  integer  

The ID of the RDNS provider.

Body Parameters

serverName  string optional  

DELETE api/rdns/providers/{id}

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->delete(
    'domain.com/api/rdns/providers/6',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/rdns/providers/6"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());
curl --request DELETE \
    "domain.com/api/rdns/providers/6" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Request   

DELETE api/rdns/providers/{id}

URL Parameters

id  integer  

The ID of the RDNS provider.

Roles

Feature: https://documentation.tenantos.com/Tenantos/permissions/manage-roles/

GET api/roles

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/roles',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/roles"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "domain.com/api/roles" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200):


{
    "result": [
        {
            "name": "admin ",
            "id": 1,
            "assignedUsers": [
                {
                    "userId": 1,
                    "fullname": "Carlotta West",
                    "username": "adm"
                }
            ],
            "notDeleteable": 1,
            "notAssignable": 0,
            "ownedBy": {
                "userId": 1,
                "fullname": "Carlotta West",
                "username": "adm"
            },
            "type": "user_created",
            "permissions": []
        },
        {
            "name": "reseller ",
            "id": 2,
            "assignedUsers": [
                {
                    "userId": 2,
                    "fullname": "Alexie Reichel",
                    "username": "christiansen.conner2549195"
                }
            ],
            "notDeleteable": 0,
            "notAssignable": 0,
            "ownedBy": {
                "userId": 1,
                "fullname": "Carlotta West",
                "username": "adm"
            },
            "type": "user_created",
            "permissions": []
        },
        {
            "name": "user ",
            "id": 3,
            "assignedUsers": [
                {
                    "userId": 3,
                    "fullname": "Shanel Mayer",
                    "username": "marquis662975871"
                }
            ],
            "notDeleteable": 0,
            "notAssignable": 0,
            "ownedBy": {
                "userId": 1,
                "fullname": "Carlotta West",
                "username": "adm"
            },
            "type": "user_created",
            "permissions": []
        },
        {
            "name": "Default Subreseller Template Role For Resellers ",
            "id": 4,
            "assignedUsers": [],
            "notDeleteable": 1,
            "notAssignable": 1,
            "ownedBy": {
                "userId": 1,
                "fullname": "Carlotta West",
                "username": "adm"
            },
            "type": "reseller_template",
            "permissions": []
        },
        {
            "name": "Default User Role Template For Resellers ",
            "id": 5,
            "assignedUsers": [],
            "notDeleteable": 1,
            "notAssignable": 1,
            "ownedBy": {
                "userId": 1,
                "fullname": "Carlotta West",
                "username": "adm"
            },
            "type": "user_template",
            "permissions": []
        }
    ],
    "message": "success"
}
 

Request   

GET api/roles

POST api/roles

requires authentication

The available permissions can be requested via the api/permissions endpoint.

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'domain.com/api/roles',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => 'sint',
            'permissionlist' => [
                'servers.update.param.tags',
                'servers.apiOutput.param.tags',
            ],
            'permissionsets' => [
                'Manage Server Description',
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/roles"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "sint",
    "permissionlist": [
        "servers.update.param.tags",
        "servers.apiOutput.param.tags"
    ],
    "permissionsets": [
        "Manage Server Description"
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
    "domain.com/api/roles" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"sint\",
    \"permissionlist\": [
        \"servers.update.param.tags\",
        \"servers.apiOutput.param.tags\"
    ],
    \"permissionsets\": [
        \"Manage Server Description\"
    ]
}"

Request   

POST api/roles

Body Parameters

name  string  

permissionlist  string[] optional  

Array of single permissions.

permissionsets  string[] optional  

Array of permission groups.

GET api/roles/{id}

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/roles/1',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/roles/1"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "domain.com/api/roles/1" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200):


{
    "result": {
        "name": "admin ",
        "id": 1,
        "assignedUsers": [
            {
                "userId": 1,
                "fullname": "Carlotta West",
                "username": "adm"
            }
        ],
        "notDeleteable": 1,
        "notAssignable": 0,
        "ownedBy": {
            "userId": 1,
            "fullname": "Carlotta West",
            "username": "adm"
        },
        "type": "user_created",
        "permissions": [
            {
                "id": 1,
                "name": "system.version"
            },
            {
                "id": "...",
                "name": "..."
            }
        ]
    },
    "message": "success"
}
 

Request   

GET api/roles/{id}

URL Parameters

id  integer  

The ID of the role.

PUT api/roles

requires authentication

The available permissions can be requested via the api/permissions endpoint.

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->put(
    'domain.com/api/roles/9',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => 'veniam',
            'permissionlist' => [
                'servers.update.param.tags',
                'servers.apiOutput.param.tags',
            ],
            'permissionsets' => [
                'Manage Server Description',
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/roles/9"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "veniam",
    "permissionlist": [
        "servers.update.param.tags",
        "servers.apiOutput.param.tags"
    ],
    "permissionsets": [
        "Manage Server Description"
    ]
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request PUT \
    "domain.com/api/roles/9" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"veniam\",
    \"permissionlist\": [
        \"servers.update.param.tags\",
        \"servers.apiOutput.param.tags\"
    ],
    \"permissionsets\": [
        \"Manage Server Description\"
    ]
}"

Request   

PUT api/roles/{id}

PATCH api/roles/{id}

URL Parameters

id  integer  

The ID of the role.

Body Parameters

name  string optional  

permissionlist  string[] optional  

Array of single permissions.

permissionsets  string[] optional  

Array of permission groups.

DELETE api/roles/{id}

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->delete(
    'domain.com/api/roles/9',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/roles/9"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());
curl --request DELETE \
    "domain.com/api/roles/9" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Request   

DELETE api/roles/{id}

URL Parameters

id  integer  

The ID of the role.

GET api/permissions

requires authentication

Returns a list of the available permissions and the group names.

Group names (permissionsets) can be found at the "name" key and the individual permissions (permissionlist) at the apiEndpoint, apiUpdateFields and apiOutput fields.

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/permissions',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/permissions"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "domain.com/api/permissions" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200):


{
    "result": [
        {
            "name": "View System Version",
            "permissions": {
                "apiEndpoint": [
                    "system.version"
                ],
                "apiUpdateFields": [],
                "apiOutput": [
                    "system.apiOutput.param.app_version",
                    "system.apiOutput.param.updateAvailable",
                    "system.apiOutput.param.updateVersion"
                ]
            },
            "permission_level": "admin"
        },
        {
            "...": "..."
        }
    ],
    "message": "success"
}
 

Request   

GET api/permissions

Search Function

POST api/search/quicksearch

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'domain.com/api/search/quicksearch',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'text' => 'server-001',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/search/quicksearch"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "text": "server-001"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
    "domain.com/api/search/quicksearch" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"text\": \"server-001\"
}"

Example response (200):


{
    "result": [
        {
            "id": 61,
            "match": "server-001",
            "matchedFields": [
                "Servername"
            ],
            "desc": "hostname.com",
            "path": "/servers/61",
            "group": "Servers",
            "uuid": "servers-635bced823ff5"
        }
    ],
    "message": "success"
}
 

Request   

POST api/search/quicksearch

Body Parameters

text  string  

The search term.

Server Basic Operations

Feature: https://documentation.tenantos.com/Tenantos/server-management/add-server/

GET api/servers/tags

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/servers/tags',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/servers/tags"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "domain.com/api/servers/tags" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200):


{
    "result": {
        "tags": [
            "For Rent",
            "Internal",
            "..."
        ]
    },
    "message": "success"
}
 

Request   

GET api/servers/tags

GET api/servers/getByIp/{ip}

requires authentication

Find a server by the IP address. At the moment, only IPv4 addresses are supported.

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/servers/getByIp/10.10.10.30',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/servers/getByIp/10.10.10.30"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "domain.com/api/servers/getByIp/10.10.10.30" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200):

Show headers
cache-control: no-cache, private
content-type: application/json
referrer-policy: no-referrer
x-xss-protection: 1; mode=block
x-frame-options: DENY
x-content-type-options: nosniff
vary: Origin
 

{
    "result": {
        "id": 61,
        "hostname": "hostname.com",
        "servername": "server-001",
        "user_id": 8,
        "os": "CentOS 8",
        "servertype": "auto",
        "suspendedUserIds": [],
        "primaryip": "10.10.10.30",
        "reinstallationprovider": "pxe",
        "powerprovider": {
            "type": "ipmi",
            "supportedFeatures": [
                "getPowerStatus",
                "setPowerOff",
                "setPowerOn",
                "setPowerReset",
                "setPowerCycle",
                "setBootType",
                "setBmcReset",
                "executeCustomCommand"
            ]
        },
        "consoleprovider": {
            "type": "ipmi"
        },
        "owner_realname": "Lucinda Murphy",
        "tags": [
            "Internal"
        ],
        "description": "Database server",
        "reinstallationRunning": 0,
        "diskwipeRunning": 0,
        "rescueBootRunning": 0,
        "hardwarecollectRunning": 0,
        "detailedHardwareInformation": {
            "mainboard": {
                "model": "MAG X570 TOMAHAWK WIFI (MS-7C84)",
                "value": "1.0",
                "count": 1,
                "valueType": "text",
                "details": [
                    {
                        "model": "MAG X570 TOMAHAWK WIFI (MS-7C84)",
                        "size": "1.0"
                    }
                ]
            },
            "memory": {
                "model": "CMW32GX4M2C3200C16",
                "value": 65536,
                "count": 4,
                "valueType": "mb",
                "details": [
                    {
                        "model": "CMH32GX4M2Z3200C16",
                        "size": "16384"
                    },
                    {
                        "model": "CMW32GX4M2C3200C16",
                        "size": "16384"
                    },
                    {
                        "model": "CMH32GX4M2Z3200C16",
                        "size": "16384"
                    },
                    {
                        "model": "CMW32GX4M2C3200C16",
                        "size": "16384"
                    }
                ]
            },
            "cpu": {
                "model": "AMD Ryzen 9 3900XT",
                "value": "2200",
                "count": 1,
                "valueType": "MHz",
                "cores": "12"
            },
            "disk": {
                "model": "multiple",
                "value": 2842540,
                "count": 4,
                "valueType": "mb",
                "details": [
                    {
                        "model": "Samsung SSD 860 EVO 500GB",
                        "size": "476940"
                    },
                    {
                        "model": "SanDisk SDSSDHII480G",
                        "size": "457862"
                    },
                    {
                        "model": "WDS100T3X0C-00SJG0",
                        "size": "953869"
                    },
                    {
                        "model": "WDS100T3X0C-00SJG0",
                        "size": "953869"
                    }
                ]
            }
        },
        "ownerChain": [
            {
                "userId": 1,
                "name": "Prof. Arden Considine",
                "username": "adm",
                "type": "admin",
                "assignmentDate": "2021-11-15 15:16:03"
            },
            {
                "userId": 8,
                "name": "Lucinda Murphy",
                "username": "crona.rosario2228904",
                "type": "enduser",
                "assignmentDate": "2021-11-15 15:16:03"
            }
        ],
        "typeOfServer": "dedicated",
        "cachedPowerstatus": "offline",
        "backendDeletable": 0,
        "assignmentDate": "2021-11-15 15:16:03",
        "statsAvailable": 467549,
        "isExternalServer": 0,
        "postReinstallationActionAvailable": "",
        "trafficStatistics": {
            "1d": "10.73",
            "7d": "89.57",
            "14d": "181.84",
            "30d": "2022.20"
        },
        "lastBwrate": {
            "in": "0.38",
            "out": "0.08"
        },
        "ipassignments": [
            {
                "updated_at": "2022-11-15T15:15:12.000000Z",
                "ip": "10.10.10.30",
                "primary_ip": 1,
                "ipAttributes": {
                    "isIpv4": 1,
                    "isIpv6": 0,
                    "isSubnet": 0
                },
                "subnetinformation": {
                    "subnet": "10.10.10.0",
                    "netmask": "255.255.255.0",
                    "gw": "10.10.10.1",
                    "type": "v4"
                }
            }
        ]
    },
    "message": "success"
}
 

Request   

GET api/servers/getByIp/{ip}

URL Parameters

ip  string  

Get server by IPv4 address.

GET api/servers

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/servers',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/servers"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "domain.com/api/servers" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200):


{
    "result": [
        {
            "id": 61,
            "hostname": "hostname.com",
            "servername": "server-001",
            "user_id": 8,
            "os": "CentOS 8",
            "servertype": "auto",
            "suspendedUserIds": [],
            "primaryip": "10.10.10.30",
            "reinstallationprovider": "pxe",
            "powerprovider": {
                "type": "ipmi",
                "supportedFeatures": [
                    "getPowerStatus",
                    "setPowerOff",
                    "setPowerOn",
                    "setPowerReset",
                    "setPowerCycle",
                    "setBootType",
                    "setBmcReset",
                    "executeCustomCommand"
                ]
            },
            "consoleprovider": {
                "type": "ipmi"
            },
            "owner_realname": "Dr. Sabryna Tromp V",
            "tags": [
                "Internal"
            ],
            "description": "Database server",
            "reinstallationRunning": 0,
            "diskwipeRunning": 0,
            "rescueBootRunning": 0,
            "hardwarecollectRunning": 0,
            "detailedHardwareInformation": {
                "mainboard": {
                    "model": "MAG X570 TOMAHAWK WIFI (MS-7C84)",
                    "value": "1.0",
                    "count": 1,
                    "valueType": "text",
                    "details": [
                        {
                            "model": "MAG X570 TOMAHAWK WIFI (MS-7C84)",
                            "size": "1.0"
                        }
                    ]
                },
                "memory": {
                    "model": "CMW32GX4M2C3200C16",
                    "value": 65536,
                    "count": 4,
                    "valueType": "mb",
                    "details": [
                        {
                            "model": "CMH32GX4M2Z3200C16",
                            "size": "16384"
                        },
                        {
                            "model": "CMW32GX4M2C3200C16",
                            "size": "16384"
                        },
                        {
                            "model": "CMH32GX4M2Z3200C16",
                            "size": "16384"
                        },
                        {
                            "model": "CMW32GX4M2C3200C16",
                            "size": "16384"
                        }
                    ]
                },
                "cpu": {
                    "model": "AMD Ryzen 9 3900XT",
                    "value": "2200",
                    "count": 1,
                    "valueType": "MHz",
                    "cores": "12"
                },
                "disk": {
                    "model": "multiple",
                    "value": 2842540,
                    "count": 4,
                    "valueType": "mb",
                    "details": [
                        {
                            "model": "Samsung SSD 860 EVO 500GB",
                            "size": "476940"
                        },
                        {
                            "model": "SanDisk SDSSDHII480G",
                            "size": "457862"
                        },
                        {
                            "model": "WDS100T3X0C-00SJG0",
                            "size": "953869"
                        },
                        {
                            "model": "WDS100T3X0C-00SJG0",
                            "size": "953869"
                        }
                    ]
                }
            },
            "ownerChain": [
                {
                    "userId": 1,
                    "name": "Dr. Eva Flatley",
                    "username": "adm",
                    "type": "admin",
                    "assignmentDate": "2021-10-20 21:38:59"
                },
                {
                    "userId": 8,
                    "name": "Dr. Sabryna Tromp V",
                    "username": "nigel742503837",
                    "type": "enduser",
                    "assignmentDate": "2021-10-20 21:38:59"
                }
            ],
            "typeOfServer": "dedicated",
            "cachedPowerstatus": "online",
            "backendDeletable": 0,
            "assignmentDate": "2021-10-20 21:38:59",
            "statsAvailable": 555738,
            "isExternalServer": 0,
            "postReinstallationActionAvailable": "",
            "trafficStatistics": {
                "1d": "8.24",
                "7d": "790.71",
                "14d": "941.83",
                "30d": "1783.39"
            },
            "lastBwrate": {
                "in": "0.10",
                "out": "3.10"
            },
            "ipassignments": [
                {
                    "updated_at": "2022-10-20T21:38:15.000000Z",
                    "ip": "10.10.10.30",
                    "primary_ip": 1,
                    "ipAttributes": {
                        "isIpv4": 1,
                        "isIpv6": 0,
                        "isSubnet": 0
                    },
                    "subnetinformation": {
                        "subnet": "10.10.10.0",
                        "netmask": "255.255.255.0",
                        "gw": "10.10.10.1",
                        "type": "v4"
                    }
                }
            ]
        }
    ],
    "message": "success"
}
 

Request   

GET api/servers

POST api/servers

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'domain.com/api/servers',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'hostname' => 'hostname.com',
            'servername' => 'server-001',
            'description' => 'ducimus',
            'tags' => [
                'asperiores',
            ],
            'os' => 'velit',
            'servertype' => 'auto',
            'config' => [
                'agentId' => 1,
                'ipmi_ip' => '10.10.10.99',
                'ipmi_user' => 'ADMIN',
                'ipmi_password' => 'ADMIN',
                'pxe_mac' => 'aa:bb:cc:dd:ee:ff',
                'enable_pxe' => true,
                'enable_ipmi_console' => true,
                'enable_ipmi_powermanagement' => true,
            ],
            'ipassignments' => [
                [
                    'ip' => '10.10.10.55',
                    'subnets_id' => 15,
                    'primary_ip' => false,
                ],
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/servers"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "hostname": "hostname.com",
    "servername": "server-001",
    "description": "ducimus",
    "tags": [
        "asperiores"
    ],
    "os": "velit",
    "servertype": "auto",
    "config": {
        "agentId": 1,
        "ipmi_ip": "10.10.10.99",
        "ipmi_user": "ADMIN",
        "ipmi_password": "ADMIN",
        "pxe_mac": "aa:bb:cc:dd:ee:ff",
        "enable_pxe": true,
        "enable_ipmi_console": true,
        "enable_ipmi_powermanagement": true
    },
    "ipassignments": [
        {
            "ip": "10.10.10.55",
            "subnets_id": 15,
            "primary_ip": false
        }
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
    "domain.com/api/servers" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"hostname\": \"hostname.com\",
    \"servername\": \"server-001\",
    \"description\": \"ducimus\",
    \"tags\": [
        \"asperiores\"
    ],
    \"os\": \"velit\",
    \"servertype\": \"auto\",
    \"config\": {
        \"agentId\": 1,
        \"ipmi_ip\": \"10.10.10.99\",
        \"ipmi_user\": \"ADMIN\",
        \"ipmi_password\": \"ADMIN\",
        \"pxe_mac\": \"aa:bb:cc:dd:ee:ff\",
        \"enable_pxe\": true,
        \"enable_ipmi_console\": true,
        \"enable_ipmi_powermanagement\": true
    },
    \"ipassignments\": [
        {
            \"ip\": \"10.10.10.55\",
            \"subnets_id\": 15,
            \"primary_ip\": false
        }
    ]
}"

Request   

POST api/servers

Body Parameters

hostname  string  

Must not be greater than 255 characters.

servername  string  

Must not be greater than 255 characters.

user_id  string optional  

description  string optional  

tags  string[] optional  

os  string optional  

servertype  string optional  

Must be one of auto, dedicated, or vm.

vpsplan  integer optional  

Only specify if a virtual server, based on the plan ID, should be created.

overrideVpsResources  string[] optional  

Only specify if a virtual server, based on the plan ID, should be created and you want to override the resources. See: https://documentation.tenantos.com/billing-whmcs/configurable-options/vps-resource-overrides/

config  object optional  

Specify to add connections to the server in one go.

ipassignments  object[] optional  

ipassignments[].ip  Enter optional  

the IP which should be assigned to the server.

ipassignments[].subnets_id  integer optional  

ipassignments[].primary_ip  boolean optional  

GET api/servers/{id}

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/servers/61',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/servers/61"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "domain.com/api/servers/61" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200):


{
    "result": {
        "id": 61,
        "hostname": "hostname.com",
        "servername": "server-001",
        "user_id": 8,
        "os": "CentOS 8",
        "servertype": "auto",
        "suspendedUserIds": [],
        "primaryip": "10.10.10.30",
        "reinstallationprovider": "pxe",
        "powerprovider": {
            "type": "ipmi",
            "supportedFeatures": [
                "getPowerStatus",
                "setPowerOff",
                "setPowerOn",
                "setPowerReset",
                "setPowerCycle",
                "setBootType",
                "setBmcReset",
                "executeCustomCommand"
            ]
        },
        "consoleprovider": {
            "type": "ipmi"
        },
        "owner_realname": "Dejah Leannon",
        "tags": [
            "Internal"
        ],
        "description": "Database server",
        "reinstallationRunning": 0,
        "diskwipeRunning": 0,
        "rescueBootRunning": 0,
        "hardwarecollectRunning": 0,
        "detailedHardwareInformation": {
            "mainboard": {
                "model": "MAG X570 TOMAHAWK WIFI (MS-7C84)",
                "value": "1.0",
                "count": 1,
                "valueType": "text",
                "details": [
                    {
                        "model": "MAG X570 TOMAHAWK WIFI (MS-7C84)",
                        "size": "1.0"
                    }
                ]
            },
            "memory": {
                "model": "CMW32GX4M2C3200C16",
                "value": 65536,
                "count": 4,
                "valueType": "mb",
                "details": [
                    {
                        "model": "CMH32GX4M2Z3200C16",
                        "size": "16384"
                    },
                    {
                        "model": "CMW32GX4M2C3200C16",
                        "size": "16384"
                    },
                    {
                        "model": "CMH32GX4M2Z3200C16",
                        "size": "16384"
                    },
                    {
                        "model": "CMW32GX4M2C3200C16",
                        "size": "16384"
                    }
                ]
            },
            "cpu": {
                "model": "AMD Ryzen 9 3900XT",
                "value": "2200",
                "count": 1,
                "valueType": "MHz",
                "cores": "12"
            },
            "disk": {
                "model": "multiple",
                "value": 2842540,
                "count": 4,
                "valueType": "mb",
                "details": [
                    {
                        "model": "Samsung SSD 860 EVO 500GB",
                        "size": "476940"
                    },
                    {
                        "model": "SanDisk SDSSDHII480G",
                        "size": "457862"
                    },
                    {
                        "model": "WDS100T3X0C-00SJG0",
                        "size": "953869"
                    },
                    {
                        "model": "WDS100T3X0C-00SJG0",
                        "size": "953869"
                    }
                ]
            }
        },
        "ownerChain": [
            {
                "userId": 1,
                "name": "Viva Botsford",
                "username": "adm",
                "type": "admin",
                "assignmentDate": "2021-10-21 19:29:10"
            },
            {
                "userId": 8,
                "name": "Dejah Leannon",
                "username": "esmeralda44314938",
                "type": "enduser",
                "assignmentDate": "2021-10-21 19:29:10"
            }
        ],
        "typeOfServer": "dedicated",
        "cachedPowerstatus": "online",
        "backendDeletable": 0,
        "assignmentDate": "2021-10-21 19:29:10",
        "statsAvailable": 19838,
        "isExternalServer": 0,
        "postReinstallationActionAvailable": "",
        "trafficStatistics": {
            "1d": "8.24",
            "7d": "790.71",
            "14d": "941.83",
            "30d": "1783.39"
        },
        "lastBwrate": {
            "in": "0.10",
            "out": "3.10"
        },
        "ipassignments": [
            {
                "updated_at": "2022-10-21T19:28:25.000000Z",
                "ip": "10.10.10.30",
                "primary_ip": 1,
                "ipAttributes": {
                    "isIpv4": 1,
                    "isIpv6": 0,
                    "isSubnet": 0
                },
                "subnetinformation": {
                    "subnet": "10.10.10.0",
                    "netmask": "255.255.255.0",
                    "gw": "10.10.10.1",
                    "type": "v4"
                }
            }
        ]
    },
    "message": "success"
}
 

Request   

GET api/servers/{id}

URL Parameters

id  integer  

The ID of the server.

PUT api/servers/{id}

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->put(
    'domain.com/api/servers/2',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'hostname' => 'hostname.com',
            'servername' => 'server-001',
            'user_id' => 3,
            'description' => 'saepe',
            'tags' => [
                'excepturi',
            ],
            'os' => 'est',
            'servertype' => 'dedicated',
            'suspendUserIds' => [
                20,
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/servers/2"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "hostname": "hostname.com",
    "servername": "server-001",
    "user_id": 3,
    "description": "saepe",
    "tags": [
        "excepturi"
    ],
    "os": "est",
    "servertype": "dedicated",
    "suspendUserIds": [
        20
    ]
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request PUT \
    "domain.com/api/servers/2" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"hostname\": \"hostname.com\",
    \"servername\": \"server-001\",
    \"user_id\": 3,
    \"description\": \"saepe\",
    \"tags\": [
        \"excepturi\"
    ],
    \"os\": \"est\",
    \"servertype\": \"dedicated\",
    \"suspendUserIds\": [
        20
    ]
}"

Request   

PUT api/servers/{id}

PATCH api/servers/{id}

URL Parameters

id  integer  

The ID of the server.

Body Parameters

hostname  string optional  

Must not be greater than 255 characters.

servername  string optional  

Must not be greater than 255 characters.

user_id  integer optional  

description  string optional  

tags  string[] optional  

os  string optional  

servertype  string optional  

Must be one of auto, dedicated, or vm.

suspendUserIds  integer[] optional  

DELETE api/servers/{id}

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->delete(
    'domain.com/api/servers/2',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'destroy' => false,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/servers/2"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "destroy": false
};

fetch(url, {
    method: "DELETE",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request DELETE \
    "domain.com/api/servers/2" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"destroy\": false
}"

Request   

DELETE api/servers/{id}

URL Parameters

id  integer  

The ID of the server.

Body Parameters

destroy  boolean optional  

If server is a VM, the server will be deleted on the hypervisor (e.g. Proxmox)

GET api/servers/{server}/console/start

requires authentication

Generates a NoVNC session and returns a link to open the console.

For security reasons, the console can only be opened by the specificated IP. If no IP has been specificated, the console is bound to the requestor IP.

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/servers/1/console/start',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'authorizedIp' => '10.0.0.10',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/servers/1/console/start"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "authorizedIp": "10.0.0.10"
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request GET \
    --get "domain.com/api/servers/1/console/start" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"authorizedIp\": \"10.0.0.10\"
}"

Example response (200):


{
    "result": {
        "token": "fa5ed6be6666631b7e53e0968d47b03dd92cb8ae",
        "accessUrl": "https://domain.com/console/fa5ed6be6666631b7e53e0968d47b03dd92cb8ae"
    },
    "message": "success"
}
 

Request   

GET api/servers/{server}/console/start

URL Parameters

server  integer  

The ID of the server.

Body Parameters

authorizedIp  string  

Must be a valid IP address. The console is only reachable by the specificated IP.

Server Comments

Feature: https://documentation.tenantos.com/Tenantos/about-notes/about-notes-descriptions-tags/

GET api/servers/{server_id}/comments

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/servers/61/comments',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/servers/61/comments"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "domain.com/api/servers/61/comments" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200):


{
    "result": [
        {
            "id": 1,
            "created_at": "2022-10-20T21:29:07.000000Z",
            "comment": "<p>Server is broken</p>",
            "sticky": 1,
            "user_id": 1,
            "clientname": "Viva Botsford"
        }
    ],
    "message": "success"
}
 

Request   

GET api/servers/{server_id}/comments

URL Parameters

server_id  integer  

The ID of the server.

POST api/servers/{server}/comments

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'domain.com/api/servers/4/comments',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'comment' => 'sint',
            'sticky' => 20,
            'user_id' => 2,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/servers/4/comments"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "comment": "sint",
    "sticky": 20,
    "user_id": 2
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
    "domain.com/api/servers/4/comments" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"comment\": \"sint\",
    \"sticky\": 20,
    \"user_id\": 2
}"

Request   

POST api/servers/{server}/comments

URL Parameters

server  integer  

The ID of the server.

Body Parameters

comment  string  

sticky  integer optional  

user_id  integer optional  

GET api/servers/{server_id}/comments/{id}

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/servers/61/comments/1',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/servers/61/comments/1"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "domain.com/api/servers/61/comments/1" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200):


{
    "result": {
        "id": 1,
        "created_at": "2022-10-20T21:29:07.000000Z",
        "comment": "<p>Server is broken</p>",
        "sticky": 1,
        "user_id": 1
    },
    "message": "success"
}
 

Request   

GET api/servers/{server_id}/comments/{id}

URL Parameters

server_id  integer  

The ID of the server.

id  integer  

The ID of the comment.

PUT api/servers/{server_id}/comments/{id}

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->put(
    'domain.com/api/servers/18/comments/7',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'comment' => 'voluptatum',
            'sticky' => 14,
            'user_id' => 17,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/servers/18/comments/7"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "comment": "voluptatum",
    "sticky": 14,
    "user_id": 17
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request PUT \
    "domain.com/api/servers/18/comments/7" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"comment\": \"voluptatum\",
    \"sticky\": 14,
    \"user_id\": 17
}"

Request   

PUT api/servers/{server_id}/comments/{id}

PATCH api/servers/{server_id}/comments/{id}

URL Parameters

server_id  integer  

The ID of the server.

id  integer  

The ID of the comment.

Body Parameters

comment  string optional  

sticky  integer optional  

user_id  integer optional  

DELETE api/servers/{server_id}/comments/{id}

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->delete(
    'domain.com/api/servers/15/comments/14',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/servers/15/comments/14"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());
curl --request DELETE \
    "domain.com/api/servers/15/comments/14" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Request   

DELETE api/servers/{server_id}/comments/{id}

URL Parameters

server_id  integer  

The ID of the server.

id  integer  

The ID of the comment.

Server Connections

Feature: https://documentation.tenantos.com/Tenantos/server-management/server-page/connections/

GET api/servers/{server}/connections/{testConnectionId}/test

requires authentication

Verifies if the connection details are working. Connection testing does not work with every connection. IPMI connection tests are supported.

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/servers/61/connections/21/test',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/servers/61/connections/21/test"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "domain.com/api/servers/61/connections/21/test" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200):

Show headers
cache-control: no-cache, private
content-type: application/json
referrer-policy: no-referrer
x-xss-protection: 1; mode=block
x-frame-options: DENY
x-content-type-options: nosniff
vary: Origin
 

{
    "result": {
        "success": 1,
        "reason": "Test passed"
    },
    "message": "success"
}
 

Request   

GET api/servers/{server}/connections/{testConnectionId}/test

URL Parameters

server  integer  

The ID of the server.

testConnectionId  integer  

The ID of the connection. Not all connections support testing.

GET api/servers/{server_id}/connections

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/servers/61/connections',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/servers/61/connections"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "domain.com/api/servers/61/connections" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200):


{
    "result": [
        {
            "id": 21,
            "agentId": 1,
            "serverId": 61,
            "types": [
                "power_management",
                "remote_console"
            ],
            "agentAssignmentsRelationId": 21,
            "agent_details": {
                "id": 1,
                "name": "Local Agent",
                "hostname": "local-agent.domain.com"
            },
            "related_data": {
                "id": 21,
                "type": "ipmi",
                "meta": {
                    "username": "ADMIN",
                    "password": "ADMIN",
                    "ip": "10.10.10.101",
                    "javaVersion": "auto",
                    "bmcPort": "623"
                }
            }
        },
        {
            "id": 22,
            "agentId": 1,
            "serverId": 61,
            "types": [
                "installation"
            ],
            "agentAssignmentsRelationId": 22,
            "agent_details": {
                "id": 1,
                "name": "Local Agent",
                "hostname": "local-agent.domain.com"
            },
            "related_data": {
                "id": 22,
                "type": "pxe",
                "meta": []
            }
        },
        {
            "id": 23,
            "agentId": 1,
            "serverId": 61,
            "types": [
                "dhcp"
            ],
            "agentAssignmentsRelationId": 23,
            "agent_details": {
                "id": 1,
                "name": "Local Agent",
                "hostname": "local-agent.domain.com"
            },
            "related_data": {
                "id": 23,
                "type": "dhcp",
                "meta": {
                    "pxe_mac": "00:50:56:86:E1:A3"
                }
            }
        },
        {
            "id": 26,
            "agentId": 0,
            "serverId": 61,
            "types": [],
            "agentAssignmentsRelationId": 26,
            "agent_details": null,
            "related_data": {
                "id": 26,
                "type": "snmp_switch",
                "meta": {
                    "switchId": 2,
                    "portId": 2
                }
            }
        }
    ],
    "message": "success"
}
 

Request   

GET api/servers/{server_id}/connections

URL Parameters

server_id  integer  

The ID of the server.

POST api/servers/{server}/connections

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'domain.com/api/servers/18/connections',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'agentId' => 10,
            'types' => [
                'power_management',
                'remote_console',
            ],
            'connectionDetails' => [
                'meta' => [
                    'ip' => '192.168.171.200',
                    'username' => 'admin',
                    'password' => 'admin',
                    'javaVersion' => 'auto',
                ],
                'type' => 'ipmi',
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/servers/18/connections"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "agentId": 10,
    "types": [
        "power_management",
        "remote_console"
    ],
    "connectionDetails": {
        "meta": {
            "ip": "192.168.171.200",
            "username": "admin",
            "password": "admin",
            "javaVersion": "auto"
        },
        "type": "ipmi"
    }
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
    "domain.com/api/servers/18/connections" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"agentId\": 10,
    \"types\": [
        \"power_management\",
        \"remote_console\"
    ],
    \"connectionDetails\": {
        \"meta\": {
            \"ip\": \"192.168.171.200\",
            \"username\": \"admin\",
            \"password\": \"admin\",
            \"javaVersion\": \"auto\"
        },
        \"type\": \"ipmi\"
    }
}"

Request   

POST api/servers/{server}/connections

URL Parameters

server  integer  

The ID of the server.

Body Parameters

agentId  integer  

types  string[] optional  

Specify the allowed features / types for this connection.

connectionDetails  object  

connectionDetails.meta  object optional  

The connection configuration.

connectionDetails.type  string  

The type of the connection.

GET api/servers/{server_id}/connections/{id}

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/servers/61/connections/23',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/servers/61/connections/23"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "domain.com/api/servers/61/connections/23" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200):


{
    "result": {
        "id": 23,
        "agentId": 1,
        "serverId": 61,
        "types": [
            "dhcp"
        ],
        "agentAssignmentsRelationId": 23,
        "agent_details": {
            "id": 1,
            "name": "Local Agent",
            "hostname": "local-agent.domain.com"
        },
        "related_data": {
            "id": 23,
            "type": "dhcp",
            "meta": {
                "pxe_mac": "00:50:56:86:E1:A3"
            }
        }
    },
    "message": "success"
}
 

Request   

GET api/servers/{server_id}/connections/{id}

URL Parameters

server_id  integer  

The ID of the server.

id  integer  

The ID of the connection.

PUT api/servers/{server_id}/connections/{id}

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->put(
    'domain.com/api/servers/11/connections/7',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'agentId' => 15,
            'types' => [
                'power_management',
                'remote_console',
            ],
            'connectionDetails' => [
                'meta' => [
                    'ip' => '192.168.171.200',
                    'username' => 'admin',
                    'password' => 'admin',
                    'javaVersion' => 'auto',
                ],
                'type' => 'ipmi',
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/servers/11/connections/7"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "agentId": 15,
    "types": [
        "power_management",
        "remote_console"
    ],
    "connectionDetails": {
        "meta": {
            "ip": "192.168.171.200",
            "username": "admin",
            "password": "admin",
            "javaVersion": "auto"
        },
        "type": "ipmi"
    }
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request PUT \
    "domain.com/api/servers/11/connections/7" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"agentId\": 15,
    \"types\": [
        \"power_management\",
        \"remote_console\"
    ],
    \"connectionDetails\": {
        \"meta\": {
            \"ip\": \"192.168.171.200\",
            \"username\": \"admin\",
            \"password\": \"admin\",
            \"javaVersion\": \"auto\"
        },
        \"type\": \"ipmi\"
    }
}"

Request   

PUT api/servers/{server_id}/connections/{id}

PATCH api/servers/{server_id}/connections/{id}

URL Parameters

server_id  integer  

The ID of the server.

id  integer  

The ID of the connection.

Body Parameters

agentId  integer optional  

types  string[] optional  

Specify the allowed features / types for this connection.

connectionDetails  object optional  

connectionDetails.meta  object optional  

The connection configuration.

connectionDetails.type  string optional  

The type of the connection.

DELETE api/servers/{server_id}/connections/{id}

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->delete(
    'domain.com/api/servers/17/connections/18',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/servers/17/connections/18"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());
curl --request DELETE \
    "domain.com/api/servers/17/connections/18" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Request   

DELETE api/servers/{server_id}/connections/{id}

URL Parameters

server_id  integer  

The ID of the server.

id  integer  

The ID of the connection.

Server IP Assignments

Feature: https://documentation.tenantos.com/Tenantos/server-management/server-page/server-page/#ip-management

POST api/servers/{server}/ipassignments/rdns

requires authentication

Get the RDNS entry of an IP address.

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'domain.com/api/servers/61/ipassignments/rdns',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'ip' => '10.10.10.30',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/servers/61/ipassignments/rdns"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "ip": "10.10.10.30"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
    "domain.com/api/servers/61/ipassignments/rdns" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"ip\": \"10.10.10.30\"
}"

Example response (200):


{
    "result": {
        "ptrRecord": "server-001.com"
    },
    "message": "success"
}
 

Request   

POST api/servers/{server}/ipassignments/rdns

URL Parameters

server  integer  

The ID of the server.

Body Parameters

ip  string optional  

Must be a valid IP address which is assigned to this server.

GET api/servers/{server}/ipassignments/getAssignableSubnets

requires authentication

Receives a list of subnets from which IPs can be assigned to the server. Subnets are not always available to all servers.

Alias: GET api/virtualization/ipassignments/getAssignableSubnets - used to set the subnets in VPS plans.

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/servers/1/ipassignments/getAssignableSubnets',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/servers/1/ipassignments/getAssignableSubnets"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "domain.com/api/servers/1/ipassignments/getAssignableSubnets" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200):

Show headers
cache-control: no-cache, private
content-type: application/json
referrer-policy: no-referrer
x-xss-protection: 1; mode=block
x-frame-options: DENY
x-content-type-options: nosniff
vary: Origin
 

{
    "result": [
        {
            "id": 1,
            "subnet": "10.10.10.0/24",
            "type": {
                "hasChildSubnets": 0,
                "amountOfDirectChilds": 0,
                "hasSubIps": 1,
                "amountOfSubIps": 263,
                "type": "v4"
            },
            "usageStatistics": {
                "free": 68,
                "reserved": 25,
                "used": 170,
                "totalUsed": 195,
                "totalIps": 263,
                "usedPercentage": 74.14
            }
        }
    ],
    "message": "success"
}
 

Request   

GET api/servers/{server}/ipassignments/getAssignableSubnets

URL Parameters

server  integer  

The ID of the server (optional if called via GET api/virtualization/ipassignments/getAssignableSubnets).

POST api/servers/{server}/ipassignments/getAssignableIpsOfSubnet

requires authentication

Receives a list of available IPs of the subnet.

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'domain.com/api/servers/18/ipassignments/getAssignableIpsOfSubnet',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'subnets_id' => 18,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/servers/18/ipassignments/getAssignableIpsOfSubnet"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "subnets_id": 18
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
    "domain.com/api/servers/18/ipassignments/getAssignableIpsOfSubnet" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"subnets_id\": 18
}"

Request   

POST api/servers/{server}/ipassignments/getAssignableIpsOfSubnet

URL Parameters

server  integer  

The ID of the server.

Body Parameters

subnets_id  integer  

GET api/servers/{server}/ipassignments/getAssignableSubnets

requires authentication

Receives a list of subnets from which IPs can be assigned to the server. Subnets are not always available to all servers.

Alias: GET api/virtualization/ipassignments/getAssignableSubnets - used to set the subnets in VPS plans.

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/virtualization/ipassignments/getAssignableSubnets',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/virtualization/ipassignments/getAssignableSubnets"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "domain.com/api/virtualization/ipassignments/getAssignableSubnets" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200):

Show headers
cache-control: no-cache, private
content-type: application/json
referrer-policy: no-referrer
x-xss-protection: 1; mode=block
x-frame-options: DENY
x-content-type-options: nosniff
vary: Origin
 

{
    "result": [
        {
            "id": 1,
            "subnet": "10.10.10.0/24",
            "type": {
                "hasChildSubnets": 0,
                "amountOfDirectChilds": 0,
                "hasSubIps": 1,
                "amountOfSubIps": 263,
                "type": "v4"
            },
            "usageStatistics": {
                "free": 68,
                "reserved": 25,
                "used": 170,
                "totalUsed": 195,
                "totalIps": 263,
                "usedPercentage": 74.14
            }
        }
    ],
    "message": "success"
}
 

Request   

GET api/virtualization/ipassignments/getAssignableSubnets

URL Parameters

server  integer  

The ID of the server (optional if called via GET api/virtualization/ipassignments/getAssignableSubnets).

GET api/servers/{server_id}/ipassignments

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/servers/61/ipassignments',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/servers/61/ipassignments"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "domain.com/api/servers/61/ipassignments" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200):


{
    "result": [
        {
            "id": 32,
            "updated_at": "2022-10-21T19:28:25.000000Z",
            "ip": "10.10.10.30",
            "primary_ip": 1,
            "description": null,
            "ipAttributes": {
                "isIpv4": 1,
                "isIpv6": 0,
                "isSubnet": 0
            },
            "subnetinformation": {
                "subnet": "10.10.10.0",
                "netmask": "255.255.255.0",
                "gw": "10.10.10.1",
                "type": "v4",
                "rdnsAvailable": 1
            }
        }
    ],
    "message": "success"
}
 

Request   

GET api/servers/{server_id}/ipassignments

URL Parameters

server_id  integer  

The ID of the server.

POST api/servers/{server}/ipassignments

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'domain.com/api/servers/20/ipassignments',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'subnets_id' => 5,
            'ips' => [
                '10.10.10.20',
                '10.10.10.21',
            ],
            'description' => 'minus',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/servers/20/ipassignments"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "subnets_id": 5,
    "ips": [
        "10.10.10.20",
        "10.10.10.21"
    ],
    "description": "minus"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
    "domain.com/api/servers/20/ipassignments" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"subnets_id\": 5,
    \"ips\": [
        \"10.10.10.20\",
        \"10.10.10.21\"
    ],
    \"description\": \"minus\"
}"

Request   

POST api/servers/{server}/ipassignments

URL Parameters

server  integer  

The ID of the server.

Body Parameters

subnets_id  integer  

ips  string[]  

An array of IP addresses which will be assigned to the server.

description  string optional  

PUT api/servers/{server_id}/ipassignments/{id}

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->put(
    'domain.com/api/servers/61/ipassignments/0',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'description' => 'consequatur',
            'primary_ip' => false,
            'ptrRecord' => 'autem',
            'ip' => '10.10.10.30',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/servers/61/ipassignments/0"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "description": "consequatur",
    "primary_ip": false,
    "ptrRecord": "autem",
    "ip": "10.10.10.30"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request PUT \
    "domain.com/api/servers/61/ipassignments/0" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"description\": \"consequatur\",
    \"primary_ip\": false,
    \"ptrRecord\": \"autem\",
    \"ip\": \"10.10.10.30\"
}"

Request   

PUT api/servers/{server_id}/ipassignments/{id}

PATCH api/servers/{server_id}/ipassignments/{id}

URL Parameters

server_id  integer  

The ID of the server.

id  integer  

The ID of the IP assignment. However, actually the "ip" body parameter is used for identification. The id parameter must not be empty, but can be any integer or string.

Body Parameters

description  string optional  

primary_ip  boolean optional  

ptrRecord  string optional  

ip  string  

Must be a valid IP which is assigned to the server.

DELETE api/servers/{server_id}/ipassignments/{id}

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->delete(
    'domain.com/api/servers/20/ipassignments/0',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'ip' => '10.10.10.4',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/servers/20/ipassignments/0"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "ip": "10.10.10.4"
};

fetch(url, {
    method: "DELETE",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request DELETE \
    "domain.com/api/servers/20/ipassignments/0" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"ip\": \"10.10.10.4\"
}"

Request   

DELETE api/servers/{server_id}/ipassignments/{id}

URL Parameters

server_id  integer  

The ID of the server.

id  integer  

The ID of the IP assignment. However, actually the "ip" body parameter is used for identification. The id parameter must not be empty, but can be any integer or string.

Body Parameters

ip  string  

The IP which you want to delete from the server.

Server Inventory

Feature: https://documentation.tenantos.com/Tenantos/server-management/server-page/inventory/

GET api/servers/{server_id}/hwsummary

requires authentication

Summarized overview of the hardware inventory.

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/servers/61/hwsummary',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/servers/61/hwsummary"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "domain.com/api/servers/61/hwsummary" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200):


{
    "result": {
        "mainboard": {
            "model": "MAG X570 TOMAHAWK WIFI (MS-7C84)",
            "value": "1.0",
            "count": 1,
            "valueType": "text",
            "details": null
        },
        "memory": {
            "model": "CMW32GX4M2C3200C16",
            "value": 65536,
            "count": 4,
            "valueType": "mb",
            "details": null
        },
        "cpu": {
            "model": "AMD Ryzen 9 3900XT",
            "value": "2200",
            "count": 1,
            "valueType": "MHz",
            "cores": "12"
        },
        "disk": {
            "model": "multiple",
            "value": 2842540,
            "count": 4,
            "valueType": "mb",
            "details": null
        }
    },
    "message": "success"
}
 

Request   

GET api/servers/{server_id}/hwsummary

URL Parameters

server_id  integer  

The ID of the server.

GET api/servers/{server}/hwsummary/withDetails

requires authentication

More detailled summary of the hardware inventory.

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/servers/61/hwsummary/withDetails',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/servers/61/hwsummary/withDetails"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "domain.com/api/servers/61/hwsummary/withDetails" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200):


{
    "result": {
        "mainboard": {
            "model": "MAG X570 TOMAHAWK WIFI (MS-7C84)",
            "value": "1.0",
            "count": 1,
            "valueType": "text",
            "details": [
                {
                    "model": "MAG X570 TOMAHAWK WIFI (MS-7C84)",
                    "size": "1.0"
                }
            ]
        },
        "memory": {
            "model": "CMW32GX4M2C3200C16",
            "value": 65536,
            "count": 4,
            "valueType": "mb",
            "details": [
                {
                    "model": "CMH32GX4M2Z3200C16",
                    "size": "16384"
                },
                {
                    "model": "CMW32GX4M2C3200C16",
                    "size": "16384"
                },
                {
                    "model": "CMH32GX4M2Z3200C16",
                    "size": "16384"
                },
                {
                    "model": "CMW32GX4M2C3200C16",
                    "size": "16384"
                }
            ]
        },
        "cpu": {
            "model": "AMD Ryzen 9 3900XT",
            "value": "2200",
            "count": 1,
            "valueType": "MHz",
            "cores": "12"
        },
        "disk": {
            "model": "multiple",
            "value": 2842540,
            "count": 4,
            "valueType": "mb",
            "details": [
                {
                    "model": "Samsung SSD 860 EVO 500GB",
                    "size": "476940"
                },
                {
                    "model": "SanDisk SDSSDHII480G",
                    "size": "457862"
                },
                {
                    "model": "WDS100T3X0C-00SJG0",
                    "size": "953869"
                },
                {
                    "model": "WDS100T3X0C-00SJG0",
                    "size": "953869"
                }
            ]
        }
    },
    "message": "success"
}
 

Request   

GET api/servers/{server}/hwsummary/withDetails

URL Parameters

server  integer  

The ID of the server.

GET api/servers/{server}/inventory/getInventoryCommand

requires authentication

Returns a shell command which can be executed on linux servers to collect information about the server hardware without rebooting.

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/servers/1/inventory/getInventoryCommand',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/servers/1/inventory/getInventoryCommand"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "domain.com/api/servers/1/inventory/getInventoryCommand" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200):


{
    "result": "wget -qO - https://domain.com/hwdetect.sh | bash -s 'https://domain.com/api/servers/inventory/callback/40b219a00840e8a242c4bd12ec1a3f43'",
    "message": "success"
}
 

Request   

GET api/servers/{server}/inventory/getInventoryCommand

URL Parameters

server  integer  

The ID of the server.

GET api/servers/{server_id}/inventory

requires authentication

Complete list of the server hardware inventory.

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/servers/61/inventory',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/servers/61/inventory"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "domain.com/api/servers/61/inventory" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200):


{
    "result": [
        {
            "id": 12,
            "created_at": "2022-10-20T21:23:50.000000Z",
            "updated_at": "2022-10-20T21:23:50.000000Z",
            "model": "MAG X570 TOMAHAWK WIFI (MS-7C84)",
            "value": "1.0",
            "serial": "K317253975",
            "description": "",
            "server_id": 61,
            "customfields": null,
            "root_component": {
                "id": 6,
                "description": "Mainboard Model",
                "valueType": "text"
            }
        },
        {
            "id": 13,
            "created_at": "2022-10-20T21:23:50.000000Z",
            "updated_at": "2022-10-20T21:23:50.000000Z",
            "model": "American Megatrends Inc.",
            "value": "1.00",
            "serial": "04/11/2020",
            "description": "",
            "server_id": 61,
            "customfields": null,
            "root_component": {
                "id": 4,
                "description": "BIOS",
                "valueType": "text"
            }
        }
    ],
    "message": "success"
}
 

Request   

GET api/servers/{server_id}/inventory

URL Parameters

server_id  integer  

The ID of the server.

POST api/servers/{server}/inventory

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'domain.com/api/servers/10/inventory',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'model' => 'Samsung SSD 860 EVO',
            'value' => '476940',
            'serial' => 'S1Z2NB1K736669A',
            'inventorycomponent_id' => 7,
            'description' => 'Second SSD',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/servers/10/inventory"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "model": "Samsung SSD 860 EVO",
    "value": "476940",
    "serial": "S1Z2NB1K736669A",
    "inventorycomponent_id": 7,
    "description": "Second SSD"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
    "domain.com/api/servers/10/inventory" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"model\": \"Samsung SSD 860 EVO\",
    \"value\": \"476940\",
    \"serial\": \"S1Z2NB1K736669A\",
    \"inventorycomponent_id\": 7,
    \"description\": \"Second SSD\"
}"

Request   

POST api/servers/{server}/inventory

URL Parameters

server  integer  

The ID of the server.

Body Parameters

model  string optional  

value  string optional  

serial  string optional  

inventorycomponent_id  integer  

The ID of the root component.

description  string optional  

customfields  string[] optional  

An array of custom fields, if the root component has custom fields assigned.

customfields[].fieldId  integer  

customfields[].value  string  

GET api/servers/{server_id}/inventory/{id}

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/servers/61/inventory/32',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/servers/61/inventory/32"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "domain.com/api/servers/61/inventory/32" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200):


{
    "result": {
        "id": 32,
        "created_at": "2022-10-20T21:23:50.000000Z",
        "updated_at": "2022-10-20T21:23:50.000000Z",
        "model": "WDS100T3X0C-00SJG0",
        "value": "953869",
        "serial": "192306800431",
        "description": "",
        "server_id": 61,
        "customfields": [
            {
                "fieldId": 1,
                "value": "3"
            }
        ],
        "root_component": {
            "id": 7,
            "description": "Disk",
            "valueType": "mb",
            "customfields": [
                {
                    "values": []
                }
            ]
        }
    },
    "message": "success"
}
 

Request   

GET api/servers/{server_id}/inventory/{id}

URL Parameters

server_id  integer  

The ID of the server.

id  integer  

The ID of the inventory.

PUT api/servers/{server_id}/inventory/{id}

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->put(
    'domain.com/api/servers/18/inventory/tenetur',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'model' => 'Samsung SSD 860 EVO',
            'value' => '476940',
            'serial' => 'S1Z2NB1K736669A',
            'inventorycomponent_id' => 7,
            'description' => 'Second SSD',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/servers/18/inventory/tenetur"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "model": "Samsung SSD 860 EVO",
    "value": "476940",
    "serial": "S1Z2NB1K736669A",
    "inventorycomponent_id": 7,
    "description": "Second SSD"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request PUT \
    "domain.com/api/servers/18/inventory/tenetur" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"model\": \"Samsung SSD 860 EVO\",
    \"value\": \"476940\",
    \"serial\": \"S1Z2NB1K736669A\",
    \"inventorycomponent_id\": 7,
    \"description\": \"Second SSD\"
}"

Request   

PUT api/servers/{server_id}/inventory/{id}

PATCH api/servers/{server_id}/inventory/{id}

URL Parameters

server_id  integer  

The ID of the server.

id  string  

integer The ID of the inventory.

Body Parameters

model  string optional  

value  string optional  

serial  string optional  

inventorycomponent_id  integer optional  

The ID of the root component.

description  string optional  

customfields  string[] optional  

An array of custom fields, if the root component has custom fields assigned.

customfields[].fieldId  integer optional  

customfields[].value  string optional  

DELETE api/servers/{server_id}/inventory/{id}

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->delete(
    'domain.com/api/servers/14/inventory/12',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/servers/14/inventory/12"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());
curl --request DELETE \
    "domain.com/api/servers/14/inventory/12" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Request   

DELETE api/servers/{server_id}/inventory/{id}

URL Parameters

server_id  integer  

The ID of the server.

id  integer  

The ID of the inventory.

Server OS Provisioning

Feature: https://documentation.tenantos.com/Tenantos/server-management/server-page/reinstallation-rescue/

POST api/servers/{server}/provisioning/startReinstallation

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'domain.com/api/servers/19/provisioning/startReinstallation',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'profileId' => 1,
            'rootpassword' => 'secretpassword',
            'disklayoutId' => 1,
            'runScripts' => [
                1,
                2,
            ],
            'userprovidedDiskLayout' => 'autopart --type=lvm',
            'hostname' => 'my.hostname.com',
            'sshkeys' => [
                'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCPMKW3XDPL0k257n8IBrmJrhSTOfczRjD5V5nou8uYCg1HJHnaCtdgPPdCQPfg5jYVKP5MCsgFBbfCWXv8GgDZAI905Yel46ZcRBkC0JKVkkc53I+wS/zmwfxXzvkV6GRbCISnc1n98+wE4z+Qtg9FV+VAhJzinTCYFo9TV7hwkz7V5e+pj9/5NgfVbFy0H8B2aXqp1F6A7ENBXNrbejXdTyo3lVIq1/tHKfv6mcVmR4b4w7EVI4bvDMDdHeEKfMCvDUG359ElVp7gla5M0kohCCWtgLSchR/6NTEIa6rAFhsmCHCfIE6q959Ff+KUR40e8yzulZtp3NPu8ukUjJtkBA5c4lAE2UUNldyqkWiE8sWAr+GlMjU0UkB3xzB0ID53EKH93WoIapjAnpDYxah8dOdyfk2cSmkdSe8DFNLeWffi8j3Ea9XeCQnMa/VTcSarspnCKL8RG5LL8vGy//0Cs6QXQDn/gCTR2McTPbiiks2sFVWCaIIbgkTs9fGFuhM= root',
            ],
            'configure_all_ipvfour' => true,
            'configure_all_ipvsix' => true,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/servers/19/provisioning/startReinstallation"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "profileId": 1,
    "rootpassword": "secretpassword",
    "disklayoutId": 1,
    "runScripts": [
        1,
        2
    ],
    "userprovidedDiskLayout": "autopart --type=lvm",
    "hostname": "my.hostname.com",
    "sshkeys": [
        "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCPMKW3XDPL0k257n8IBrmJrhSTOfczRjD5V5nou8uYCg1HJHnaCtdgPPdCQPfg5jYVKP5MCsgFBbfCWXv8GgDZAI905Yel46ZcRBkC0JKVkkc53I+wS\/zmwfxXzvkV6GRbCISnc1n98+wE4z+Qtg9FV+VAhJzinTCYFo9TV7hwkz7V5e+pj9\/5NgfVbFy0H8B2aXqp1F6A7ENBXNrbejXdTyo3lVIq1\/tHKfv6mcVmR4b4w7EVI4bvDMDdHeEKfMCvDUG359ElVp7gla5M0kohCCWtgLSchR\/6NTEIa6rAFhsmCHCfIE6q959Ff+KUR40e8yzulZtp3NPu8ukUjJtkBA5c4lAE2UUNldyqkWiE8sWAr+GlMjU0UkB3xzB0ID53EKH93WoIapjAnpDYxah8dOdyfk2cSmkdSe8DFNLeWffi8j3Ea9XeCQnMa\/VTcSarspnCKL8RG5LL8vGy\/\/0Cs6QXQDn\/gCTR2McTPbiiks2sFVWCaIIbgkTs9fGFuhM= root"
    ],
    "configure_all_ipvfour": true,
    "configure_all_ipvsix": true
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
    "domain.com/api/servers/19/provisioning/startReinstallation" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"profileId\": 1,
    \"rootpassword\": \"secretpassword\",
    \"disklayoutId\": 1,
    \"runScripts\": [
        1,
        2
    ],
    \"userprovidedDiskLayout\": \"autopart --type=lvm\",
    \"hostname\": \"my.hostname.com\",
    \"sshkeys\": [
        \"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCPMKW3XDPL0k257n8IBrmJrhSTOfczRjD5V5nou8uYCg1HJHnaCtdgPPdCQPfg5jYVKP5MCsgFBbfCWXv8GgDZAI905Yel46ZcRBkC0JKVkkc53I+wS\\/zmwfxXzvkV6GRbCISnc1n98+wE4z+Qtg9FV+VAhJzinTCYFo9TV7hwkz7V5e+pj9\\/5NgfVbFy0H8B2aXqp1F6A7ENBXNrbejXdTyo3lVIq1\\/tHKfv6mcVmR4b4w7EVI4bvDMDdHeEKfMCvDUG359ElVp7gla5M0kohCCWtgLSchR\\/6NTEIa6rAFhsmCHCfIE6q959Ff+KUR40e8yzulZtp3NPu8ukUjJtkBA5c4lAE2UUNldyqkWiE8sWAr+GlMjU0UkB3xzB0ID53EKH93WoIapjAnpDYxah8dOdyfk2cSmkdSe8DFNLeWffi8j3Ea9XeCQnMa\\/VTcSarspnCKL8RG5LL8vGy\\/\\/0Cs6QXQDn\\/gCTR2McTPbiiks2sFVWCaIIbgkTs9fGFuhM= root\"
    ],
    \"configure_all_ipvfour\": true,
    \"configure_all_ipvsix\": true
}"

Request   

POST api/servers/{server}/provisioning/startReinstallation

URL Parameters

server  integer  

The ID of the server.

Body Parameters

profileId  integer  

The OS profile ID.

rootpassword  string  

Must be at least 8 characters.

disklayoutId  integer optional  

The ID of the disk layout.

runScripts  string[] optional  

Array of script IDs which will be executed after installation.

userprovidedDiskLayout  string optional  

Overrides the default disk layout with a custom provided layout.

hostname  string optional  

Must be a valid hostname and not be greater than 255 characters.

sshkeys  string[] optional  

An array of SSH keys.

configure_all_ipvfour  boolean optional  

configure_all_ipvsix  boolean optional  

GET api/servers/{server}/provisioning/stopReinstallation

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/servers/61/provisioning/stopReinstallation',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/servers/61/provisioning/stopReinstallation"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "domain.com/api/servers/61/provisioning/stopReinstallation" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200):

Show headers
cache-control: no-cache, private
content-type: application/json
referrer-policy: no-referrer
x-xss-protection: 1; mode=block
x-frame-options: DENY
x-content-type-options: nosniff
vary: Origin
 

{
    "result": "ok",
    "message": "success"
}
 

Request   

GET api/servers/{server}/provisioning/stopReinstallation

URL Parameters

server  integer  

The ID of the server.

withoutPowerReset  integer optional  

By default, aborting an installation will trigger a power reset. Setting this parameter to 1 doesn't reset the server.

GET api/servers/{server}/provisioning/getInstallStatus

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/servers/1/provisioning/getInstallStatus',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/servers/1/provisioning/getInstallStatus"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "domain.com/api/servers/1/provisioning/getInstallStatus" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200):

Show headers
cache-control: no-cache, private
content-type: application/json
referrer-policy: no-referrer
x-xss-protection: 1; mode=block
x-frame-options: DENY
x-content-type-options: nosniff
vary: Origin
 

{
    "result": {
        "running": 0,
        "completed": 1,
        "step": 3
    },
    "message": "success"
}
 

Request   

GET api/servers/{server}/provisioning/getInstallStatus

URL Parameters

server  integer  

The ID of the server.

GET api/servers/{server}/provisioning/executePostCommand

requires authentication

With some providers (e.g. OVH), a post action can be executed after the installation is complete. In the case of OVH, the post action is to request the credentials (for SSH, etc.) after the installation has been completed.

This endpoint is not used for PXE based installations.

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/servers/1/provisioning/executePostCommand',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/servers/1/provisioning/executePostCommand"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "domain.com/api/servers/1/provisioning/executePostCommand" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200):


{
    "result": {
        "postTask": [
            {
                "type": "SSH",
                "url": "ssh://ns2353152.ip-34-144-0.eu",
                "username": "root",
                "password": "EH9HMSQ22gfvsjIQ2",
                "serverMainIp": "34.144.0.0"
            }
        ]
    },
    "message": "success"
}
 

Request   

GET api/servers/{server}/provisioning/executePostCommand

URL Parameters

server  integer  

The ID of the server.

GET api/servers/{server}/provisioning/getProfiles

requires authentication

Returns a list of installable operating systems for the server. The list also contains the rescue systems (see isRescue).

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/servers/61/provisioning/getProfiles',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/servers/61/provisioning/getProfiles"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "domain.com/api/servers/61/provisioning/getProfiles" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200):


{
    "result": [
        {
            "id": 1,
            "name": "CentOS 7",
            "disklayouts": [
                {
                    "id": 2,
                    "name": "Auto RAID"
                },
                {
                    "id": 4,
                    "name": "RAID 1"
                },
                {
                    "id": 5,
                    "name": "RAID 5"
                },
                {
                    "id": 6,
                    "name": "RAID 10"
                },
                {
                    "id": 7,
                    "name": "RAID 0"
                }
            ],
            "scripts": [
                {
                    "id": 2,
                    "name": "Install Nextcloud"
                }
            ],
            "isRescue": 0,
            "features": {
                "follow_install_progress": 1,
                "allow_ssh_keys": 1,
                "allow_set_hostname": 1,
                "set_root_password": 1
            },
            "default_disklayout_template": 2,
            "default_run_scripts": [
                1
            ],
            "groupname": "CentOS",
            "grouplogo": "/storage/oslogos/centos.svg"
        }
    ],
    "message": "success"
}
 

Request   

GET api/servers/{server}/provisioning/getProfiles

URL Parameters

server  integer  

The ID of the server.

Server Power

Feature: https://documentation.tenantos.com/Tenantos/server-management/server-page/server-page/#power-management

GET api/servers/{server}/power/{serverPowerMethod}

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/servers/1/power/setPowerOn',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'params' => 'unde',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/servers/1/power/setPowerOn"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "params": "unde"
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request GET \
    --get "domain.com/api/servers/1/power/setPowerOn" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"params\": \"unde\"
}"

Example response (200):

Show headers
cache-control: no-cache, private
content-type: application/json
referrer-policy: no-referrer
x-xss-protection: 1; mode=block
x-frame-options: DENY
x-content-type-options: nosniff
vary: Origin
 

{
    "result": "executed",
    "message": "success"
}
 

Request   

GET api/servers/{server}/power/{serverPowerMethod}

POST api/servers/{server}/power/{serverPowerMethod}

URL Parameters

server  integer  

The ID of the server.

serverPowerMethod  string  

The power method. Must be one of powerprovider.supportedFeatures (see GET api/servers/{id}).

Body Parameters

method  null optional  

params  string optional  

This field is required when serverPowerMethod is setBootType. For IPMI, the value can be pxe, disk, bios and other supported flags (Google: "ipmi bootdev"). For virtual servers, pxe and disk is supported.

POST api/servers/{server}/bmc/executeCommand

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'domain.com/api/servers/9/bmc/executeCommand',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'command' => 'chassis status',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/servers/9/bmc/executeCommand"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "command": "chassis status"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
    "domain.com/api/servers/9/bmc/executeCommand" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"command\": \"chassis status\"
}"

Example response (200):


{
    "result": "System Power         : on\nPower Overload       : false\nPower Interlock      : inactive\nMain Power Fault     : false\nPower Control Fault  : false\nPower Restore Policy : always-off\nLast Power Event     : \nChassis Intrusion    : inactive\nFront-Panel Lockout  : inactive\nDrive Fault          : false\nCooling/Fan Fault    : false",
    "message": "success"
}
 

Request   

POST api/servers/{server}/bmc/executeCommand

URL Parameters

server  integer  

The ID of the server.

Body Parameters

command  string  

The BMC command.

Server Ressources (VM)

GET api/servers/{server_id}/vm

requires authentication

Receive the current virtual server resources.

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/servers/2/vm',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/servers/2/vm"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "domain.com/api/servers/2/vm" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200):


{
    "result": {
        "cpu": {
            "cores": 2,
            "sockets": 2,
            "cpulimit": "128",
            "cpuunits": ""
        },
        "disks": [
            {
                "size": "32",
                "name": "local:2017/vm-2017-disk-1.qcow2,discard=on,size=32G",
                "id": "scsi0"
            }
        ],
        "memory": {
            "memory": 3400,
            "balloon": ""
        }
    },
    "message": "success"
}
 

Request   

GET api/servers/{server_id}/vm

URL Parameters

server_id  integer  

The ID of the server.

PUT api/servers/{server_id}/vm

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->put(
    'domain.com/api/servers/2/vm',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'cpu' => [
                'cores' => '2',
                'sockets' => '2',
                'cpulimit' => '128',
                'cpuunits' => '',
            ],
            'disks' => [
                [
                    'size' => '32',
                    'name' => 'local:2017/vm-2017-disk-1.qcow2,discard=on,size=32G',
                    'id' => 'scsi0',
                ],
            ],
            'memory' => [
                'memory' => 3400,
                'balloon' => '',
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/servers/2/vm"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "cpu": {
        "cores": "2",
        "sockets": "2",
        "cpulimit": "128",
        "cpuunits": ""
    },
    "disks": [
        {
            "size": "32",
            "name": "local:2017\/vm-2017-disk-1.qcow2,discard=on,size=32G",
            "id": "scsi0"
        }
    ],
    "memory": {
        "memory": 3400,
        "balloon": ""
    }
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request PUT \
    "domain.com/api/servers/2/vm" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"cpu\": {
        \"cores\": \"2\",
        \"sockets\": \"2\",
        \"cpulimit\": \"128\",
        \"cpuunits\": \"\"
    },
    \"disks\": [
        {
            \"size\": \"32\",
            \"name\": \"local:2017\\/vm-2017-disk-1.qcow2,discard=on,size=32G\",
            \"id\": \"scsi0\"
        }
    ],
    \"memory\": {
        \"memory\": 3400,
        \"balloon\": \"\"
    }
}"

Request   

PUT api/servers/{server_id}/vm

URL Parameters

server_id  integer  

The ID of the server.

Body Parameters

The request body is an array (object`), representing the new configuration of the VM. The available keys differ for each virtualization type (Proxmox, VMware).

To update the resources by changing the VPS plan, send a request with following body: { "planId": ID }.

Server Statistics

Feature: https://documentation.tenantos.com/Tenantos/server-management/server-page/server-page/#statistics

POST api/servers/{server}/stats/network/{statsMode}

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'domain.com/api/servers/3/stats/network/text',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'from' => '2022-11-15T15:16:15',
            'to' => '2022-11-15T15:16:15',
            'predefined' => '1h',
            'user_id' => 20,
            'groupBy' => '1mo',
            'summary' => true,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/servers/3/stats/network/text"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "from": "2022-11-15T15:16:15",
    "to": "2022-11-15T15:16:15",
    "predefined": "1h",
    "user_id": 20,
    "groupBy": "1mo",
    "summary": true
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
    "domain.com/api/servers/3/stats/network/text" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"from\": \"2022-11-15T15:16:15\",
    \"to\": \"2022-11-15T15:16:15\",
    \"predefined\": \"1h\",
    \"user_id\": 20,
    \"groupBy\": \"1mo\",
    \"summary\": true
}"

Request   

POST api/servers/{server}/stats/network/{statsMode}

URL Parameters

server  integer  

The ID of the server.

statsMode  string  

Must be one of graph, or text. "graph" does return values for a graph (5 minute interval), "text" returns a summary for each day.

Body Parameters

from  string optional  

Must be a valid date.

to  string optional  

Must be a valid date.

predefined  string optional  

Must be one of today, 1h, 24h, 14days, 30days, or all.

user_id  integer optional  

groupBy  string optional  

Must be one of 1mo. Does add a summarized array to each port with a summary of the stats array. Does also contain information about 95th percentile usage. If from and to are within different months, an array for each month will be given back. Resource-intensive parameter.

summary  boolean optional  

Does add a summary array with an aggregated summary of all assigned network ports. Does also contain information about 95th percentile usage. 95th percentile stats are not just summed, but the top 5% of all values are removed. If from and to are within different months, an array for each month will be given back. Resource-intensive parameter.

POST api/servers/{server}/stats/ipmi/{statsMode}

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'domain.com/api/servers/17/stats/ipmi/text',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'predefined' => '14days',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/servers/17/stats/ipmi/text"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "predefined": "14days"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
    "domain.com/api/servers/17/stats/ipmi/text" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"predefined\": \"14days\"
}"

Request   

POST api/servers/{server}/stats/ipmi/{statsMode}

URL Parameters

server  integer  

The ID of the server.

statsMode  string  

Must be one of graph, or text. As of now, graph and text returns the same values. This behavior may change in the future. If detailed information is required, graph mode is recommended.

Body Parameters

from  string optional  

to  string optional  

predefined  string optional  

Must be one of today, 24h, 14days, 30days, or all.

Subnet Management

Feature: https://documentation.tenantos.com/Tenantos/ip-manager/add-subnets/

GET api/subnets/{subnetId}/withDetails

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/subnets/1/withDetails',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/subnets/1/withDetails"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "domain.com/api/subnets/1/withDetails" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200):


{
    "result": {
        "id": 1,
        "subnet": "10.10.10.0",
        "cidr": 24,
        "netmask": "255.255.255.0",
        "gw": "10.10.10.1",
        "type": "v4",
        "priority": null,
        "reserved": 0,
        "offer_if_server_has_tag": [],
        "dont_offer_if_server_has_tag": [],
        "only_if_server_has_remote_agents": [],
        "apply_restrictions_to_childs": 0,
        "rdnsAvailable": 1,
        "rdnsServerId": 1,
        "usageStatistics": {
            "free": 68,
            "reserved": 30,
            "used": 158,
            "totalIps": 256,
            "usedPercentage": 73.44
        },
        "description": null,
        "subnetAttributes": {
            "hasChildSubnets": 0,
            "amountOfDirectChilds": 0,
            "hasSubIps": 1,
            "amountOfSubIps": 256,
            "type": "v4"
        },
        "ips": [
            {
                "ip": "10.10.10.99",
                "reserved": 0,
                "servers_id": 1,
                "description": null,
                "servers_owner_realname": "Beaulah Erdman",
                "servers_owner_id": 10,
                "servername": "host01",
                "rdns_entry": "myrdns.com"
            },
            {
                "...": "..."
            }
        ],
        "childSubnets": []
    },
    "message": "success"
}
 

Request   

GET api/subnets/{subnetId}/withDetails

URL Parameters

subnetId  integer  

The ID of the subnet.

POST api/subnets/{subnetId}/split

requires authentication

Split a subnet into smaller parts. Only available for IPv6.

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'domain.com/api/subnets/20/split',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'mode' => 'subnet',
            'toPrefix' => 64,
            'gateway_method' => 'first',
            'toAmount' => 100,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/subnets/20/split"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "mode": "subnet",
    "toPrefix": 64,
    "gateway_method": "first",
    "toAmount": 100
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
    "domain.com/api/subnets/20/split" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"mode\": \"subnet\",
    \"toPrefix\": 64,
    \"gateway_method\": \"first\",
    \"toAmount\": 100
}"

Request   

POST api/subnets/{subnetId}/split

URL Parameters

subnetId  integer  

The ID of the subnet.

Body Parameters

mode  string  

Must be one of subnet or singleIps. subnet does create child subnets, singleIps creates IP addresses out of the subnet.

toPrefix  integer optional  

This field is required when mode is subnet. The target prefix size.

gateway_method  string optional  

This field is required when mode is subnet. Must be one of first, last, or custom.

gateway_custom  string optional  

This field is required when gateway_method is custom.

toAmount  integer  

The amount of subnets / IPs to create.

GET api/subnets/{subnetId}/listFreeIps

requires authentication

Returns a list of available IPs (unassigned, not reserved).

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/subnets/1/listFreeIps',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/subnets/1/listFreeIps"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "domain.com/api/subnets/1/listFreeIps" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200):


{
    "result": [
        {
            "id": 33,
            "ip": "10.10.10.31"
        },
        {
            "...": "..."
        }
    ],
    "message": "success"
}
 

Request   

GET api/subnets/{subnetId}/listFreeIps

URL Parameters

subnetId  integer  

The ID of the subnet.

GET api/subnets

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/subnets',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/subnets"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "domain.com/api/subnets" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200):


{
    "result": [
        {
            "id": 1,
            "subnet": "10.10.10.0",
            "cidr": 24,
            "netmask": "255.255.255.0",
            "gw": "10.10.10.1",
            "type": "v4",
            "priority": null,
            "reserved": 0,
            "offer_if_server_has_tag": [],
            "dont_offer_if_server_has_tag": [],
            "only_if_server_has_remote_agents": [],
            "apply_restrictions_to_childs": 0,
            "rdnsAvailable": 1,
            "rdnsServerId": 1,
            "usageStatistics": {
                "free": 68,
                "reserved": 30,
                "used": 158,
                "totalIps": 256,
                "usedPercentage": 73.44
            },
            "description": null,
            "subnetAttributes": {
                "hasChildSubnets": 0,
                "amountOfDirectChilds": 0,
                "hasSubIps": 1,
                "amountOfSubIps": 256,
                "type": "v4"
            }
        },
        {
            "id": 2,
            "subnet": "64:ff9b:2::",
            "cidr": 48,
            "netmask": "",
            "gw": "64:ff9b:2::1",
            "type": "v6",
            "priority": null,
            "reserved": 0,
            "offer_if_server_has_tag": [],
            "dont_offer_if_server_has_tag": [],
            "only_if_server_has_remote_agents": [],
            "apply_restrictions_to_childs": 0,
            "rdnsAvailable": 0,
            "rdnsServerId": null,
            "usageStatistics": {
                "free": 0,
                "reserved": 0,
                "used": 0,
                "totalIps": 0,
                "usedPercentage": 0
            },
            "description": null,
            "subnetAttributes": {
                "hasChildSubnets": 0,
                "amountOfDirectChilds": 0,
                "hasSubIps": 0,
                "amountOfSubIps": 0,
                "type": "v6"
            }
        }
    ],
    "message": "success"
}
 

Request   

GET api/subnets

POST api/subnets

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'domain.com/api/subnets',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'subnet' => '10.10.11.0',
            'cidr' => 24,
            'netmask' => '255.255.255.0',
            'gw' => '10.10.11.1',
            'type' => 'v4',
            'offer_if_server_has_tag' => [
                'cum',
            ],
            'dont_offer_if_server_has_tag' => [
                'qui',
            ],
            'only_if_server_has_remote_agents' => [
                11,
            ],
            'dns_resolvers' => [
                '1.1.1.1',
                '1.0.0.1',
                '8.8.8.8',
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/subnets"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "subnet": "10.10.11.0",
    "cidr": 24,
    "netmask": "255.255.255.0",
    "gw": "10.10.11.1",
    "type": "v4",
    "offer_if_server_has_tag": [
        "cum"
    ],
    "dont_offer_if_server_has_tag": [
        "qui"
    ],
    "only_if_server_has_remote_agents": [
        11
    ],
    "dns_resolvers": [
        "1.1.1.1",
        "1.0.0.1",
        "8.8.8.8"
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
    "domain.com/api/subnets" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"subnet\": \"10.10.11.0\",
    \"cidr\": 24,
    \"netmask\": \"255.255.255.0\",
    \"gw\": \"10.10.11.1\",
    \"type\": \"v4\",
    \"offer_if_server_has_tag\": [
        \"cum\"
    ],
    \"dont_offer_if_server_has_tag\": [
        \"qui\"
    ],
    \"only_if_server_has_remote_agents\": [
        11
    ],
    \"dns_resolvers\": [
        \"1.1.1.1\",
        \"1.0.0.1\",
        \"8.8.8.8\"
    ]
}"

Request   

POST api/subnets

Body Parameters

subnet  string  

Must be a valid IP address (network address).

cidr  integer  

The CIDR notation.

netmask  string  

The netmask.

gw  string  

The gateway IP.

type  string  

Must be one of v4 or v6.

description  string optional  

Subnet description.

priority  integer optional  

Subnet priority. Used for virtual server provisioning.

offer_if_server_has_tag  string[] optional  

dont_offer_if_server_has_tag  string[] optional  

only_if_server_has_remote_agents  integer[] optional  

dns_resolvers  string[] optional  

An unique array of IPv4 and/or IPv6 addresses. If not empty, a minimum of two is required and a maximum of three allowed. Defaults to Google DNS.

GET api/subnets/{id}

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/subnets/1',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/subnets/1"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "domain.com/api/subnets/1" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200):

Show headers
cache-control: no-cache, private
content-type: application/json
referrer-policy: no-referrer
x-xss-protection: 1; mode=block
x-frame-options: DENY
x-content-type-options: nosniff
vary: Origin
 

{
    "result": {
        "id": 1,
        "subnet": "10.10.10.0",
        "cidr": 24,
        "netmask": "255.255.255.0",
        "gw": "10.10.10.1",
        "type": "v4",
        "priority": null,
        "reserved": 0,
        "offer_if_server_has_tag": [],
        "dont_offer_if_server_has_tag": [],
        "only_if_server_has_remote_agents": [],
        "apply_restrictions_to_childs": 0,
        "dns_resolvers": [
            "1.1.1.1",
            "1.0.0.1"
        ],
        "rdnsAvailable": 1,
        "rdnsServerId": 1,
        "usageStatistics": {
            "free": 68,
            "reserved": 25,
            "used": 170,
            "totalIps": 263,
            "usedPercentage": 74.14
        },
        "description": null,
        "subnetAttributes": {
            "hasChildSubnets": 0,
            "amountOfDirectChilds": 0,
            "hasSubIps": 1,
            "amountOfSubIps": 263,
            "type": "v4"
        }
    },
    "message": "success"
}
 

Request   

GET api/subnets/{id}

URL Parameters

id  integer  

The ID of the subnet.

PUT api/subnets/{id}

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->put(
    'domain.com/api/subnets/11',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'gw' => '124.223.192.132',
            'description' => 'ad',
            'priority' => 15,
            'offer_if_server_has_tag' => [
                'voluptatem',
            ],
            'dont_offer_if_server_has_tag' => [
                'assumenda',
            ],
            'only_if_server_has_remote_agents' => [
                2,
            ],
            'dns_resolvers' => [
                '1.1.1.1',
                '1.0.0.1',
                '8.8.8.8',
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/subnets/11"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "gw": "124.223.192.132",
    "description": "ad",
    "priority": 15,
    "offer_if_server_has_tag": [
        "voluptatem"
    ],
    "dont_offer_if_server_has_tag": [
        "assumenda"
    ],
    "only_if_server_has_remote_agents": [
        2
    ],
    "dns_resolvers": [
        "1.1.1.1",
        "1.0.0.1",
        "8.8.8.8"
    ]
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request PUT \
    "domain.com/api/subnets/11" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"gw\": \"124.223.192.132\",
    \"description\": \"ad\",
    \"priority\": 15,
    \"offer_if_server_has_tag\": [
        \"voluptatem\"
    ],
    \"dont_offer_if_server_has_tag\": [
        \"assumenda\"
    ],
    \"only_if_server_has_remote_agents\": [
        2
    ],
    \"dns_resolvers\": [
        \"1.1.1.1\",
        \"1.0.0.1\",
        \"8.8.8.8\"
    ]
}"

Request   

PUT api/subnets/{id}

PATCH api/subnets/{id}

URL Parameters

id  integer  

The ID of the subnet.

Body Parameters

gw  string optional  

Must be a valid IP address.

description  string optional  

priority  integer optional  

offer_if_server_has_tag  string[] optional  

dont_offer_if_server_has_tag  string[] optional  

only_if_server_has_remote_agents  integer[] optional  

dns_resolvers  string[] optional  

An unique array of IPv4 and/or IPv6 addresses. If not empty, a minimum of two is required and a maximum of three allowed.

DELETE api/subnets/{id}

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->delete(
    'domain.com/api/subnets/11',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/subnets/11"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());
curl --request DELETE \
    "domain.com/api/subnets/11" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Request   

DELETE api/subnets/{id}

URL Parameters

id  integer  

The ID of the subnet.

System Logs

Feature: https://documentation.tenantos.com/Tenantos/logs/system-logs/

GET api/servers/{server_id}/activitylog

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/servers/16/activitylog',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/servers/16/activitylog"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "domain.com/api/servers/16/activitylog" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200):


{
    "result": [
        {
            "id": 1812,
            "userId": "1",
            "relationId": "1",
            "relationType": "servers",
            "rootId": "1",
            "rootType": "serverPower",
            "description": "Executed Power Action setPowerOff",
            "modelchanges": [],
            "userIp": "192.168.22.59",
            "visibleFor": "all",
            "loglevel": "info",
            "postdata": "",
            "created_at": "2022-10-21T16:56:21.000000Z",
            "updated_at": "2022-10-21T16:56:21.000000Z",
            "endpoint": "/api/servers/1/power/setPowerOff",
            "method": "GET",
            "requestSource": "web",
            "userDetails": {
                "username": "adm",
                "name": "Mrs. Adelia Murphy",
                "id": 1
            },
            "meta": {
                "href": "/servers/1",
                "text": "server-01"
            }
        }
    ],
    "message": "success"
}
 

Request   

GET api/servers/{server_id}/activitylog

URL Parameters

server_id  integer  

The ID of the server.

GET api/activitylog/user

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/activitylog/user',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/activitylog/user"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "domain.com/api/activitylog/user" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200):


{
    "result": [
        {
            "id": 2262,
            "userId": "1",
            "relationId": "",
            "relationType": "",
            "rootId": "1",
            "rootType": "subnet",
            "description": "Updated Subnet 10.10.10.0",
            "modelchanges": {
                "only_if_server_has_remote_agents": {
                    "original": [
                        1
                    ],
                    "changes": "[]"
                }
            },
            "userIp": "192.168.155.48",
            "visibleFor": "all",
            "loglevel": "info",
            "postdata": "{\"only_if_server_has_remote_agents\":[]}",
            "created_at": "2022-10-21T17:58:19.000000Z",
            "updated_at": "2022-10-21T17:58:19.000000Z",
            "endpoint": "/api/subnets/1",
            "method": "PUT",
            "requestSource": "web",
            "userDetails": {
                "username": "adm",
                "name": "Mrs. Adelia Murphy",
                "id": 1
            },
            "meta": {
                "text": "ID: 1"
            }
        }
    ],
    "message": "success"
}
 

Request   

GET api/activitylog/user

URL Parameters

limit  integer optional  

Limit the returned results.

GET api/activitylog/agents/{agentId?}

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/activitylog/agents/12',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/activitylog/agents/12"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "domain.com/api/activitylog/agents/12" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200):


{
    "result": [
        {
            "id": 7950,
            "userId": "system",
            "relationId": "",
            "relationType": "",
            "rootId": "1",
            "rootType": "servers",
            "description": "Aborted PXE provisioning",
            "modelchanges": "[]",
            "userIp": "-",
            "visibleFor": "admin",
            "loglevel": "info",
            "postdata": "\"\"",
            "created_at": "2022-10-21 16:56:18",
            "updated_at": "2022-10-21 16:56:18",
            "agentId": 1,
            "agentName": "Local Agent",
            "userDetails": {
                "username": "System",
                "name": "system",
                "id": "System"
            },
            "meta": {
                "href": "/servers/1",
                "text": "server-001"
            }
        }
    ],
    "message": "success"
}
 

Request   

GET api/activitylog/agents/{agentId?}

URL Parameters

agentId  integer optional  

optional The ID of the agent.

limit  integer optional  

Limit the returned results.

GET api/activitylog/system

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/activitylog/system',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/activitylog/system"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "domain.com/api/activitylog/system" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200):


{
    "result": [
        {
            "id": 1810,
            "userId": "system",
            "relationId": "",
            "relationType": "",
            "rootId": "1",
            "rootType": "agents",
            "description": "Regenerated DHCP Configuration",
            "modelchanges": [],
            "userIp": "-",
            "visibleFor": "admin",
            "loglevel": "info",
            "postdata": "",
            "created_at": "2022-10-21T16:56:19.000000Z",
            "updated_at": "2022-10-21T16:56:19.000000Z",
            "endpoint": "/api/servers/1/provisioning/stopReinstallation",
            "method": "GET",
            "requestSource": "web",
            "userDetails": {
                "username": "System",
                "name": "system",
                "id": "System"
            },
            "meta": {
                "href": "",
                "text": ""
            }
        }
    ],
    "message": "success"
}
 

Request   

GET api/activitylog/system

URL Parameters

limit  integer optional  

Limit the returned results.

System Settings

Feature: https://documentation.tenantos.com/Tenantos/system-settings/behaviour/

GET api/system/globalSystemSettings

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/system/globalSystemSettings',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/system/globalSystemSettings"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "domain.com/api/system/globalSystemSettings" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200):


{
    "result": [
        {
            "id": 2,
            "setting": "delete_rdns_entry_when_delete_ip",
            "value": "on",
            "created_at": "2022-10-21T09:43:03.000000Z",
            "updated_at": "2022-10-21T09:43:03.000000Z"
        },
        {
            "...": "..."
        }
    ],
    "message": "success"
}
 

Request   

GET api/system/globalSystemSettings

GET api/system/globalSystemSettings/{settingname}

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/system/globalSystemSettings/default_datetime_format',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/system/globalSystemSettings/default_datetime_format"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "domain.com/api/system/globalSystemSettings/default_datetime_format" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200):

Show headers
cache-control: no-cache, private
content-type: application/json
referrer-policy: no-referrer
x-xss-protection: 1; mode=block
x-frame-options: DENY
x-content-type-options: nosniff
vary: Origin
 

{
    "result": "DD.MM.YYYY HH:mm:ss",
    "message": "success"
}
 

Request   

GET api/system/globalSystemSettings/{settingname}

URL Parameters

settingname  string  

The name of the setting.

PUT api/system/globalSystemSettings

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->put(
    'domain.com/api/system/globalSystemSettings',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'settings' => [
                [
                    'delete_rdns_entry_when_delete_ip' => 'off',
                ],
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/system/globalSystemSettings"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "settings": [
        {
            "delete_rdns_entry_when_delete_ip": "off"
        }
    ]
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request PUT \
    "domain.com/api/system/globalSystemSettings" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"settings\": [
        {
            \"delete_rdns_entry_when_delete_ip\": \"off\"
        }
    ]
}"

Request   

PUT api/system/globalSystemSettings

Body Parameters

settings  object  

Key value array of settings.

Users

Feature: https://documentation.tenantos.com/Tenantos/users/manage-users/

GET api/user

requires authentication

Receive information about the current logged in user.

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/user',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/user"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "domain.com/api/user" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200):


{
    "id": 1,
    "name": "Dr. Eva Flatley",
    "timezone": "Europe/Berlin",
    "datetimeFormat": "DD.MM.YYYY HH:mm:ss",
    "darkmode": null,
    "sshkeys": [],
    "prefs": [],
    "currentIp": "10.12.13.14",
    "permissions": [
        "system.version",
        "system.apiOutput.param.app_version",
        "..."
    ]
}
 

Request   

GET api/user

GET api/impersonate/{impersonateUserId}/start

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/impersonate/2/start',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/impersonate/2/start"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "domain.com/api/impersonate/2/start" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200):

Show headers
cache-control: no-cache, private
content-type: application/json
referrer-policy: no-referrer
x-xss-protection: 1; mode=block
x-frame-options: DENY
x-content-type-options: nosniff
vary: Origin
 

{
    "message": "success"
}
 

Request   

GET api/impersonate/{impersonateUserId}/start

URL Parameters

impersonateUserId  integer  

The user ID which you want to impersonate.

GET api/impersonate/{impersonateUserId}/stop

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/impersonate/2/stop',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/impersonate/2/stop"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "domain.com/api/impersonate/2/stop" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200):


{
    "message": "success"
}
 

Request   

GET api/impersonate/{impersonateUserId}/stop

URL Parameters

impersonateUserId  integer  

Stop impersonating the user ID.

GET api/users/{user}/tokens

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/users/1/tokens',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/users/1/tokens"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "domain.com/api/users/1/tokens" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200):

Show headers
cache-control: no-cache, private
content-type: application/json
referrer-policy: no-referrer
x-xss-protection: 1; mode=block
x-frame-options: DENY
x-content-type-options: nosniff
vary: Origin
 

{
    "result": [
        {
            "id": 1,
            "name": "WHMCS",
            "created_at": "2022-03-27T10:24:42.000000Z",
            "last_used": null,
            "allowedHosts": []
        },
        {
            "id": 2,
            "name": "Docs auth",
            "created_at": "2022-10-27T06:48:44.000000Z",
            "last_used": null,
            "allowedHosts": []
        }
    ],
    "message": "success"
}
 

Request   

GET api/users/{user}/tokens

URL Parameters

user  integer  

The ID of the user.

POST api/users/{user}/tokens

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'domain.com/api/users/4/tokens',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => 'doloribus',
            'allowedHosts' => [
                '10.10.12.10',
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/users/4/tokens"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "doloribus",
    "allowedHosts": [
        "10.10.12.10"
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
    "domain.com/api/users/4/tokens" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"doloribus\",
    \"allowedHosts\": [
        \"10.10.12.10\"
    ]
}"

Request   

POST api/users/{user}/tokens

URL Parameters

user  integer  

The ID of the user.

Body Parameters

name  string  

allowedHosts  string[] optional  

Must be an array of valid IP addresses. Usage will be restricted to the specified IPs. Leave empty to allow all IPs.

GET api/users/{user}/tokens/{id}

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/users/1/tokens/2',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/users/1/tokens/2"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "domain.com/api/users/1/tokens/2" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200):

Show headers
cache-control: no-cache, private
content-type: application/json
referrer-policy: no-referrer
x-xss-protection: 1; mode=block
x-frame-options: DENY
x-content-type-options: nosniff
vary: Origin
 

{
    "result": {
        "id": 1,
        "name": "WHMCS",
        "created_at": "2022-03-27T10:24:42.000000Z",
        "last_used": null,
        "allowedHosts": []
    },
    "message": "success"
}
 

Request   

GET api/users/{user}/tokens/{id}

URL Parameters

user  integer  

The ID of the user.

id  integer  

The ID of the token.

DELETE api/users/{user}/tokens/{id}

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->delete(
    'domain.com/api/users/19/tokens/15',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/users/19/tokens/15"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());
curl --request DELETE \
    "domain.com/api/users/19/tokens/15" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Request   

DELETE api/users/{user}/tokens/{id}

URL Parameters

user  integer  

The ID of the user.

id  integer  

The ID of the token.

GET api/users/{user}/sshkeys

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/users/1/sshkeys',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/users/1/sshkeys"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "domain.com/api/users/1/sshkeys" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200):

Show headers
cache-control: no-cache, private
content-type: application/json
referrer-policy: no-referrer
x-xss-protection: 1; mode=block
x-frame-options: DENY
x-content-type-options: nosniff
vary: Origin
 

{
    "result": [
        {
            "id": 1,
            "created_at": "2022-11-15T15:16:14.000000Z",
            "name": "Ansible",
            "pubkey": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCPMKW3XDPL0k257n8IBrmJrhSTOfczRjD5V5nou8uYCg1HJHnaCtdgPPdCQPfg5jYVKP5MCsgFBbfCWXv8GgDZAI905Yel46ZcRBkC0JKVkkc53I+wS/zmwfxXzvkV6GRbCISnc1n98+wE4z+Qtg9FV+VAhJzinTCYFo9TV7hwkz7V5e+pj9/5NgfVbFy0H8B2aXqp1F6A7ENBXNrbejXdTyo3lVIq1/tHKfv6mcVmR4b4w7EVI4bvDMDdHeEKfMCvDUG359ElVp7gla5M0kohCCWtgLSchR/6NTEIa6rAFhsmCHCfIE6q959Ff+KUR40e8yzulZtp3NPu8ukUjJtkBA5c4lAE2UUNldyqkWiE8sWAr+GlMjU0UkB3xzB0ID53EKH93WoIapjAnpDYxah8dOdyfk2cSmkdSe8DFNLeWffi8j3Ea9XeCQnMa/VTcSarspnCKL8RG5LL8vGy//0Cs6QXQDn/gCTR2McTPbiiks2sFVWCaIIbgkTs9fGFuhM= root@ansible",
            "userid": 1,
            "description": "Ansible SSH Key"
        }
    ],
    "message": "success"
}
 

Request   

GET api/users/{user}/sshkeys

URL Parameters

user  integer  

The ID of the user.

POST api/users/{user}/sshkeys

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'domain.com/api/users/6/sshkeys',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => 'iusto',
            'pubkey' => 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCPMKW3XDPL0k257n8IBrmJrhSTOfczRjD5V5nou8uYCg1HJHnaCtdgPPdCQPfg5jYVKP5MCsgFBbfCWXv8GgDZAI905Yel46ZcRBkC0JKVkkc53I+wS/zmwfxXzvkV6GRbCISnc1n98+wE4z+Qtg9FV+VAhJzinTCYFo9TV7hwkz7V5e+pj9/5NgfVbFy0H8B2aXqp1F6A7ENBXNrbejXdTyo3lVIq1/tHKfv6mcVmR4b4w7EVI4bvDMDdHeEKfMCvDUG359ElVp7gla5M0kohCCWtgLSchR/6NTEIa6rAFhsmCHCfIE6q959Ff+KUR40e8yzulZtp3NPu8ukUjJtkBA5c4lAE2UUNldyqkWiE8sWAr+GlMjU0UkB3xzB0ID53EKH93WoIapjAnpDYxah8dOdyfk2cSmkdSe8DFNLeWffi8j3Ea9XeCQnMa/VTcSarspnCKL8RG5LL8vGy//0Cs6QXQDn/gCTR2McTPbiiks2sFVWCaIIbgkTs9fGFuhM=',
            'description' => 'ipsam',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/users/6/sshkeys"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "iusto",
    "pubkey": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCPMKW3XDPL0k257n8IBrmJrhSTOfczRjD5V5nou8uYCg1HJHnaCtdgPPdCQPfg5jYVKP5MCsgFBbfCWXv8GgDZAI905Yel46ZcRBkC0JKVkkc53I+wS\/zmwfxXzvkV6GRbCISnc1n98+wE4z+Qtg9FV+VAhJzinTCYFo9TV7hwkz7V5e+pj9\/5NgfVbFy0H8B2aXqp1F6A7ENBXNrbejXdTyo3lVIq1\/tHKfv6mcVmR4b4w7EVI4bvDMDdHeEKfMCvDUG359ElVp7gla5M0kohCCWtgLSchR\/6NTEIa6rAFhsmCHCfIE6q959Ff+KUR40e8yzulZtp3NPu8ukUjJtkBA5c4lAE2UUNldyqkWiE8sWAr+GlMjU0UkB3xzB0ID53EKH93WoIapjAnpDYxah8dOdyfk2cSmkdSe8DFNLeWffi8j3Ea9XeCQnMa\/VTcSarspnCKL8RG5LL8vGy\/\/0Cs6QXQDn\/gCTR2McTPbiiks2sFVWCaIIbgkTs9fGFuhM=",
    "description": "ipsam"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
    "domain.com/api/users/6/sshkeys" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"iusto\",
    \"pubkey\": \"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCPMKW3XDPL0k257n8IBrmJrhSTOfczRjD5V5nou8uYCg1HJHnaCtdgPPdCQPfg5jYVKP5MCsgFBbfCWXv8GgDZAI905Yel46ZcRBkC0JKVkkc53I+wS\\/zmwfxXzvkV6GRbCISnc1n98+wE4z+Qtg9FV+VAhJzinTCYFo9TV7hwkz7V5e+pj9\\/5NgfVbFy0H8B2aXqp1F6A7ENBXNrbejXdTyo3lVIq1\\/tHKfv6mcVmR4b4w7EVI4bvDMDdHeEKfMCvDUG359ElVp7gla5M0kohCCWtgLSchR\\/6NTEIa6rAFhsmCHCfIE6q959Ff+KUR40e8yzulZtp3NPu8ukUjJtkBA5c4lAE2UUNldyqkWiE8sWAr+GlMjU0UkB3xzB0ID53EKH93WoIapjAnpDYxah8dOdyfk2cSmkdSe8DFNLeWffi8j3Ea9XeCQnMa\\/VTcSarspnCKL8RG5LL8vGy\\/\\/0Cs6QXQDn\\/gCTR2McTPbiiks2sFVWCaIIbgkTs9fGFuhM=\",
    \"description\": \"ipsam\"
}"

Request   

POST api/users/{user}/sshkeys

URL Parameters

user  integer  

The ID of the user.

Body Parameters

name  string  

pubkey  string  

The public SSH key.