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 or if you're unsure which API endpoint to use, perform the action through the Tenantos interface and check the requests in the development tools of your browser. The Tenantos web interface uses the same API, checking these requests will help you determine the correct parameters and endpoints.

Base URL

domain.com

Authenticating requests

This API is authenticated 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.

Impersonate Accounts via API
By adding the impersonateUserId HTTP header to API requests, the request will be executed over the specified user ID. Using the impersonateClientIp header, it's possible to override the IP which is shown in the API and activity log.

Brands

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

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

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'domain.com/api/system/brands/dolorem/logos/store',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'multipart/form-data',
            'Accept' => 'application/json',
        ],
        'multipart' => [
            [
                'name' => 'lightlogo',
                'contents' => fopen('/tmp/phpeUQAbx', 'r')
            ],
            [
                'name' => 'darklogo',
                'contents' => fopen('/tmp/phpFuhT3u', 'r')
            ],
            [
                'name' => 'favicon',
                'contents' => fopen('/tmp/php4LdXBv', 'r')
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/system/brands/dolorem/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/dolorem/logos/store" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: multipart/form-data" \
    --header "Accept: application/json" \
    --form "lightlogo=@/tmp/phpeUQAbx" \
    --form "darklogo=@/tmp/phpFuhT3u" \
    --form "favicon=@/tmp/php4LdXBv" 

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/qui/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/qui/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/qui/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  

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-us": {
                        "common_table_nodata_reload": "No data available. Reload?",
                        "...": "..."
                    }
                }
            ],
            "navbar_text_instead_logo": 0,
            "navbar_logo_always_dark": 1,
            "loginpage_text_instead_logo": 0,
            "loginpage_logo_always_dark": 0,
            "loginpage_logo_above_form": 0,
            "loginpage_show_text_within_form": 0,
            "navbar_logo_max_height": 30,
            "loginpage_logo_max_height": 40,
            "theme_flat_buttons": 0,
            "theme_cards_elevation": 3,
            "theme_cards_outlined": 0,
            "theme_top_bar_full_length": 0,
            "theme_serverpage_notes_importantNotes_showOnTop": 0,
            "availableLanguages": [
                {
                    "languageName": "English",
                    "languageCode": "en-us"
                }
            ],
            "defaultColorScheme": {
                "light": {
                    "primary": "#0C47A0",
                    "...": "..."
                },
                "dark": {
                    "primary": "#536DFE",
                    "...": "..."
                }
            },
            "logos": {
                "favicon": {
                    "publicPath": "/storage/brands/1/logos/favicon_673930630b2c9.png"
                },
                "lightlogo": {
                    "publicPath": "/storage/brands/1/logos/lightlogo_3e6ed656923ef.png"
                },
                "darklogo": {
                    "publicPath": "/storage/brands/1/logos/darklogo_e4c15c2d3b6e5.png"
                }
            }
        }
    ],
    "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-us": {
                    "common_table_nodata_reload": "No data available. Reload?",
                    "...": "..."
                }
            }
        ],
        "navbar_text_instead_logo": 0,
        "navbar_logo_always_dark": 1,
        "loginpage_text_instead_logo": 0,
        "loginpage_logo_always_dark": 0,
        "loginpage_logo_above_form": 0,
        "loginpage_show_text_within_form": 0,
        "navbar_logo_max_height": 30,
        "loginpage_logo_max_height": 40,
        "theme_flat_buttons": 0,
        "theme_cards_elevation": 3,
        "theme_cards_outlined": 0,
        "theme_top_bar_full_length": 0,
        "theme_serverpage_notes_importantNotes_showOnTop": 0,
        "availableLanguages": [
            {
                "languageName": "English",
                "languageCode": "en-us"
            }
        ],
        "defaultColorScheme": {
            "light": {
                "primary": "#0C47A0",
                "...": "..."
            },
            "dark": {
                "primary": "#536DFE",
                "...": "..."
            }
        },
        "logos": {
            "favicon": {
                "publicPath": "/storage/brands/1/logos/favicon_673930630b2c9.png"
            },
            "lightlogo": {
                "publicPath": "/storage/brands/1/logos/lightlogo_3e6ed656923ef.png"
            },
            "darklogo": {
                "publicPath": "/storage/brands/1/logos/darklogo_e4c15c2d3b6e5.png"
            }
        }
    },
    "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/11',
    [
        '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' => 16,
            'languageOverrides' => [
                'en-us' => [
                    'common_table_nodata_reload' => 'No data available. Reload?',
                ],
            ],
            'navbar_text_instead_logo' => false,
            'navbar_logo_always_dark' => true,
            'loginpage_text_instead_logo' => false,
            'loginpage_logo_always_dark' => false,
            'loginpage_logo_above_form' => false,
            'loginpage_show_text_within_form' => true,
            'navbar_logo_max_height' => 12,
            'loginpage_logo_max_height' => 15,
            'theme_flat_buttons' => false,
            'theme_cards_elevation' => 13,
            'theme_cards_outlined' => false,
            'theme_top_bar_full_length' => false,
            'theme_serverpage_notes_importantNotes_showOnTop' => true,
            'availableLanguages' => [
                [
                    'languageName' => 'xlfwtv',
                    'languageCode' => 'wn',
                ],
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/system/brands/11"
);

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": 16,
    "languageOverrides": {
        "en-us": {
            "common_table_nodata_reload": "No data available. Reload?"
        }
    },
    "navbar_text_instead_logo": false,
    "navbar_logo_always_dark": true,
    "loginpage_text_instead_logo": false,
    "loginpage_logo_always_dark": false,
    "loginpage_logo_above_form": false,
    "loginpage_show_text_within_form": true,
    "navbar_logo_max_height": 12,
    "loginpage_logo_max_height": 15,
    "theme_flat_buttons": false,
    "theme_cards_elevation": 13,
    "theme_cards_outlined": false,
    "theme_top_bar_full_length": false,
    "theme_serverpage_notes_importantNotes_showOnTop": true,
    "availableLanguages": [
        {
            "languageName": "xlfwtv",
            "languageCode": "wn"
        }
    ]
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request PUT \
    "domain.com/api/system/brands/11" \
    --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\": 16,
    \"languageOverrides\": {
        \"en-us\": {
            \"common_table_nodata_reload\": \"No data available. Reload?\"
        }
    },
    \"navbar_text_instead_logo\": false,
    \"navbar_logo_always_dark\": true,
    \"loginpage_text_instead_logo\": false,
    \"loginpage_logo_always_dark\": false,
    \"loginpage_logo_above_form\": false,
    \"loginpage_show_text_within_form\": true,
    \"navbar_logo_max_height\": 12,
    \"loginpage_logo_max_height\": 15,
    \"theme_flat_buttons\": false,
    \"theme_cards_elevation\": 13,
    \"theme_cards_outlined\": false,
    \"theme_top_bar_full_length\": false,
    \"theme_serverpage_notes_importantNotes_showOnTop\": true,
    \"availableLanguages\": [
        {
            \"languageName\": \"xlfwtv\",
            \"languageCode\": \"wn\"
        }
    ]
}"

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  

theme_cards_elevation  integer optional  

Must be at least 0. Must not be greater than 25.

theme_cards_outlined  boolean optional  

theme_top_bar_full_length  boolean optional  

theme_serverpage_notes_importantNotes_showOnTop  boolean optional  

availableLanguages  object[] optional  

availableLanguages[].languageName  string  

Must not be greater than 50 characters.

availableLanguages[].languageCode  string  

Must not be greater than 10 characters.

DELETE api/system/brands/{id}

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->delete(
    'domain.com/api/system/brands/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/system/brands/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/system/brands/16" \
    --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.

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,
            "isStandaloneRdnsProvider": [],
            "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' => 'gthost',
            '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": "gthost",
    "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\": \"gthost\",
    \"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, hetznerdedicated, vmwarevsphere, ovhdedicated, novoserve, mylocdedicated, innov4web, tailormadeservers, gthost, reliablesite, tenantos, or generic.

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"
                    }
                ]
            },
            "haGroups": [
                {
                    "group": "ha-group-ceph-1",
                    "comment": "Ceph nodes"
                },
                {
                    "group": "ha-group-nfs-1",
                    "comment": "NFS, only for dev"
                }
            ]
        },
        "nodeResources": {
            "host01": {
                "cpuCores": 8,
                "cpuUtil": 0.0133663366336634,
                "maxMem": 33523425280,
                "usedMem": 25098756096,
                "freeMem": 8424669184,
                "memUsagePercentage": 74.8693067201992,
                "uptime": 54516143,
                "status": "online"
            },
            "host02": {
                "cpuCores": 8,
                "cpuUtil": 0.510303390007536,
                "maxMem": 67213066240,
                "usedMem": 43491606528,
                "freeMem": 23721459712,
                "memUsagePercentage": 64.70707105178482,
                "uptime": 54137712,
                "status": "online"
            }
        },
        "availableVpsBalancerPlans": [
            {
                "id": 1,
                "created_at": "2023-05-03T21:11:53.000000Z",
                "updated_at": "2023-05-03T21:11:53.000000Z",
                "planname": "Balancer #1",
                "cpuPriority": 2,
                "cpuRequireIdlePercentage": 30,
                "storagePriority": 1,
                "storageReserveFreeAmount": 20,
                "ramPriority": 1.5,
                "ramReserveFreeAmount": 10,
                "vmCountPriority": 1,
                "vmMaxAmount": 50,
                "nodeMustMatchRegex": "/^node[0-9]+$/",
                "nodeMustNotMatchRegex": "/^gluster[0-9]+$/"
            }
        ],
        "isStandaloneRdnsProvider": [],
        "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/13',
    [
        '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/13"
);

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/13" \
    --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/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/externalProviders/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/externalProviders/8" \
    --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.

Files

To some objects files can be attached (e.g. server comments). This endpoint is used to download and delete these files.

GET api/files/{fileId}/download

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/files/est/download',
    [
        '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/files/est/download"
);

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/files/est/download" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (500):

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": "Exception",
    "result": "Access to this file denied or file not found."
}
 

Request   

GET api/files/{fileId}/download

URL Parameters

fileId  string  

DELETE api/files/{fileId}

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->delete(
    'domain.com/api/files/ex',
    [
        '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/files/ex"
);

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/files/ex" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Request   

DELETE api/files/{fileId}

URL Parameters

fileId  string  

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, unreserve, delete.

ips  string[]  

An array of IPs or subnets with CIDR 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 or a subnet with CIDR.

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 or a subnet with CIDR.

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 or a subnet with CIDR.

type  string  

Must be one of singleIp or subnet.

DELETE api/ip/delete

requires authentication

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

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

let body = {
    "adminIp": "deserunt",
    "type": "subnet"
};

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

Request   

DELETE api/ip/delete

Body Parameters

adminIp  string  

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/13',
    [
        '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/13"
);

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/13" \
    --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": "2024-09-04T13:05:37.000000Z",
            "updated_at": "2024-09-04T13:05:37.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": "2024-09-04T13:05:37.000000Z",
            "updated_at": "2024-09-04T13:05:37.000000Z",
            "componentname": "memory",
            "description": "RAM",
            "notdeletable": 1,
            "groupname": "Hardware",
            "valueType": "mb",
            "customfieldsRelations": [],
            "customfields": []
        },
        {
            "id": 3,
            "created_at": "2024-09-04T13:05:37.000000Z",
            "updated_at": "2024-09-04T13:05:37.000000Z",
            "componentname": "system",
            "description": "System",
            "notdeletable": 1,
            "groupname": "Hardware",
            "valueType": "text",
            "customfieldsRelations": [],
            "customfields": []
        },
        {
            "id": 4,
            "created_at": "2024-09-04T13:05:37.000000Z",
            "updated_at": "2024-09-04T13:05:37.000000Z",
            "componentname": "bios",
            "description": "BIOS",
            "notdeletable": 1,
            "groupname": "Hardware",
            "valueType": "text",
            "customfieldsRelations": [],
            "customfields": []
        },
        {
            "id": 5,
            "created_at": "2024-09-04T13:05:37.000000Z",
            "updated_at": "2024-09-04T13:05:37.000000Z",
            "componentname": "storage_controller",
            "description": "Storage Controller",
            "notdeletable": 1,
            "groupname": "Hardware",
            "valueType": "text",
            "customfieldsRelations": [],
            "customfields": []
        },
        {
            "id": 6,
            "created_at": "2024-09-04T13:05:37.000000Z",
            "updated_at": "2024-09-04T13:05:37.000000Z",
            "componentname": "mainboard",
            "description": "Mainboard Model",
            "notdeletable": 1,
            "groupname": "Hardware",
            "valueType": "text",
            "customfieldsRelations": [],
            "customfields": []
        },
        {
            "id": 7,
            "created_at": "2024-09-04T13:05:37.000000Z",
            "updated_at": "2024-09-04T13:06:00.000000Z",
            "componentname": "disk",
            "description": "Disk",
            "notdeletable": 1,
            "groupname": "Hardware",
            "valueType": "mib",
            "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": "2024-09-04T13:05:37.000000Z",
            "updated_at": "2024-09-04T13:05:37.000000Z",
            "componentname": "nic",
            "description": "NIC",
            "notdeletable": 1,
            "groupname": "Hardware",
            "valueType": "text",
            "customfieldsRelations": [],
            "customfields": []
        },
        {
            "id": 9,
            "created_at": "2024-09-04T13:06:00.000000Z",
            "updated_at": "2024-09-04T13:06:00.000000Z",
            "componentname": "raid_controller",
            "description": "RAID Controller",
            "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": "2024-09-04T13:05:37.000000Z",
        "updated_at": "2024-09-04T13:05:37.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/20',
    [
        '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/20"
);

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/20" \
    --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/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/inventorycomponents/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/inventorycomponents/16" \
    --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/7/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/7/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/7/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):


{
    "id": 1,
    "name": "EX3200",
    "host": "192.168.188.223",
    "deviceType": "snmp_switch",
    "snmpCommunity": "Aks8gkjsa8a2",
    "snmpVersion": "2c",
    "agentId": 1,
    "features": [
        "bw_collection"
    ],
    "meta": {
        "cachePorts": true
    },
    "username": "",
    "password": "",
    "port": null,
    "statusCache": [],
    "snmpAuthAlgo": null,
    "snmpAuthLevel": null,
    "snmpCryptoAlgo": null,
    "snmpCryptoPassword": "",
    "enableAdvancedManagement": 1,
    "managementVendor": "juniperSsh",
    "managementPort": "22",
    "managementUser": "root",
    "managementPassword": "secret",
    "rootType": "snmp_switch",
    "extendedDetailsAvailable": true
}
 

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' => 'quibusdam',
            'host' => 'switch01.domain.com',
            'snmpCommunity' => 'sed',
            'snmpVersion' => '2c',
            'enableAdvancedManagement' => true,
            'managementVendor' => 'ducimus',
            'managementPort' => 44216,
            'managementUser' => 'aliquid',
            'managementPassword' => 'aut',
            '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": "quibusdam",
    "host": "switch01.domain.com",
    "snmpCommunity": "sed",
    "snmpVersion": "2c",
    "enableAdvancedManagement": true,
    "managementVendor": "ducimus",
    "managementPort": 44216,
    "managementUser": "aliquid",
    "managementPassword": "aut",
    "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\": \"quibusdam\",
    \"host\": \"switch01.domain.com\",
    \"snmpCommunity\": \"sed\",
    \"snmpVersion\": \"2c\",
    \"enableAdvancedManagement\": true,
    \"managementVendor\": \"ducimus\",
    \"managementPort\": 44216,
    \"managementUser\": \"aliquid\",
    \"managementPassword\": \"aut\",
    \"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, apcCpdu, racktivityEnergySwitch, racktivityPowerManager, cyberpowerAts, cyberpowerEpdu2, dellrPdu, enlogicv1, intertechSw, intertechSm, azepdu, raritanDominionSX, raritanDominionKXII, raritanDominionKXIII, sentry4, 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, apcCpdu, racktivityEnergySwitch, racktivityPowerManager, cyberpowerAts, cyberpowerEpdu2, dellrPdu, enlogicv1, intertechSw, intertechSm, azepdu, sentry4, or ipoman.

snmpVersion  string optional  

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

snmpAuthAlgo  string optional  

Must be one of SHA, SHA-224, SHA-256, SHA-384, SHA-512, or MD5. Only used if SNMP v3 is used.

snmpAuthLevel  string optional  

Must be one of noAuthNoPriv, authNoPriv, or authPriv. Only used if SNMP v3 is used.

snmpCryptoAlgo  string optional  

Must be one of AES or DES. Only used if SNMP v3 is used.

snmpCryptoPassword  string optional  

The SNMP v3 crypto password. Only used if SNMP v3 is used.

enableAdvancedManagement  boolean optional  

managementVendor  string optional  

managementPort  integer optional  

Must be between 0 and 65535.

managementUser  string optional  

managementPassword  string optional  

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": 3,
        "name": "EdgeSwitch WZ",
        "host": "192.168.188.215",
        "deviceType": "snmp_switch",
        "snmpCommunity": "secret",
        "snmpVersion": "2c",
        "agentId": 1,
        "features": [
            "bw_collection"
        ],
        "meta": {
            "cachePorts": true
        },
        "username": "",
        "password": "",
        "port": null,
        "statusCache": [],
        "snmpAuthAlgo": null,
        "snmpAuthLevel": null,
        "snmpCryptoAlgo": null,
        "snmpCryptoPassword": "",
        "enableAdvancedManagement": null,
        "managementVendor": null,
        "managementPort": null,
        "managementUser": "",
        "managementPassword": "",
        "ports": [
            {
                "id": 1,
                "name": "GigabitEthernet1",
                "assignments": []
            },
            {
                "id": 1007,
                "name": "LAG8",
                "assignments": []
            }
        ],
        "rootType": "snmp_switch",
        "extendedDetailsAvailable": true
    },
    "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/9',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'deviceType' => 'snmp_switch',
            'name' => 'et',
            'host' => 'switch01.domain.com',
            'snmpCommunity' => 'sed',
            'snmpVersion' => '2c',
            'enableAdvancedManagement' => true,
            'managementVendor' => 'expedita',
            'managementPort' => 40968,
            'managementUser' => 'non',
            'managementPassword' => 'inventore',
            '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/9"
);

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

let body = {
    "deviceType": "snmp_switch",
    "name": "et",
    "host": "switch01.domain.com",
    "snmpCommunity": "sed",
    "snmpVersion": "2c",
    "enableAdvancedManagement": true,
    "managementVendor": "expedita",
    "managementPort": 40968,
    "managementUser": "non",
    "managementPassword": "inventore",
    "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/9" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"deviceType\": \"snmp_switch\",
    \"name\": \"et\",
    \"host\": \"switch01.domain.com\",
    \"snmpCommunity\": \"sed\",
    \"snmpVersion\": \"2c\",
    \"enableAdvancedManagement\": true,
    \"managementVendor\": \"expedita\",
    \"managementPort\": 40968,
    \"managementUser\": \"non\",
    \"managementPassword\": \"inventore\",
    \"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, apcCpdu, racktivityEnergySwitch, racktivityPowerManager, cyberpowerAts, cyberpowerEpdu2, dellrPdu, sentry4, enlogicv1, intertechSw, intertechSm, azepdu, raritanDominionSX, raritanDominionKXII, raritanDominionKXIII, 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, apcCpdu, racktivityEnergySwitch, racktivityPowerManager, cyberpowerAts, cyberpowerEpdu2, dellrPdu, enlogicv1, intertechSw, intertechSm, azepdu, sentry4, or ipoman.

snmpAuthAlgo  string optional  

Must be one of SHA, SHA-224, SHA-256, SHA-384, SHA-512, or MD5. Only used if SNMP v3 is used.

snmpAuthLevel  string optional  

Must be one of noAuthNoPriv, authNoPriv, or authPriv. Only used if SNMP v3 is used.

snmpCryptoAlgo  string optional  

Must be one of AES or DES. Only used if SNMP v3 is used.

snmpCryptoPassword  string optional  

The SNMP v3 crypto password. Only used if SNMP v3 is used.

snmpVersion  string optional  

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

enableAdvancedManagement  boolean optional  

managementVendor  string optional  

managementPort  integer optional  

Must be between 0 and 65535.

managementUser  string optional  

managementPassword  string optional  

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/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: "DELETE",
    headers,
}).then(response => response.json());
curl --request DELETE \
    "domain.com/api/networkDevices/2" \
    --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.

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

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'domain.com/api/networkDevices/1/actions/getFeatures',
    [
        '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/1/actions/getFeatures"
);

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/networkDevices/1/actions/getFeatures" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200):


{
    "result": {
        "clearCache": {
            "requestBody": []
        },
        "getFeatures": {
            "requestBody": []
        },
        "getStatistics": {
            "requestBody": {
                "portIds": {
                    "type": "array",
                    "required": false,
                    "example": [
                        "1",
                        "2",
                        "3"
                    ]
                },
                "mode": {
                    "type": "string",
                    "required": false,
                    "example": "text or graph"
                },
                "groupBy": {
                    "type": "string",
                    "required": false,
                    "example": "1d"
                },
                "from": {
                    "type": "datetime",
                    "required": false,
                    "example": "2024-08-02 09:12:27"
                },
                "to": {
                    "type": "datetime",
                    "required": false,
                    "example": "2024-09-02 09:12:27"
                }
            }
        },
        "setPortEnabled": {
            "requestBody": {
                "portId": {
                    "type": "string",
                    "required": true,
                    "example": "ge-0/0/1"
                }
            }
        },
        "setPortDisabled": {
            "requestBody": {
                "portId": {
                    "type": "string",
                    "required": true,
                    "example": "ge-0/0/1"
                }
            }
        },
        "setInterfaceDescription": {
            "requestBody": {
                "portId": {
                    "type": "string",
                    "required": true,
                    "example": "ge-0/0/1"
                },
                "description": {
                    "type": "string",
                    "required": true,
                    "example": "Uplink to core switch"
                }
            }
        },
        "deleteVlanFromInterface": {
            "requestBody": {
                "portId": {
                    "type": "string",
                    "required": true,
                    "example": "ge-0/0/1"
                },
                "vlanId": {
                    "type": "integer",
                    "required": true,
                    "example": 100
                }
            }
        },
        "updateInterface": {
            "requestBody": {
                "portId": {
                    "type": "string",
                    "required": true,
                    "example": "ge-0/0/1"
                },
                "portAdminStatus": {
                    "type": "string",
                    "required": false,
                    "example": "enabled"
                },
                "trunkNativeVlan": {
                    "type": "string",
                    "required": false,
                    "example": "0"
                },
                "trunkVlans": {
                    "type": "array",
                    "required": false,
                    "example": [
                        10,
                        20,
                        30
                    ]
                },
                "accessVlan": {
                    "type": "string",
                    "required": false,
                    "example": "0"
                },
                "description": {
                    "type": "string",
                    "required": false,
                    "example": "Uplink to core switch"
                }
            }
        },
        "updateVlan": {
            "requestBody": {
                "id": {
                    "type": "string|integer",
                    "required": true,
                    "example": "30"
                },
                "name": {
                    "type": "string",
                    "required": false,
                    "example": "vlan30"
                },
                "l3Ips": {
                    "type": "array",
                    "required": false,
                    "example": [
                        "10.10.10.1/24",
                        "10.10.11.1/24"
                    ]
                }
            }
        },
        "createVlan": {
            "requestBody": {
                "id": {
                    "type": "string|integer",
                    "required": true,
                    "example": "30"
                },
                "name": {
                    "type": "string",
                    "required": true,
                    "example": "vlan30"
                },
                "l3Ips": {
                    "type": "array",
                    "required": false,
                    "example": [
                        "10.10.10.1/24",
                        "10.10.11.1/24"
                    ]
                }
            }
        },
        "getActionLogs": {
            "requestBody": []
        }
    },
    "message": "success"
}
 

Request   

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

URL Parameters

networkDevice  integer optional  

The ID of the network device.

networkDeviceAction  string optional  

The action to execute. Use getFeatures to see the available actions. The features depend on the network device type.

GET api/networkDevices/{networkDevice}/extendedDetails

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/networkDevices/et/extendedDetails',
    [
        '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/et/extendedDetails"
);

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/et/extendedDetails" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200):


{
    "result": {
        "id": 2,
        "created_at": "2024-09-01T22:11:49.000000Z",
        "updated_at": "2024-09-01T22:11:49.000000Z",
        "name": "USG 3G",
        "host": "192.168.188.1",
        "deviceType": "snmp_switch",
        "snmpCommunity": "secret",
        "snmpVersion": "2c",
        "agentId": 1,
        "features": [
            "bw_collection"
        ],
        "meta": {
            "cachePorts": true
        },
        "username": "",
        "password": "",
        "port": null,
        "statusCache": {
            "content": {
                "success": 1,
                "result": "EdgeOS v4.4.57.5578372.230112.0823"
            },
            "time": 1725264053
        },
        "snmpAuthAlgo": null,
        "snmpAuthLevel": null,
        "snmpCryptoAlgo": null,
        "snmpCryptoPassword": "",
        "enableAdvancedManagement": null,
        "managementVendor": null,
        "managementPort": null,
        "managementUser": "",
        "managementPassword": "",
        "ports": [
            {
                "id": 1,
                "name": "lo",
                "assignments": []
            },
            {
                "id": 2,
                "name": "eth0",
                "assignments": [
                    {
                        "type": "server",
                        "relId": 2,
                        "connectionId": 25
                    },
                    {
                        "type": "server",
                        "relId": 61,
                        "connectionId": 26
                    }
                ]
            }
        ],
        "extendedDetails": {
            "ports": [
                {
                    "name": "lo",
                    "portOperStatus": "1",
                    "portAdminStatus": "1",
                    "description": "lo",
                    "alias": "lo",
                    "linkSpeed": "10",
                    "ifType": "24",
                    "id": 1,
                    "assignments": []
                },
                {
                    "name": "eth0",
                    "portOperStatus": "1",
                    "portAdminStatus": "1",
                    "description": "eth0",
                    "alias": "WAN",
                    "linkSpeed": "1000",
                    "ifType": "6",
                    "id": 2,
                    "assignments": [
                        {
                            "type": "server",
                            "relId": 2,
                            "connectionId": 25
                        },
                        {
                            "type": "server",
                            "relId": 61,
                            "connectionId": 26
                        }
                    ]
                }
            ],
            "advancedManagementAvailable": 0
        },
        "rootType": "snmp_switch",
        "extendedDetailsAvailable": true
    },
    "message": "success"
}
 

Request   

GET api/networkDevices/{networkDevice}/extendedDetails

URL Parameters

networkDevice  string  

The networkDevice.

id  integer  

The ID of the network device.

Others

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.31",
        "app_changelog_link": "https://documentation.tenantos.com/changelog/Tenantos/",
        "updateAvailable": 0,
        "updateVersion": "1.0.31"
    },
    "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/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/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": "04.09.2024 13:06:12"
        },
        {
            "format": "DD/MM/YYYY HH:mm:ss",
            "example": "04/09/2024 13:06:12"
        },
        {
            "format": "DD-MM-YYYY HH:mm:ss",
            "example": "04-09-2024 13:06:12"
        },
        {
            "format": "MM.DD.YYYY HH:mm:ss",
            "example": "09.04.2024 13:06:12"
        },
        {
            "format": "MM/DD/YYYY HH:mm:ss",
            "example": "09/04/2024 13:06:12"
        },
        {
            "format": "MM-DD-YYYY HH:mm:ss",
            "example": "09-04-2024 13:06:12"
        },
        {
            "format": "YYYY.MM.DD HH:mm:ss",
            "example": "2024.09.04 13:06:12"
        },
        {
            "format": "YYYY/MM/DD HH:mm:ss",
            "example": "2024/09/04 13:06:12"
        },
        {
            "format": "YYYY-MM-DD HH:mm:ss",
            "example": "2024-09-04 13:06:12"
        }
    ],
    "message": "success"
}
 

Request   

GET api/system/listTimeDateFormats

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",
        "precheck_networkgraph_show_summary": "off",
        "networkgraphs_show_total_p95th_line": "off",
        "password_hide_ipmipass": "show",
        "ui_users_allow_power_actions_during_pxe_boot": "off",
        "ui_admins_allow_power_actions_during_pxe_boot": "off"
    },
    "message": "success"
}
 

Request   

GET api/system/settingsAfterLogin

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-us": {
            "common_table_nodata_reload": "No data available. Reload?",
            "common_table_placeholder_search": "Search...",
            "...": "..."
        }
    },
    "message": "success"
}
 

Request   

GET api/system/ui/uiLanguage

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/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": "730acc4f301b3a72329b947f2c90810f4dbde511666cfd0a97cb5cbd3a8cea8d"
    },
    "message": "success"
}
 

Request   

GET api/system/ui/version

PXE Basic Operations

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

requires authentication

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

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

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

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

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/1/duplicate',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => 'sint',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/pxe/scripts/1/duplicate"
);

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

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

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

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/19/duplicate',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => 'soluta',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/pxe/disklayouts/19/duplicate"
);

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

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

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

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  

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.

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": [],
            "offer_if_user_has_role": [],
            "dont_offer_if_user_has_role": [],
            "allow_for_vps": 1,
            "allow_for_dedicated": 1
        },
        {
            "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": [],
            "offer_if_user_has_role": [],
            "dont_offer_if_user_has_role": [],
            "allow_for_vps": 1,
            "allow_for_dedicated": 1
        }
    ],
    "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' => [
                'kickstart',
            ],
            'disklayout' => 'autopart --type=lvm',
            'name' => 'et',
            'min_disks' => 3,
            'isDisabled' => false,
            'offer_if_has_tag' => [
                'dicta',
            ],
            'dont_offer_if_has_tag' => [
                'nostrum',
            ],
            'offer_if_user_has_role' => [
                null,
            ],
            'dont_offer_if_user_has_role' => [
                null,
            ],
            'allow_for_vps' => true,
            'allow_for_dedicated' => false,
            'hw_raid_handling' => 'always_offer',
        ],
    ]
);
$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": [
        "kickstart"
    ],
    "disklayout": "autopart --type=lvm",
    "name": "et",
    "min_disks": 3,
    "isDisabled": false,
    "offer_if_has_tag": [
        "dicta"
    ],
    "dont_offer_if_has_tag": [
        "nostrum"
    ],
    "offer_if_user_has_role": [
        null
    ],
    "dont_offer_if_user_has_role": [
        null
    ],
    "allow_for_vps": true,
    "allow_for_dedicated": false,
    "hw_raid_handling": "always_offer"
};

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\": [
        \"kickstart\"
    ],
    \"disklayout\": \"autopart --type=lvm\",
    \"name\": \"et\",
    \"min_disks\": 3,
    \"isDisabled\": false,
    \"offer_if_has_tag\": [
        \"dicta\"
    ],
    \"dont_offer_if_has_tag\": [
        \"nostrum\"
    ],
    \"offer_if_user_has_role\": [
        null
    ],
    \"dont_offer_if_user_has_role\": [
        null
    ],
    \"allow_for_vps\": true,
    \"allow_for_dedicated\": false,
    \"hw_raid_handling\": \"always_offer\"
}"

Request   

POST api/pxe/disklayouts

Body Parameters

tags  string[]  

Must have at least 1 item. The disk layout is linked to the operating systems via tags.

disklayout  string optional  

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  

offer_if_user_has_role  string[] optional  

dont_offer_if_user_has_role  string[] optional  

allow_for_vps  boolean optional  

allow_for_dedicated  boolean optional  

hw_raid_handling  string optional  

Must be one of always_offer, only_offer_if_hw_raid, or dont_offer_if_hw_raid.

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": [],
        "offer_if_user_has_role": [],
        "dont_offer_if_user_has_role": [],
        "allow_for_vps": 1,
        "allow_for_dedicated": 1
    },
    "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/6',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'tags' => [
                'kickstart',
            ],
            'disklayout' => 'autopart --type=lvm',
            'name' => 'tempore',
            'min_disks' => 3,
            'isDisabled' => true,
            'offer_if_has_tag' => [
                'dolorum',
            ],
            'dont_offer_if_has_tag' => [
                'nisi',
            ],
            'offer_if_user_has_role' => [
                null,
            ],
            'dont_offer_if_user_has_role' => [
                null,
            ],
            'partition_size_boot' => 87,
            'partition_size_efi' => 49,
            'allow_for_vps' => false,
            'allow_for_dedicated' => true,
            'hw_raid_handling' => 'always_offer',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/pxe/disklayouts/6"
);

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

let body = {
    "tags": [
        "kickstart"
    ],
    "disklayout": "autopart --type=lvm",
    "name": "tempore",
    "min_disks": 3,
    "isDisabled": true,
    "offer_if_has_tag": [
        "dolorum"
    ],
    "dont_offer_if_has_tag": [
        "nisi"
    ],
    "offer_if_user_has_role": [
        null
    ],
    "dont_offer_if_user_has_role": [
        null
    ],
    "partition_size_boot": 87,
    "partition_size_efi": 49,
    "allow_for_vps": false,
    "allow_for_dedicated": true,
    "hw_raid_handling": "always_offer"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request PUT \
    "domain.com/api/pxe/disklayouts/6" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"tags\": [
        \"kickstart\"
    ],
    \"disklayout\": \"autopart --type=lvm\",
    \"name\": \"tempore\",
    \"min_disks\": 3,
    \"isDisabled\": true,
    \"offer_if_has_tag\": [
        \"dolorum\"
    ],
    \"dont_offer_if_has_tag\": [
        \"nisi\"
    ],
    \"offer_if_user_has_role\": [
        null
    ],
    \"dont_offer_if_user_has_role\": [
        null
    ],
    \"partition_size_boot\": 87,
    \"partition_size_efi\": 49,
    \"allow_for_vps\": false,
    \"allow_for_dedicated\": true,
    \"hw_raid_handling\": \"always_offer\"
}"

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  

The disk layout is linked to the operating systems via tags.

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  

offer_if_user_has_role  string[] optional  

dont_offer_if_user_has_role  string[] optional  

partition_size_boot  integer optional  

Must be at least 100.

partition_size_efi  integer optional  

Must be at least 100.

allow_for_vps  boolean optional  

allow_for_dedicated  boolean optional  

hw_raid_handling  string optional  

Must be one of always_offer, only_offer_if_hw_raid, or dont_offer_if_hw_raid.

DELETE api/pxe/disklayouts/{id}

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->delete(
    'domain.com/api/pxe/disklayouts/4',
    [
        '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/4"
);

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/4" \
    --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' => [
                'eum',
            ],
        ],
    ]
);
$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": [
        "eum"
    ]
};

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\": [
        \"eum\"
    ]
}"

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_ipvfour_even_if_outside_of_gateway": 1,
            "configure_all_ipvsix_ask_user": null,
            "configure_all_ipvsix_enforce": 1,
            "offer_if_has_tag": [],
            "dont_offer_if_has_tag": [],
            "offer_if_user_has_role": [],
            "dont_offer_if_user_has_role": [],
            "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,
            "fallback_to_default_disklayout_if_unset": 1,
            "pxe_enable_comboot": null,
            "licensekey": null,
            "additionalDriversUrl": null,
            "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' => 'aut',
            'pxeType' => 'kickstart',
            'pxeConfig' => '#!ipxe',
            'defaultDiskLayout' => 'autopart --type=lvm',
            'packages' => 'kexec-tools',
            'language' => 'nesciunt',
            'autoInstallTemplate' => 'network --bootproto=static',
            'timezone' => 'nihil',
            'mirrorUrl' => 'http://mirror.fra10.de.leaseweb.net/centos/8-stream/BaseOS/x86_64/os',
            'additionalDriversUrl' => 'https://domain.com/drivers',
            'cacheDirectory' => 'centos8',
            'networkConfigMode' => 'default',
            'httpdirectory' => 'fugit',
            'version' => 'dolore',
            'customFirstBoot' => 'touch /root/123',
            'customPostScript' => 'touch /root/123',
            'isDisabled' => true,
            'allow_ssh_keys' => true,
            'allow_set_hostname' => false,
            'allow_for_vps' => true,
            'allow_for_dedicated' => true,
            'set_root_password' => true,
            'updateServerHardwareInventory' => true,
            'completeAfterDownload' => true,
            'default_disklayout_template' => 16,
            'fallback_to_default_disklayout_if_unset' => false,
            'enforced_default_disklayout_template' => false,
            'default_run_scripts' => [
                'vitae',
            ],
            'enforced_default_run_scripts' => false,
            'default_run_scripts_hide_others' => true,
            'configure_all_ipvfour_ask_user' => true,
            'configure_all_ipvfour_enforce' => false,
            'configure_ipvfour_even_if_outside_of_gateway' => false,
            'configure_all_ipvsix_ask_user' => true,
            'configure_all_ipvsix_enforce' => true,
            'offer_if_has_tag' => [
                'earum',
            ],
            'dont_offer_if_has_tag' => [
                'doloremque',
            ],
            'offer_if_user_has_role' => [
                null,
            ],
            'dont_offer_if_user_has_role' => [
                null,
            ],
            'windows_activation_key' => 'alias',
            'windows_use_empty_activation_key' => true,
            'windows_key_location_userdata' => true,
            'windows_key_location_specialize' => true,
            'windows_bypass_system_requirements_check' => true,
            'windows_skip_oobe' => false,
            'pxe_enable_comboot' => false,
            'ipxe_bios_file' => 'officiis',
            'ipxe_efi_file' => 'quam',
            'licensekey' => 'qui',
            'keep_dhcp_minutes' => 4135,
        ],
    ]
);
$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": "aut",
    "pxeType": "kickstart",
    "pxeConfig": "#!ipxe",
    "defaultDiskLayout": "autopart --type=lvm",
    "packages": "kexec-tools",
    "language": "nesciunt",
    "autoInstallTemplate": "network --bootproto=static",
    "timezone": "nihil",
    "mirrorUrl": "http:\/\/mirror.fra10.de.leaseweb.net\/centos\/8-stream\/BaseOS\/x86_64\/os",
    "additionalDriversUrl": "https:\/\/domain.com\/drivers",
    "cacheDirectory": "centos8",
    "networkConfigMode": "default",
    "httpdirectory": "fugit",
    "version": "dolore",
    "customFirstBoot": "touch \/root\/123",
    "customPostScript": "touch \/root\/123",
    "isDisabled": true,
    "allow_ssh_keys": true,
    "allow_set_hostname": false,
    "allow_for_vps": true,
    "allow_for_dedicated": true,
    "set_root_password": true,
    "updateServerHardwareInventory": true,
    "completeAfterDownload": true,
    "default_disklayout_template": 16,
    "fallback_to_default_disklayout_if_unset": false,
    "enforced_default_disklayout_template": false,
    "default_run_scripts": [
        "vitae"
    ],
    "enforced_default_run_scripts": false,
    "default_run_scripts_hide_others": true,
    "configure_all_ipvfour_ask_user": true,
    "configure_all_ipvfour_enforce": false,
    "configure_ipvfour_even_if_outside_of_gateway": false,
    "configure_all_ipvsix_ask_user": true,
    "configure_all_ipvsix_enforce": true,
    "offer_if_has_tag": [
        "earum"
    ],
    "dont_offer_if_has_tag": [
        "doloremque"
    ],
    "offer_if_user_has_role": [
        null
    ],
    "dont_offer_if_user_has_role": [
        null
    ],
    "windows_activation_key": "alias",
    "windows_use_empty_activation_key": true,
    "windows_key_location_userdata": true,
    "windows_key_location_specialize": true,
    "windows_bypass_system_requirements_check": true,
    "windows_skip_oobe": false,
    "pxe_enable_comboot": false,
    "ipxe_bios_file": "officiis",
    "ipxe_efi_file": "quam",
    "licensekey": "qui",
    "keep_dhcp_minutes": 4135
};

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\": \"aut\",
    \"pxeType\": \"kickstart\",
    \"pxeConfig\": \"#!ipxe\",
    \"defaultDiskLayout\": \"autopart --type=lvm\",
    \"packages\": \"kexec-tools\",
    \"language\": \"nesciunt\",
    \"autoInstallTemplate\": \"network --bootproto=static\",
    \"timezone\": \"nihil\",
    \"mirrorUrl\": \"http:\\/\\/mirror.fra10.de.leaseweb.net\\/centos\\/8-stream\\/BaseOS\\/x86_64\\/os\",
    \"additionalDriversUrl\": \"https:\\/\\/domain.com\\/drivers\",
    \"cacheDirectory\": \"centos8\",
    \"networkConfigMode\": \"default\",
    \"httpdirectory\": \"fugit\",
    \"version\": \"dolore\",
    \"customFirstBoot\": \"touch \\/root\\/123\",
    \"customPostScript\": \"touch \\/root\\/123\",
    \"isDisabled\": true,
    \"allow_ssh_keys\": true,
    \"allow_set_hostname\": false,
    \"allow_for_vps\": true,
    \"allow_for_dedicated\": true,
    \"set_root_password\": true,
    \"updateServerHardwareInventory\": true,
    \"completeAfterDownload\": true,
    \"default_disklayout_template\": 16,
    \"fallback_to_default_disklayout_if_unset\": false,
    \"enforced_default_disklayout_template\": false,
    \"default_run_scripts\": [
        \"vitae\"
    ],
    \"enforced_default_run_scripts\": false,
    \"default_run_scripts_hide_others\": true,
    \"configure_all_ipvfour_ask_user\": true,
    \"configure_all_ipvfour_enforce\": false,
    \"configure_ipvfour_even_if_outside_of_gateway\": false,
    \"configure_all_ipvsix_ask_user\": true,
    \"configure_all_ipvsix_enforce\": true,
    \"offer_if_has_tag\": [
        \"earum\"
    ],
    \"dont_offer_if_has_tag\": [
        \"doloremque\"
    ],
    \"offer_if_user_has_role\": [
        null
    ],
    \"dont_offer_if_user_has_role\": [
        null
    ],
    \"windows_activation_key\": \"alias\",
    \"windows_use_empty_activation_key\": true,
    \"windows_key_location_userdata\": true,
    \"windows_key_location_specialize\": true,
    \"windows_bypass_system_requirements_check\": true,
    \"windows_skip_oobe\": false,
    \"pxe_enable_comboot\": false,
    \"ipxe_bios_file\": \"officiis\",
    \"ipxe_efi_file\": \"quam\",
    \"licensekey\": \"qui\",
    \"keep_dhcp_minutes\": 4135
}"

Request   

POST api/pxe/profiles

Body Parameters

tags  string[]  

osName  string  

pxeType  string  

Must be one of preseed,kickstart,autoinstall,windows,grml,vmware.

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.

additionalDriversUrl  string optional  

Must be a valid URL.

cacheDirectory  string  

The OS files will be stored in this directory.

networkConfigMode  string optional  

Must be a valid network mode.

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  

updateServerHardwareInventory  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_ipvfour_even_if_outside_of_gateway  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  

offer_if_user_has_role  string[] optional  

dont_offer_if_user_has_role  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  

pxe_enable_comboot  boolean optional  

ipxe_bios_file  string optional  

ipxe_efi_file  string optional  

licensekey  string optional  

keep_dhcp_minutes  integer optional  

Must be at least 1. Must not be greater than 6000.

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_ipvfour_even_if_outside_of_gateway": null,
        "configure_all_ipvsix_ask_user": null,
        "configure_all_ipvsix_enforce": 1,
        "offer_if_has_tag": [],
        "dont_offer_if_has_tag": [],
        "offer_if_user_has_role": [],
        "dont_offer_if_user_has_role": [],
        "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,
        "fallback_to_default_disklayout_if_unset": 1,
        "pxe_enable_comboot": null,
        "licensekey": null,
        "additionalDriversUrl": null,
        "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' => 'distinctio',
            'pxeType' => 'kickstart',
            'pxeConfig' => '#!ipxe',
            'defaultDiskLayout' => 'autopart --type=lvm',
            'packages' => 'kexec-tools',
            'language' => 'dolor',
            'autoInstallTemplate' => 'network --bootproto=static',
            'timezone' => 'aspernatur',
            'mirrorUrl' => 'http://mirror.fra10.de.leaseweb.net/centos/8-stream/BaseOS/x86_64/os',
            'additionalDriversUrl' => 'https://domain.com/drivers',
            'cacheDirectory' => 'centos8',
            'networkConfigMode' => 'quia',
            'httpdirectory' => 'quis',
            'version' => 'qui',
            'customFirstBoot' => 'touch /root/123',
            'customPostScript' => 'touch /root/123',
            'isDisabled' => true,
            'allow_ssh_keys' => false,
            'allow_for_vps' => false,
            'allow_for_dedicated' => false,
            'allow_set_hostname' => true,
            'set_root_password' => false,
            'updateServerHardwareInventory' => true,
            'completeAfterDownload' => true,
            'default_disklayout_template' => 7,
            'fallback_to_default_disklayout_if_unset' => true,
            'enforced_default_disklayout_template' => false,
            'default_run_scripts' => [
                'sed',
            ],
            'enforced_default_run_scripts' => true,
            'default_run_scripts_hide_others' => false,
            'configure_all_ipvfour_ask_user' => true,
            'configure_all_ipvfour_enforce' => false,
            'configure_ipvfour_even_if_outside_of_gateway' => true,
            'configure_all_ipvsix_ask_user' => true,
            'configure_all_ipvsix_enforce' => true,
            'offer_if_has_tag' => [
                'adipisci',
            ],
            'dont_offer_if_has_tag' => [
                'a',
            ],
            'offer_if_user_has_role' => [
                null,
            ],
            'dont_offer_if_user_has_role' => [
                null,
            ],
            'windows_activation_key' => 'ea',
            'windows_use_empty_activation_key' => false,
            'windows_key_location_userdata' => true,
            'windows_key_location_specialize' => true,
            'windows_bypass_system_requirements_check' => true,
            'windows_skip_oobe' => true,
            'pxe_enable_comboot' => true,
            'ipxe_bios_file' => 'a',
            'ipxe_efi_file' => 'veniam',
            'licensekey' => 'nemo',
            'keep_dhcp_minutes' => 3440,
        ],
    ]
);
$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": "distinctio",
    "pxeType": "kickstart",
    "pxeConfig": "#!ipxe",
    "defaultDiskLayout": "autopart --type=lvm",
    "packages": "kexec-tools",
    "language": "dolor",
    "autoInstallTemplate": "network --bootproto=static",
    "timezone": "aspernatur",
    "mirrorUrl": "http:\/\/mirror.fra10.de.leaseweb.net\/centos\/8-stream\/BaseOS\/x86_64\/os",
    "additionalDriversUrl": "https:\/\/domain.com\/drivers",
    "cacheDirectory": "centos8",
    "networkConfigMode": "quia",
    "httpdirectory": "quis",
    "version": "qui",
    "customFirstBoot": "touch \/root\/123",
    "customPostScript": "touch \/root\/123",
    "isDisabled": true,
    "allow_ssh_keys": false,
    "allow_for_vps": false,
    "allow_for_dedicated": false,
    "allow_set_hostname": true,
    "set_root_password": false,
    "updateServerHardwareInventory": true,
    "completeAfterDownload": true,
    "default_disklayout_template": 7,
    "fallback_to_default_disklayout_if_unset": true,
    "enforced_default_disklayout_template": false,
    "default_run_scripts": [
        "sed"
    ],
    "enforced_default_run_scripts": true,
    "default_run_scripts_hide_others": false,
    "configure_all_ipvfour_ask_user": true,
    "configure_all_ipvfour_enforce": false,
    "configure_ipvfour_even_if_outside_of_gateway": true,
    "configure_all_ipvsix_ask_user": true,
    "configure_all_ipvsix_enforce": true,
    "offer_if_has_tag": [
        "adipisci"
    ],
    "dont_offer_if_has_tag": [
        "a"
    ],
    "offer_if_user_has_role": [
        null
    ],
    "dont_offer_if_user_has_role": [
        null
    ],
    "windows_activation_key": "ea",
    "windows_use_empty_activation_key": false,
    "windows_key_location_userdata": true,
    "windows_key_location_specialize": true,
    "windows_bypass_system_requirements_check": true,
    "windows_skip_oobe": true,
    "pxe_enable_comboot": true,
    "ipxe_bios_file": "a",
    "ipxe_efi_file": "veniam",
    "licensekey": "nemo",
    "keep_dhcp_minutes": 3440
};

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\": \"distinctio\",
    \"pxeType\": \"kickstart\",
    \"pxeConfig\": \"#!ipxe\",
    \"defaultDiskLayout\": \"autopart --type=lvm\",
    \"packages\": \"kexec-tools\",
    \"language\": \"dolor\",
    \"autoInstallTemplate\": \"network --bootproto=static\",
    \"timezone\": \"aspernatur\",
    \"mirrorUrl\": \"http:\\/\\/mirror.fra10.de.leaseweb.net\\/centos\\/8-stream\\/BaseOS\\/x86_64\\/os\",
    \"additionalDriversUrl\": \"https:\\/\\/domain.com\\/drivers\",
    \"cacheDirectory\": \"centos8\",
    \"networkConfigMode\": \"quia\",
    \"httpdirectory\": \"quis\",
    \"version\": \"qui\",
    \"customFirstBoot\": \"touch \\/root\\/123\",
    \"customPostScript\": \"touch \\/root\\/123\",
    \"isDisabled\": true,
    \"allow_ssh_keys\": false,
    \"allow_for_vps\": false,
    \"allow_for_dedicated\": false,
    \"allow_set_hostname\": true,
    \"set_root_password\": false,
    \"updateServerHardwareInventory\": true,
    \"completeAfterDownload\": true,
    \"default_disklayout_template\": 7,
    \"fallback_to_default_disklayout_if_unset\": true,
    \"enforced_default_disklayout_template\": false,
    \"default_run_scripts\": [
        \"sed\"
    ],
    \"enforced_default_run_scripts\": true,
    \"default_run_scripts_hide_others\": false,
    \"configure_all_ipvfour_ask_user\": true,
    \"configure_all_ipvfour_enforce\": false,
    \"configure_ipvfour_even_if_outside_of_gateway\": true,
    \"configure_all_ipvsix_ask_user\": true,
    \"configure_all_ipvsix_enforce\": true,
    \"offer_if_has_tag\": [
        \"adipisci\"
    ],
    \"dont_offer_if_has_tag\": [
        \"a\"
    ],
    \"offer_if_user_has_role\": [
        null
    ],
    \"dont_offer_if_user_has_role\": [
        null
    ],
    \"windows_activation_key\": \"ea\",
    \"windows_use_empty_activation_key\": false,
    \"windows_key_location_userdata\": true,
    \"windows_key_location_specialize\": true,
    \"windows_bypass_system_requirements_check\": true,
    \"windows_skip_oobe\": true,
    \"pxe_enable_comboot\": true,
    \"ipxe_bios_file\": \"a\",
    \"ipxe_efi_file\": \"veniam\",
    \"licensekey\": \"nemo\",
    \"keep_dhcp_minutes\": 3440
}"

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  

Must be one of preseed,kickstart,autoinstall,windows,grml,vmware.

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.

additionalDriversUrl  string optional  

Must be a valid URL.

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  

updateServerHardwareInventory  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_ipvfour_even_if_outside_of_gateway  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  

offer_if_user_has_role  string[] optional  

dont_offer_if_user_has_role  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  

pxe_enable_comboot  boolean optional  

ipxe_bios_file  string optional  

ipxe_efi_file  string optional  

licensekey  string optional  

keep_dhcp_minutes  integer optional  

Must be at least 1. Must not be greater than 6000.

DELETE api/pxe/profiles/{id}

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->delete(
    'domain.com/api/pxe/profiles/4',
    [
        '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/4"
);

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/4" \
    --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/nam/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/nam/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/nam/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": [],
            "offer_if_user_has_role": [],
            "dont_offer_if_user_has_role": [],
            "allow_for_vps": 1,
            "allow_for_dedicated": 1
        }
    ],
    "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' => 'doloremque',
            'isDisabled' => false,
            'offer_if_has_tag' => [
                'quia',
            ],
            'dont_offer_if_has_tag' => [
                'numquam',
            ],
            'offer_if_user_has_role' => [
                null,
            ],
            'dont_offer_if_user_has_role' => [
                null,
            ],
            'allow_for_vps' => true,
            'allow_for_dedicated' => true,
        ],
    ]
);
$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": "doloremque",
    "isDisabled": false,
    "offer_if_has_tag": [
        "quia"
    ],
    "dont_offer_if_has_tag": [
        "numquam"
    ],
    "offer_if_user_has_role": [
        null
    ],
    "dont_offer_if_user_has_role": [
        null
    ],
    "allow_for_vps": true,
    "allow_for_dedicated": true
};

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\": \"doloremque\",
    \"isDisabled\": false,
    \"offer_if_has_tag\": [
        \"quia\"
    ],
    \"dont_offer_if_has_tag\": [
        \"numquam\"
    ],
    \"offer_if_user_has_role\": [
        null
    ],
    \"dont_offer_if_user_has_role\": [
        null
    ],
    \"allow_for_vps\": true,
    \"allow_for_dedicated\": true
}"

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  

offer_if_user_has_role  string[] optional  

dont_offer_if_user_has_role  string[] optional  

allow_for_vps  boolean optional  

allow_for_dedicated  boolean 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": [],
"offer_if_user_has_role": [],
"dont_offer_if_user_has_role": []
"allow_for_vps": 1,
"allow_for_dedicated": 1
},
"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/6',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'tags' => [
                'kickstart',
            ],
            'script' => 'touch /root/123',
            'name' => 'ipsa',
            'isDisabled' => true,
            'offer_if_has_tag' => [
                'fuga',
            ],
            'dont_offer_if_has_tag' => [
                'voluptates',
            ],
            'offer_if_user_has_role' => [
                null,
            ],
            'dont_offer_if_user_has_role' => [
                null,
            ],
            'allow_for_vps' => false,
            'allow_for_dedicated' => false,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/pxe/scripts/6"
);

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

let body = {
    "tags": [
        "kickstart"
    ],
    "script": "touch \/root\/123",
    "name": "ipsa",
    "isDisabled": true,
    "offer_if_has_tag": [
        "fuga"
    ],
    "dont_offer_if_has_tag": [
        "voluptates"
    ],
    "offer_if_user_has_role": [
        null
    ],
    "dont_offer_if_user_has_role": [
        null
    ],
    "allow_for_vps": false,
    "allow_for_dedicated": false
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request PUT \
    "domain.com/api/pxe/scripts/6" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"tags\": [
        \"kickstart\"
    ],
    \"script\": \"touch \\/root\\/123\",
    \"name\": \"ipsa\",
    \"isDisabled\": true,
    \"offer_if_has_tag\": [
        \"fuga\"
    ],
    \"dont_offer_if_has_tag\": [
        \"voluptates\"
    ],
    \"offer_if_user_has_role\": [
        null
    ],
    \"dont_offer_if_user_has_role\": [
        null
    ],
    \"allow_for_vps\": false,
    \"allow_for_dedicated\": false
}"

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  

offer_if_user_has_role  string[] optional  

dont_offer_if_user_has_role  string[] optional  

allow_for_vps  boolean optional  

allow_for_dedicated  boolean optional  

DELETE api/pxe/scripts/{id}

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->delete(
    'domain.com/api/pxe/scripts/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/pxe/scripts/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/pxe/scripts/18" \
    --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/

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',
            'mode' => 'cdrom',
        ],
    ]
);
$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",
    "mode": "cdrom"
};

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\",
    \"mode\": \"cdrom\"
}"

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.

mode  string  

Must be one of iso or cdrom.

GET api/pxe/windows/getWindowsInformation

requires authentication

Lists all available Windows versions of the ISO.

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'domain.com/api/pxe/windows/getWindowsInformation',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'mode' => 'cdrom',
        ],
    ]
);
$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",
};

let body = {
    "mode": "cdrom"
};

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

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   

POST api/pxe/windows/getWindowsInformation

Body Parameters

mode  string  

Must be one of iso or cdrom.

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' => 'suscipit',
            '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": "suscipit",
    "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\": \"suscipit\",
    \"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/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/remoteAgents/ipmiKvmIsos/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/remoteAgents/ipmiKvmIsos/6" \
    --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' => 'voluptas',
            'hostname' => 'omnis',
            'password' => 'qui',
            'sshport' => 4,
            'ip' => 'ut',
        ],
    ]
);
$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": "voluptas",
    "hostname": "omnis",
    "password": "qui",
    "sshport": 4,
    "ip": "ut"
};

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\": \"voluptas\",
    \"hostname\": \"omnis\",
    \"password\": \"qui\",
    \"sshport\": 4,
    \"ip\": \"ut\"
}"

Request   

POST api/remoteAgents

Body Parameters

name  string  

hostname  string  

password  string  

sshport  integer  

ip  string  

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/14',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => 'voluptatem',
            'hostname' => 'dolores',
            'sshport' => 11,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/remoteAgents/14"
);

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

let body = {
    "name": "voluptatem",
    "hostname": "dolores",
    "sshport": 11
};

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

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  

DELETE api/remoteAgents/{id}

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->delete(
    'domain.com/api/remoteAgents/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/remoteAgents/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/remoteAgents/16" \
    --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/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/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}/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' => '117.211.94.203',
        ],
    ]
);
$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": "117.211.94.203"
};

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\": \"117.211.94.203\"
}"

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' => 'excepturi',
            'adminIp' => '140.29.96.209',
            'setPtrTemplate' => false,
        ],
    ]
);
$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": "excepturi",
    "adminIp": "140.29.96.209",
    "setPtrTemplate": false
};

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\": \"excepturi\",
    \"adminIp\": \"140.29.96.209\",
    \"setPtrTemplate\": false
}"

Request   

PUT api/rdns/ip

Body Parameters

ptrRecord  string optional  

adminIp  string  

Must be a valid IP address.

setPtrTemplate  boolean optional  

If set to true, the RDNS entry will be set to the default value. Default is false.

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' => '1.108.163.141',
        ],
    ]
);
$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": "1.108.163.141"
};

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\": \"1.108.163.141\"
}"

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"
            ],
            "configurationFeatures": [
                "createZone",
                "assignSubnets"
            ],
            "data": {
                "serverName": "ns1.tenantos.com",
                "mysql_host": "10.10.10.2",
                "mysql_port": 9000,
                "mysql_username": "root",
                "mysql_password": "*******",
                "mysql_database": "powerdns"
            }
        }
    ],
    "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"
        ],
        "configurationFeatures": [
            "createZone",
            "assignSubnets"
        ],
        "data": {
            "serverName": "ns1.tenantos.com",
            "mysql_host": "10.10.10.2",
            "mysql_port": 9000,
            "mysql_username": "root",
            "mysql_password": "*******",
            "mysql_database": "powerdns"
        }
    },
    "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/10',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'serverName' => 'illum',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/rdns/providers/10"
);

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

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

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

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/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/rdns/providers/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/rdns/providers/5" \
    --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,
            "serversIndexDisablePermissionChecks": 0,
            "sharedAccess": 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,
            "serversIndexDisablePermissionChecks": 0,
            "sharedAccess": 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,
            "serversIndexDisablePermissionChecks": 0,
            "sharedAccess": 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,
            "serversIndexDisablePermissionChecks": 0,
            "sharedAccess": 0,
            "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' => 'corrupti',
            '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": "corrupti",
    "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\": \"corrupti\",
    \"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,
        "serversIndexDisablePermissionChecks": 0,
        "sharedAccess": 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/1',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => 'nostrum',
            'permissionlist' => [
                'servers.update.param.tags',
                'servers.apiOutput.param.tags',
            ],
            'permissionsets' => [
                'Manage Server Description',
            ],
            'sharedAccess' => true,
            'serversIndexDisablePermissionChecks' => false,
        ],
    ]
);
$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",
};

let body = {
    "name": "nostrum",
    "permissionlist": [
        "servers.update.param.tags",
        "servers.apiOutput.param.tags"
    ],
    "permissionsets": [
        "Manage Server Description"
    ],
    "sharedAccess": true,
    "serversIndexDisablePermissionChecks": false
};

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

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.

sharedAccess  boolean optional  

serversIndexDisablePermissionChecks  boolean optional  

DELETE api/roles/{id}

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->delete(
    'domain.com/api/roles/17',
    [
        '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/17"
);

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/17" \
    --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 BMC User Management

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

GET api/servers/{server}/bmc/users/listUsers

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/servers/1/bmc/users/listUsers',
    [
        '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/bmc/users/listUsers"
);

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/bmc/users/listUsers" \
    --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": 2,
            "name": "ADMIN",
            "callin": true,
            "linkAuth": true,
            "ipmiMsg": true,
            "privilegeName": "ADMINISTRATOR",
            "privilegeId": 4
        }
    ],
    "message": "success"
}
 

Request   

GET api/servers/{server}/bmc/users/listUsers

URL Parameters

server  integer  

The ID of the server.

POST api/servers/{server}/bmc/users/createUser

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'domain.com/api/servers/1/bmc/users/createUser',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'username' => 'accusantium',
            'channelAccessSettings' => 'ipmi=off callin=off link=off privilege=3',
            'dontFailIfUserExists' => true,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/servers/1/bmc/users/createUser"
);

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

let body = {
    "username": "accusantium",
    "channelAccessSettings": "ipmi=off callin=off link=off privilege=3",
    "dontFailIfUserExists": true
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
    "domain.com/api/servers/1/bmc/users/createUser" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"username\": \"accusantium\",
    \"channelAccessSettings\": \"ipmi=off callin=off link=off privilege=3\",
    \"dontFailIfUserExists\": true
}"

Request   

POST api/servers/{server}/bmc/users/createUser

URL Parameters

server  integer  

The ID of the server.

Body Parameters

username  string  

channelAccessSettings  string optional  

The channel access settings for the user.

dontFailIfUserExists  boolean optional  

POST api/servers/{server}/bmc/users/createUserWithPasswordAndPrivilege

requires authentication

This is the recommended API endpoint to create IPMI users.

This endpoints automatically handles edge cases which you would have to handle manually if you use the createUser/setUserPassword/setUserPrivilege/enableUser endpoints.

Using this endpoint, it is also possible to update an existing IPMI user: Set dontFailIfUserExists to true and use the listUsers endpoint if you need to know if the user already exists. To update an IPMI user, you can also use the updateUser endpoint.

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'domain.com/api/servers/1/bmc/users/createUserWithPasswordAndPrivilege',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'username' => 'id',
            'password' => 'quos',
            'privilege' => 3,
            'channelAccessSettings' => 'ipmi=off callin=off link=off privilege=3',
            'dontFailIfUserExists' => false,
            'dontChangePasswordIfUserExists' => false,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/servers/1/bmc/users/createUserWithPasswordAndPrivilege"
);

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

let body = {
    "username": "id",
    "password": "quos",
    "privilege": 3,
    "channelAccessSettings": "ipmi=off callin=off link=off privilege=3",
    "dontFailIfUserExists": false,
    "dontChangePasswordIfUserExists": false
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
    "domain.com/api/servers/1/bmc/users/createUserWithPasswordAndPrivilege" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"username\": \"id\",
    \"password\": \"quos\",
    \"privilege\": 3,
    \"channelAccessSettings\": \"ipmi=off callin=off link=off privilege=3\",
    \"dontFailIfUserExists\": false,
    \"dontChangePasswordIfUserExists\": false
}"

Request   

POST api/servers/{server}/bmc/users/createUserWithPasswordAndPrivilege

URL Parameters

server  integer  

The ID of the server.

Body Parameters

username  string  

password  string  

privilege  integer  

The privilege level of the IPMI user.

channelAccessSettings  string optional  

The channel access settings for the user.

dontFailIfUserExists  boolean optional  

dontChangePasswordIfUserExists  boolean optional  

POST api/servers/{server}/bmc/users/updateUser

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'domain.com/api/servers/1/bmc/users/updateUser',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'slot' => 1,
            'username' => 'autem',
            'password' => 'quasi',
            'privilege' => 3,
            'channelAccessSettings' => 'ipmi=off callin=off link=off privilege=3',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/servers/1/bmc/users/updateUser"
);

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

let body = {
    "slot": 1,
    "username": "autem",
    "password": "quasi",
    "privilege": 3,
    "channelAccessSettings": "ipmi=off callin=off link=off privilege=3"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
    "domain.com/api/servers/1/bmc/users/updateUser" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"slot\": 1,
    \"username\": \"autem\",
    \"password\": \"quasi\",
    \"privilege\": 3,
    \"channelAccessSettings\": \"ipmi=off callin=off link=off privilege=3\"
}"

Request   

POST api/servers/{server}/bmc/users/updateUser

URL Parameters

server  integer  

The ID of the server.

Body Parameters

slot  integer  

The IPMI slot ID of the user (see listUsers).

username  string optional  

password  string optional  

privilege  integer  

The privilege level of the IPMI user.

channelAccessSettings  string optional  

The channel access settings for the user.

DELETE api/servers/{server}/bmc/users/deleteUser

requires authentication

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

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

let body = {
    "slot": 1,
    "username": "quod"
};

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

Request   

DELETE api/servers/{server}/bmc/users/deleteUser

URL Parameters

server  integer  

The ID of the server.

Body Parameters

slot  integer optional  

The IPMI slot ID of the user (see listUsers). This field is required when username is not present.

username  string optional  

This field is required when slot is not present.

PUT api/servers/{server}/bmc/users/enableUser

requires authentication

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

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

let body = {
    "slot": 1,
    "username": "aut",
    "withoutSlotCheck": true
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request PUT \
    "domain.com/api/servers/1/bmc/users/enableUser" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"slot\": 1,
    \"username\": \"aut\",
    \"withoutSlotCheck\": true
}"

Request   

PUT api/servers/{server}/bmc/users/enableUser

URL Parameters

server  integer  

The ID of the server.

Body Parameters

slot  integer optional  

The IPMI slot ID of the user (see listUsers). This field is required when username is not present.

username  string optional  

This field is required when slot is not present.

withoutSlotCheck  boolean optional  

Set to true to skip the verification of whether the slot exists. The default value is true. When executing multiple API commands for the same IPMI user, you may choose to verify the user's existence only once to improve performance.

PUT api/servers/{server}/bmc/users/disableUser

requires authentication

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

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

let body = {
    "slot": 1,
    "username": "molestias",
    "withoutSlotCheck": true
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request PUT \
    "domain.com/api/servers/1/bmc/users/disableUser" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"slot\": 1,
    \"username\": \"molestias\",
    \"withoutSlotCheck\": true
}"

Request   

PUT api/servers/{server}/bmc/users/disableUser

URL Parameters

server  integer  

The ID of the server.

Body Parameters

slot  integer optional  

The IPMI slot ID of the user (see listUsers). This field is required when username is not present.

username  string optional  

This field is required when slot is not present.

withoutSlotCheck  boolean optional  

Set to true to skip the verification of whether the slot exists. The default value is true. When executing multiple API commands for the same IPMI user, you may choose to verify the user's existence only once to improve performance.

POST api/servers/{server}/bmc/users/setUserPassword

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'domain.com/api/servers/1/bmc/users/setUserPassword',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'slot' => 1,
            'username' => 'asperiores',
            'password' => 'quod',
            'withoutSlotCheck' => true,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/servers/1/bmc/users/setUserPassword"
);

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

let body = {
    "slot": 1,
    "username": "asperiores",
    "password": "quod",
    "withoutSlotCheck": true
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
    "domain.com/api/servers/1/bmc/users/setUserPassword" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"slot\": 1,
    \"username\": \"asperiores\",
    \"password\": \"quod\",
    \"withoutSlotCheck\": true
}"

Request   

POST api/servers/{server}/bmc/users/setUserPassword

URL Parameters

server  integer  

The ID of the server.

Body Parameters

slot  integer optional  

The IPMI slot ID of the user (see listUsers). This field is required when username is not present.

username  string optional  

This field is required when slot is not present.

password  string optional  

withoutSlotCheck  boolean optional  

Set to true to skip the verification of whether the slot exists. The default value is true. When executing multiple API commands for the same IPMI user, you may choose to verify the user's existence only once to improve performance.

POST api/servers/{server}/bmc/users/setUserPrivilege

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'domain.com/api/servers/1/bmc/users/setUserPrivilege',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'slot' => 1,
            'username' => 'eligendi',
            'privilege' => '4',
            'withoutSlotCheck' => false,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/servers/1/bmc/users/setUserPrivilege"
);

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

let body = {
    "slot": 1,
    "username": "eligendi",
    "privilege": "4",
    "withoutSlotCheck": false
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
    "domain.com/api/servers/1/bmc/users/setUserPrivilege" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"slot\": 1,
    \"username\": \"eligendi\",
    \"privilege\": \"4\",
    \"withoutSlotCheck\": false
}"

Request   

POST api/servers/{server}/bmc/users/setUserPrivilege

URL Parameters

server  integer  

The ID of the server.

Body Parameters

slot  integer optional  

The IPMI slot ID of the user (see listUsers). This field is required when username is not present.

username  string optional  

This field is required when slot is not present.

privilege  integer  

Must be one of 1, 2, 3, or 4.

withoutSlotCheck  boolean optional  

Set to true to skip the verification of whether the slot exists. The default value is true. When executing multiple API commands for the same IPMI user, you may choose to verify the user's existence only once to improve performance.

POST api/servers/{server}/bmc/users/channelSetAccess

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'domain.com/api/servers/1/bmc/users/channelSetAccess',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'slot' => '1',
            'username' => 'qui',
            'withoutSlotCheck' => false,
            'accessSettings' => 'ipmi=off callin=off link=off privilege=3',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/servers/1/bmc/users/channelSetAccess"
);

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

let body = {
    "slot": "1",
    "username": "qui",
    "withoutSlotCheck": false,
    "accessSettings": "ipmi=off callin=off link=off privilege=3"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
    "domain.com/api/servers/1/bmc/users/channelSetAccess" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"slot\": \"1\",
    \"username\": \"qui\",
    \"withoutSlotCheck\": false,
    \"accessSettings\": \"ipmi=off callin=off link=off privilege=3\"
}"

Request   

POST api/servers/{server}/bmc/users/channelSetAccess

URL Parameters

server  integer  

The ID of the server.

Body Parameters

slot  required optional  

The IPMI slot ID of the user (see listUsers). This field is required when username is not present.

username  string optional  

This field is required when slot is not present.

withoutSlotCheck  boolean optional  

Set to true to skip the verification of whether the slot exists. The default value is true. When executing multiple API commands for the same IPMI user, you may choose to verify the user's existence only once to improve performance.

accessSettings  string  

The channel access settings for the user.

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",
            "supportedConsoleMode": "standard"
        },
        "owner_realname": "Damian Kris",
        "tags": [
            "Internal"
        ],
        "description": "Database server",
        "reinstallationRunning": 0,
        "diskwipeRunning": 0,
        "rescueBootRunning": 0,
        "hardwarecollectRunning": 0,
        "passwordResetRunning": 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": "multiple",
                "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",
                "threads": "24",
                "mhzTurbo": 4775
            },
            "disk": {
                "model": "multiple",
                "value": 2842540,
                "count": 4,
                "valueType": "mib",
                "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": "Mr. Gardner Doyle DDS",
                "username": "adm",
                "type": "admin",
                "assignmentDate": "2021-09-04 13:05:39"
            },
            {
                "userId": 8,
                "name": "Damian Kris",
                "username": "shaylee.smitham1636043",
                "type": "enduser",
                "assignmentDate": "2021-09-04 13:05:39"
            }
        ],
        "typeOfServer": "dedicated",
        "cachedPowerstatus": "online",
        "backendDeletable": 0,
        "assignmentDate": "2021-09-04 13:05:39",
        "isExternalServer": 0,
        "postReinstallationActionAvailable": "",
        "trafficStatistics": {
            "1d": "3.65",
            "7d": "47.51",
            "14d": "177.46",
            "30d": "455.50",
            "95th_in_30d": "6.70",
            "95th_out_30d": "0.30",
            "95th_total_30d": "7.01"
        },
        "lastBwrate": {
            "in": "0.50",
            "out": "0.15"
        },
        "isSuspended": 0,
        "ipassignments": [
            {
                "updated_at": "2024-09-04T13:03:56.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,
            "passwordResetRunning": 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",
            "isExternalServer": 0,
            "postReinstallationActionAvailable": "",
            "trafficStatistics": {
                "1d": "8.24",
                "7d": "790.71",
                "14d": "941.83",
                "30d": "1783.39",
                "95th_in_30d": "5.49",
                "95th_out_30d": "0.19",
                "95th_total_30d": "5.63"
            },
            "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' => 'et',
            'tags' => [
                'dolore',
            ],
            'os' => 'optio',
            'servertype' => 'vm',
            '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,
                'enable_permanent_dhcp' => true,
            ],
            'ipassignments' => [
                [
                    'ip' => '10.10.10.55',
                    'subnets_id' => 13,
                    'primary_ip' => true,
                ],
            ],
        ],
    ]
);
$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": "et",
    "tags": [
        "dolore"
    ],
    "os": "optio",
    "servertype": "vm",
    "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,
        "enable_permanent_dhcp": true
    },
    "ipassignments": [
        {
            "ip": "10.10.10.55",
            "subnets_id": 13,
            "primary_ip": true
        }
    ]
};

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\": \"et\",
    \"tags\": [
        \"dolore\"
    ],
    \"os\": \"optio\",
    \"servertype\": \"vm\",
    \"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,
        \"enable_permanent_dhcp\": true
    },
    \"ipassignments\": [
        {
            \"ip\": \"10.10.10.55\",
            \"subnets_id\": 13,
            \"primary_ip\": true
        }
    ]
}"

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,
        "passwordResetRunning": 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",
        "isExternalServer": 0,
        "postReinstallationActionAvailable": "",
        "trafficStatistics": {
            "1d": "8.24",
            "7d": "790.71",
            "14d": "941.83",
            "30d": "1783.39",
            "95th_in_30d": "5.49",
            "95th_out_30d": "0.19",
            "95th_total_30d": "5.63"
        },
        "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/3',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'hostname' => 'hostname.com',
            'servername' => 'server-001',
            'user_id' => 14,
            'description' => 'eos',
            'tags' => [
                'quas',
            ],
            'os' => 'et',
            'servertype' => 'vm',
            'suspendUserIds' => [
                19,
            ],
            'assignmentDates' => [
                [
                    'userId' => 9,
                    'datetime' => '2022-03-31',
                ],
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/servers/3"
);

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

let body = {
    "hostname": "hostname.com",
    "servername": "server-001",
    "user_id": 14,
    "description": "eos",
    "tags": [
        "quas"
    ],
    "os": "et",
    "servertype": "vm",
    "suspendUserIds": [
        19
    ],
    "assignmentDates": [
        {
            "userId": 9,
            "datetime": "2022-03-31"
        }
    ]
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request PUT \
    "domain.com/api/servers/3" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"hostname\": \"hostname.com\",
    \"servername\": \"server-001\",
    \"user_id\": 14,
    \"description\": \"eos\",
    \"tags\": [
        \"quas\"
    ],
    \"os\": \"et\",
    \"servertype\": \"vm\",
    \"suspendUserIds\": [
        19
    ],
    \"assignmentDates\": [
        {
            \"userId\": 9,
            \"datetime\": \"2022-03-31\"
        }
    ]
}"

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  

assignmentDates  object[] optional  

assignmentDates[].userId  integer  

assignmentDates[].datetime  string  

Must be a valid date in the format Y-m-d H:i:s. Must be a date before now.

DELETE api/servers/{id}

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->delete(
    'domain.com/api/servers/20',
    [
        '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/20"
);

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/20" \
    --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',
            'consoleMode' => 'web',
        ],
    ]
);
$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",
    "consoleMode": "web"
};

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\",
    \"consoleMode\": \"web\"
}"

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.

consoleMode  string optional  

Must be one of standard or web.

POST api/servers/getByTags

requires authentication

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

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

let body = {
    "tags": [
        "Clients",
        "Damaged"
    ]
};

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

Request   

POST api/servers/getByTags

Body Parameters

tags  string[]  

An array of tags. Only servers which own all of the specified tags will be returned (= AND query, not OR). A list of all available tags can be received via the /api/servers/tags endpoint.

POST api/servers/{server}/network/regenerateVlanConfiguration

requires authentication

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

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

let body = {
    "performVlanActions": "preview"
};

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

Request   

POST api/servers/{server}/network/regenerateVlanConfiguration

URL Parameters

server  string  

The server.

Body Parameters

performVlanActions  string optional  

Must be one of perform, preview, or none.

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": "2023-11-17T21:29:07.000000Z",
            "updated_at": "2024-08-10T21: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/2/comments',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'multipart/form-data',
            'Accept' => 'application/json',
        ],
        'multipart' => [
            [
                'name' => 'comment',
                'contents' => 'repudiandae'
            ],
            [
                'name' => 'sticky',
                'contents' => '1'
            ],
            [
                'name' => 'user_id',
                'contents' => '16'
            ],
            [
                'name' => 'attachments[]',
                'contents' => fopen('/tmp/phpE2Ewgx', 'r')
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/servers/2/comments"
);

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

const body = new FormData();
body.append('comment', 'repudiandae');
body.append('sticky', '1');
body.append('user_id', '16');
body.append('attachments[]', document.querySelector('input[name="attachments[]"]').files[0]);

fetch(url, {
    method: "POST",
    headers,
    body,
}).then(response => response.json());
curl --request POST \
    "domain.com/api/servers/2/comments" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: multipart/form-data" \
    --header "Accept: application/json" \
    --form "comment=repudiandae" \
    --form "sticky=1" \
    --form "user_id=16" \
    --form "attachments[]=@/tmp/phpE2Ewgx" 

Request   

POST api/servers/{server}/comments

URL Parameters

server  integer  

The ID of the server.

Body Parameters

comment  string  

sticky  boolean optional  

user_id  integer optional  

attachments  file[] optional  

Must be a file. Must not be greater than 50120 kilobytes.

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": "2023-11-17T21:29:07.000000Z",
        "updated_at": "2024-08-10T21: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/1/comments/16',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'comment' => 'ab',
            'sticky' => false,
            'user_id' => 2,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/servers/1/comments/16"
);

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

let body = {
    "comment": "ab",
    "sticky": false,
    "user_id": 2
};

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

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  boolean 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/8/comments/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/8/comments/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/8/comments/12" \
    --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": "online",
    "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/12/connections',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'agentId' => 17,
            '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/12/connections"
);

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

let body = {
    "agentId": 17,
    "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/12/connections" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"agentId\": 17,
    \"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/4/connections/16',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'agentId' => 3,
            '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/4/connections/16"
);

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

let body = {
    "agentId": 3,
    "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/4/connections/16" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"agentId\": 3,
    \"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/5/connections/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/servers/5/connections/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/servers/5/connections/6" \
    --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.

POST api/servers/{server}/connections/{testConnectionId}/{serverConnectionAction}

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'domain.com/api/servers/1/connections/24/getSupportedActions',
    [
        '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/connections/24/getSupportedActions"
);

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/servers/1/connections/24/getSupportedActions" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200):


{
    "result": {
        "powerActions": [
            "getPowerStatus",
            "setPowerOff",
            "setPowerOn",
            "setPowerReset"
        ]
    },
    "message": "success"
}
 

Request   

POST api/servers/{server}/connections/{testConnectionId}/{serverConnectionAction}

URL Parameters

server  integer  

The ID of the server.

testConnectionId  integer  

The ID of the connection.

serverConnectionAction  string  

The action to execute. Use getSupportedActions to receive information about the available actions. To execute IPMI commands, use the api/servers/{server}/bmc/executeCommand endpoint.

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
            },
            "vlanAutomationAvailable": false
        }
    ],
    "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/16/ipassignments/getAssignableIpsOfSubnet',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'subnets_id' => 6,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/servers/16/ipassignments/getAssignableIpsOfSubnet"
);

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

let body = {
    "subnets_id": 6
};

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

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
            },
            "vlanAutomationAvailable": false
        }
    ],
    "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/5/ipassignments',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'subnets_id' => 6,
            'ips' => [
                '10.10.10.20',
                '10.10.10.21',
            ],
            'description' => 'voluptas',
            'performVlanActions' => 'none',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/servers/5/ipassignments"
);

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

let body = {
    "subnets_id": 6,
    "ips": [
        "10.10.10.20",
        "10.10.10.21"
    ],
    "description": "voluptas",
    "performVlanActions": "none"
};

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

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  

performVlanActions  string optional  

Must be one of perform, preview, or none.

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' => 'error',
            'primary_ip' => false,
            'ptrRecord' => 'repellendus',
            'setPtrTemplate' => false,
            '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": "error",
    "primary_ip": false,
    "ptrRecord": "repellendus",
    "setPtrTemplate": false,
    "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\": \"error\",
    \"primary_ip\": false,
    \"ptrRecord\": \"repellendus\",
    \"setPtrTemplate\": false,
    \"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  

setPtrTemplate  boolean optional  

If set to true, the RDNS entry will be set to the default value. Default is false.

subnetIp  string optional  

Only used if ip is a subnet. Then, this parameter must be an IP within the subnet (e.g. aaab:bbbb:cccc:aaaa::1).

ip  string  

Must be a IP/subnet which is assigned to the server. If the value is a subnet, it must be the subnet with CIDR (e.g. aaab:bbbb:cccc:aaaa::/52)

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

requires authentication

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

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

let body = {
    "ip": "10.10.10.4",
    "performVlanActions": "perform"
};

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

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 optional  

Required if ips is empty. The IP which you want to delete from the server.

ips  string[] optional  

Required if ip is empty. An array of IPs which you want to delete from the server.

performVlanActions  string optional  

Must be one of perform, preview, or none.

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/api/scripts/hwdetect | 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/12/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/12/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/12/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 optional  

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/13/inventory/consequatur',
    [
        '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/13/inventory/consequatur"
);

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/13/inventory/consequatur" \
    --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/12/inventory/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/servers/12/inventory/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/servers/12/inventory/15" \
    --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/17/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/17/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/17/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):


{
    "result": {
        "installProgress": [],
        "completed": 0,
        "canCancelInstallation": 1,
        "running": 1,
        "step": 1
    },
    "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/4/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/4/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/4/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://ns2114132.ip-34-144-0.eu",
                "username": "root",
                "password": "EH9HMSQ22gfvsjIQ2",
                "serverMainIp": "34.144.0.0"
            }
        ],
        "postTaskAction": "getPassword"
    },
    "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": "Automatic Partitioning"
                },
                {
                    "id": 4,
                    "name": "RAID 1"
                },
                {
                    "id": 5,
                    "name": "RAID 5"
                },
                {
                    "id": 6,
                    "name": "RAID 10"
                },
                {
                    "id": 7,
                    "name": "RAID 0"
                },
                {
                    "id": 8,
                    "name": "Install on largest disk"
                },
                {
                    "id": 9,
                    "name": "Install on smallest disk"
                }
            ],
            "scripts": [
                {
                    "id": 2,
                    "name": "Install Nextcloud"
                }
            ],
            "isRescue": 0,
            "isPasswordResetProfile": 0,
            "features": {
                "follow_install_progress": 1,
                "0": 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.png"
        }
    ],
    "message": "success"
}
 

Request   

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

URL Parameters

server  integer  

The ID of the server.

requires authentication

Returns the path to the logo of the OS.

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' => 'soluta',
        ],
    ]
);
$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": "soluta"
};

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\": \"soluta\"
}"

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  

(ignore the method parameter)

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.

noFailover  boolean optional  

If set to true and IPMI or AMT in combination with a PDU is used, the power action will not fallback to the PDU if IPMI/AMT fails. Default is false.

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

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'domain.com/api/servers/16/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/16/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/16/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": "",
            "vcpus": 2
        },
        "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/4/stats/network/text',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'from' => '2024-09-04T13:06:11',
            'to' => '2024-09-04T13:06:11',
            'predefined' => '30days',
            'user_id' => 10,
            'groupBy' => '1mo',
            'summary' => true,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/servers/4/stats/network/text"
);

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

let body = {
    "from": "2024-09-04T13:06:11",
    "to": "2024-09-04T13:06:11",
    "predefined": "30days",
    "user_id": 10,
    "groupBy": "1mo",
    "summary": true
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
    "domain.com/api/servers/4/stats/network/text" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"from\": \"2024-09-04T13:06:11\",
    \"to\": \"2024-09-04T13:06:11\",
    \"predefined\": \"30days\",
    \"user_id\": 10,
    \"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, all, currentWeek, week, month, currentMonth, or year.

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/6/stats/ipmi/text',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'predefined' => 'today',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/servers/6/stats/ipmi/text"
);

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

let body = {
    "predefined": "today"
};

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

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,
        "dns_resolvers": [
            "65.108.22.20",
            "10.10.10.13"
        ],
        "enable_switch_automation": null,
        "vlan_mode": null,
        "access_vlan_generation_mode": null,
        "static_access_vlan_id": null,
        "range_start_access_vlan_id": null,
        "range_end_access_vlan_id": null,
        "trunk_vlans": null,
        "vlan_layer3_mode": null,
        "vlan_layer3_ip": null,
        "reuse_access_vlan": null,
        "use_existing_port_access_vlan": null,
        "vlan_remove_layer3_ip_on_unassign": null,
        "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"
        },
        "vlanAutomationAvailable": false,
        "ips": [
            {
                "...": "..."
            },
            {
                "ip": "10.10.10.99",
                "reserved": 0,
                "servers_id": 1,
                "description": null,
                "servers_owner_realname": "Prof. Ernestina Beahan I",
                "servers_owner_id": 10,
                "servername": "the-server-name",
                "rdns_entry": ""
            }
        ],
        "childSubnets": [],
        "rdnsFeatures": {
            "canManageUnassignedIPs": 1,
            "canManageAssignedIPs": 1
        }
    },
    "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/1/split',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'mode' => 'subnet',
            'toPrefix' => 64,
            'gateway_method' => 'first',
            'toAmount' => 100,
            'generateIps' => true,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/subnets/1/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,
    "generateIps": true
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
    "domain.com/api/subnets/1/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,
    \"generateIps\": true
}"

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 optional  

Required if listOfIps is empty. The amount of subnets / IPs to create.

listOfIps  string[] optional  

Required if toAmount is empty. listOfIps can be used to split a subnet into predefined subnets or single IPs.

generateIps  boolean optional  

reserve_gateway_ip  boolean optional  

Defaults to true if not set.

reserve_broadcast_ip  boolean optional  

Defaults to true if not set.

reserve_network_address  boolean optional  

Defaults to true if not set.

POST api/subnets/{subnetId}/childsMassActions

requires authentication

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

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

let body = {
    "updateRdns": false,
    "updateResolvers": true,
    "updateRestrictions": false
};

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

Request   

POST api/subnets/{subnetId}/childsMassActions

URL Parameters

subnetId  integer  

The ID of the subnet.

Body Parameters

updateRdns  boolean optional  

updateResolvers  boolean optional  

updateRestrictions  boolean optional  

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):

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": [
                "65.108.22.20",
                "10.10.10.13"
            ],
            "enable_switch_automation": null,
            "vlan_mode": null,
            "access_vlan_generation_mode": null,
            "static_access_vlan_id": null,
            "range_start_access_vlan_id": null,
            "range_end_access_vlan_id": null,
            "trunk_vlans": null,
            "vlan_layer3_mode": null,
            "vlan_layer3_ip": null,
            "reuse_access_vlan": null,
            "use_existing_port_access_vlan": null,
            "vlan_remove_layer3_ip_on_unassign": null,
            "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"
            },
            "vlanAutomationAvailable": false
        },
        {
            "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,
            "dns_resolvers": [
                "aaaa:bbbb::1",
                "aaaa:bbbc::2"
            ],
            "enable_switch_automation": null,
            "vlan_mode": null,
            "access_vlan_generation_mode": null,
            "static_access_vlan_id": null,
            "range_start_access_vlan_id": null,
            "range_end_access_vlan_id": null,
            "trunk_vlans": null,
            "vlan_layer3_mode": null,
            "vlan_layer3_ip": null,
            "reuse_access_vlan": null,
            "use_existing_port_access_vlan": null,
            "vlan_remove_layer3_ip_on_unassign": null,
            "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"
            },
            "vlanAutomationAvailable": false
        },
        {
            "id": 3,
            "subnet": "64:ff9b:1::",
            "cidr": 48,
            "netmask": "",
            "gw": "64:ff9b:1::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,
            "dns_resolvers": [
                "aaaa:bbbb::1",
                "aaaa:bbbc::2"
            ],
            "enable_switch_automation": null,
            "vlan_mode": null,
            "access_vlan_generation_mode": null,
            "static_access_vlan_id": null,
            "range_start_access_vlan_id": null,
            "range_end_access_vlan_id": null,
            "trunk_vlans": null,
            "vlan_layer3_mode": null,
            "vlan_layer3_ip": null,
            "reuse_access_vlan": null,
            "use_existing_port_access_vlan": null,
            "vlan_remove_layer3_ip_on_unassign": null,
            "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"
            },
            "vlanAutomationAvailable": false
        }
    ],
    "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' => [
                'assumenda',
            ],
            'dont_offer_if_server_has_tag' => [
                'velit',
            ],
            'only_if_server_has_remote_agents' => [
                3,
            ],
            'dns_resolvers' => [
                '1.1.1.1',
                '1.0.0.1',
                '8.8.8.8',
            ],
            'generateIps' => true,
            'enable_switch_automation' => true,
            'vlan_mode' => 'native+trunk',
            'access_vlan_generation_mode' => 'fixed',
            'static_access_vlan_id' => 15,
            'range_start_access_vlan_id' => 1,
            'range_end_access_vlan_id' => 3116,
            'trunk_vlans' => [
                876,
            ],
            'vlan_layer3_mode' => 'gateway',
            'vlan_layer3_ip' => 'est',
            'reuse_access_vlan' => false,
            'use_existing_port_access_vlan' => false,
            'vlan_remove_layer3_ip_on_unassign' => false,
        ],
    ]
);
$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": [
        "assumenda"
    ],
    "dont_offer_if_server_has_tag": [
        "velit"
    ],
    "only_if_server_has_remote_agents": [
        3
    ],
    "dns_resolvers": [
        "1.1.1.1",
        "1.0.0.1",
        "8.8.8.8"
    ],
    "generateIps": true,
    "enable_switch_automation": true,
    "vlan_mode": "native+trunk",
    "access_vlan_generation_mode": "fixed",
    "static_access_vlan_id": 15,
    "range_start_access_vlan_id": 1,
    "range_end_access_vlan_id": 3116,
    "trunk_vlans": [
        876
    ],
    "vlan_layer3_mode": "gateway",
    "vlan_layer3_ip": "est",
    "reuse_access_vlan": false,
    "use_existing_port_access_vlan": false,
    "vlan_remove_layer3_ip_on_unassign": false
};

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\": [
        \"assumenda\"
    ],
    \"dont_offer_if_server_has_tag\": [
        \"velit\"
    ],
    \"only_if_server_has_remote_agents\": [
        3
    ],
    \"dns_resolvers\": [
        \"1.1.1.1\",
        \"1.0.0.1\",
        \"8.8.8.8\"
    ],
    \"generateIps\": true,
    \"enable_switch_automation\": true,
    \"vlan_mode\": \"native+trunk\",
    \"access_vlan_generation_mode\": \"fixed\",
    \"static_access_vlan_id\": 15,
    \"range_start_access_vlan_id\": 1,
    \"range_end_access_vlan_id\": 3116,
    \"trunk_vlans\": [
        876
    ],
    \"vlan_layer3_mode\": \"gateway\",
    \"vlan_layer3_ip\": \"est\",
    \"reuse_access_vlan\": false,
    \"use_existing_port_access_vlan\": false,
    \"vlan_remove_layer3_ip_on_unassign\": false
}"

Request   

POST api/subnets

Body Parameters

subnet  string  

Must be a valid IP address (network address).

cidr  integer  

The CIDR notation, optional if netmask is set.

netmask  string  

The netmask, optional if cidr is set.

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.

generateIps  boolean optional  

enable_switch_automation  boolean optional  

vlan_mode  string optional  

Must be one of access or native+trunk.

access_vlan_generation_mode  string optional  

Must be one of fixed or range.

static_access_vlan_id  integer optional  

range_start_access_vlan_id  integer optional  

Must be at least 1.

range_end_access_vlan_id  integer optional  

Must not be greater than 4094.

trunk_vlans  integer[] optional  

Must be at least 1. Must not be greater than 4094.

vlan_layer3_mode  string optional  

Must be one of none, gateway, or custom.

vlan_layer3_ip  string optional  

reuse_access_vlan  boolean optional  

use_existing_port_access_vlan  boolean optional  

vlan_remove_layer3_ip_on_unassign  boolean optional  

reserve_gateway_ip  boolean optional  

Defaults to true if not set.

reserve_broadcast_ip  boolean optional  

Defaults to true if not set.

reserve_network_address  boolean optional  

Defaults to true if not set.

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": [
            "65.108.22.20",
            "10.10.10.13"
        ],
        "enable_switch_automation": null,
        "vlan_mode": null,
        "access_vlan_generation_mode": null,
        "static_access_vlan_id": null,
        "range_start_access_vlan_id": null,
        "range_end_access_vlan_id": null,
        "trunk_vlans": null,
        "vlan_layer3_mode": null,
        "vlan_layer3_ip": null,
        "reuse_access_vlan": null,
        "use_existing_port_access_vlan": null,
        "vlan_remove_layer3_ip_on_unassign": null,
        "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"
        },
        "vlanAutomationAvailable": false
    },
    "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/10',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'gw' => '96.169.117.125',
            'description' => 'dignissimos',
            'priority' => 15,
            'offer_if_server_has_tag' => [
                'delectus',
            ],
            'dont_offer_if_server_has_tag' => [
                'aliquam',
            ],
            'only_if_server_has_remote_agents' => [
                13,
            ],
            'dns_resolvers' => [
                '1.1.1.1',
                '1.0.0.1',
                '8.8.8.8',
            ],
            'enable_switch_automation' => true,
            'vlan_mode' => 'access',
            'access_vlan_generation_mode' => 'range',
            'static_access_vlan_id' => 19,
            'range_start_access_vlan_id' => 1,
            'range_end_access_vlan_id' => 1832,
            'trunk_vlans' => [
                1935,
            ],
            'vlan_layer3_mode' => 'none',
            'vlan_layer3_ip' => 'facere',
            'reuse_access_vlan' => false,
            'use_existing_port_access_vlan' => false,
            'vlan_remove_layer3_ip_on_unassign' => false,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/subnets/10"
);

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

let body = {
    "gw": "96.169.117.125",
    "description": "dignissimos",
    "priority": 15,
    "offer_if_server_has_tag": [
        "delectus"
    ],
    "dont_offer_if_server_has_tag": [
        "aliquam"
    ],
    "only_if_server_has_remote_agents": [
        13
    ],
    "dns_resolvers": [
        "1.1.1.1",
        "1.0.0.1",
        "8.8.8.8"
    ],
    "enable_switch_automation": true,
    "vlan_mode": "access",
    "access_vlan_generation_mode": "range",
    "static_access_vlan_id": 19,
    "range_start_access_vlan_id": 1,
    "range_end_access_vlan_id": 1832,
    "trunk_vlans": [
        1935
    ],
    "vlan_layer3_mode": "none",
    "vlan_layer3_ip": "facere",
    "reuse_access_vlan": false,
    "use_existing_port_access_vlan": false,
    "vlan_remove_layer3_ip_on_unassign": false
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request PUT \
    "domain.com/api/subnets/10" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"gw\": \"96.169.117.125\",
    \"description\": \"dignissimos\",
    \"priority\": 15,
    \"offer_if_server_has_tag\": [
        \"delectus\"
    ],
    \"dont_offer_if_server_has_tag\": [
        \"aliquam\"
    ],
    \"only_if_server_has_remote_agents\": [
        13
    ],
    \"dns_resolvers\": [
        \"1.1.1.1\",
        \"1.0.0.1\",
        \"8.8.8.8\"
    ],
    \"enable_switch_automation\": true,
    \"vlan_mode\": \"access\",
    \"access_vlan_generation_mode\": \"range\",
    \"static_access_vlan_id\": 19,
    \"range_start_access_vlan_id\": 1,
    \"range_end_access_vlan_id\": 1832,
    \"trunk_vlans\": [
        1935
    ],
    \"vlan_layer3_mode\": \"none\",
    \"vlan_layer3_ip\": \"facere\",
    \"reuse_access_vlan\": false,
    \"use_existing_port_access_vlan\": false,
    \"vlan_remove_layer3_ip_on_unassign\": false
}"

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.

enable_switch_automation  boolean optional  

vlan_mode  string optional  

Must be one of access or native+trunk.

access_vlan_generation_mode  string optional  

Must be one of fixed or range.

static_access_vlan_id  integer optional  

range_start_access_vlan_id  integer optional  

Must be at least 1.

range_end_access_vlan_id  integer optional  

Must not be greater than 4094.

trunk_vlans  integer[] optional  

Must be at least 1. Must not be greater than 4094.

vlan_layer3_mode  string optional  

Must be one of none, gateway, or custom.

vlan_layer3_ip  string optional  

reuse_access_vlan  boolean optional  

use_existing_port_access_vlan  boolean optional  

vlan_remove_layer3_ip_on_unassign  boolean optional  

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 Backups

Feature: https://documentation.tenantos.com/Tenantos/system-settings/system-backups/

GET api/system/backups/storages

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/system/backups/storages',
    [
        '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/backups/storages"
);

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/backups/storages" \
    --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": 2,
            "name": "FTP #1",
            "provider": "ftp",
            "configuration": {
                "host": "10.10.3.1",
                "username": "backup",
                "password": "password",
                "port": 21,
                "ssl": true,
                "timeout": 10,
                "root": ""
            },
            "last_backup_date": "2024-09-04 13:06:10",
            "last_status_message": "success",
            "retention": 1,
            "enabled": 0
        }
    ],
    "message": "success"
}
 

Request   

GET api/system/backups/storages

POST api/system/backups/storages

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'domain.com/api/system/backups/storages',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => 'iusto',
            'provider' => 'local',
            'retention' => 7204,
            'enabled' => false,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/system/backups/storages"
);

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

let body = {
    "name": "iusto",
    "provider": "local",
    "retention": 7204,
    "enabled": false
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
    "domain.com/api/system/backups/storages" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"iusto\",
    \"provider\": \"local\",
    \"retention\": 7204,
    \"enabled\": false
}"

Request   

POST api/system/backups/storages

Body Parameters

name  string  

provider  string  

Must be one of s3, ftp, local.

configuration  string[] optional  

This field is required when provider is s3 or ftp.

retention  integer  

Must be at least 1. Must not be greater than 9999.

enabled  boolean  

GET api/system/backups/storages/{id}

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/system/backups/storages/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/system/backups/storages/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/system/backups/storages/2" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200):


{
    "result": {
        "id": 2,
        "name": "FTP #1",
        "provider": "ftp",
        "configuration": {
            "host": "10.10.3.1",
            "username": "backup",
            "password": "password",
            "port": 21,
            "ssl": true,
            "timeout": 10,
            "root": ""
        },
        "last_backup_date": "2023-01-11 12:37:04",
        "last_status_message": "success",
        "retention": 1,
        "enabled": 0
    },
    "message": "success"
}
 

Request   

GET api/system/backups/storages/{id}

URL Parameters

id  integer  

The ID of the storage.

PUT api/system/backups/storages/{id}

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->put(
    'domain.com/api/system/backups/storages/2',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => 'nisi',
            'retention' => 6392,
            'enabled' => true,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/system/backups/storages/2"
);

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

let body = {
    "name": "nisi",
    "retention": 6392,
    "enabled": true
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request PUT \
    "domain.com/api/system/backups/storages/2" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"nisi\",
    \"retention\": 6392,
    \"enabled\": true
}"

Request   

PUT api/system/backups/storages/{id}

PATCH api/system/backups/storages/{id}

URL Parameters

id  integer  

The ID of the storage.

Body Parameters

name  string optional  

configuration  array. optional  

retention  integer optional  

Must be at least 1. Must not be greater than 9999.

enabled  boolean optional  

DELETE api/system/backups/storages/{id}

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->delete(
    'domain.com/api/system/backups/storages/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/system/backups/storages/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/system/backups/storages/2" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Request   

DELETE api/system/backups/storages/{id}

URL Parameters

id  integer  

The ID of the storage.

GET api/system/backups/history

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/system/backups/history',
    [
        '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/backups/history"
);

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/backups/history" \
    --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": "2024-09-04T13:06:09.000000Z",
            "archive_size": 4498688,
            "script_log": "Wed 04 Sep 2024 01:06:09 PM UTC: [START] Creating backup of the local database\nWed 04 Sep 2024 01:06:09 PM UTC: [END] Creating backup of the local database\nWed 04 Sep 2024 01:06:09 PM UTC: [START] Copying essential files\nWed 04 Sep 2024 01:06:10 PM UTC: [END] Copying essential files\nWed 04 Sep 2024 01:06:10 PM UTC: [START] Creating backup archive\nWed 04 Sep 2024 01:06:10 PM UTC: [END] Creating backup archive\n/var/www/storage/system_backups/app-5b0ea187cb-1725455170.tar.gz",
            "tasks_log": [
                {
                    "date": "2024-09-04 13:06:09",
                    "message": "Task pending",
                    "type": "info"
                },
                {
                    "date": "2024-09-04 13:06:09",
                    "message": "Backup started",
                    "type": "info"
                },
                {
                    "date": "2024-09-04 13:06:10",
                    "message": "Backup archive created",
                    "type": "info"
                },
                {
                    "date": "2024-09-04 13:06:10",
                    "message": "local: Started retention task",
                    "type": "info"
                },
                {
                    "date": "2024-09-04 13:06:10",
                    "message": "local: Deleting file app-5b0ea187cb-1725454759.tar.gz",
                    "type": "info"
                },
                {
                    "date": "2024-09-04 13:06:10",
                    "message": "local: Retention task completed",
                    "type": "info"
                },
                {
                    "date": "2024-09-04 13:06:10",
                    "message": "Backup ended",
                    "type": "info"
                }
            ],
            "current_status": "Executed",
            "result": "Done",
            "warning": 0,
            "error": 0,
            "end_date": "2024-09-04 13:06:10"
        }
    ],
    "message": "success"
}
 

Request   

GET api/system/backups/history

GET api/system/backups/history/{backupTaskId}

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/system/backups/history/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/backups/history/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/backups/history/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": "2024-09-04T13:06:09.000000Z",
        "archive_size": 4498688,
        "script_log": "Wed 04 Sep 2024 01:06:09 PM UTC: [START] Creating backup of the local database\nWed 04 Sep 2024 01:06:09 PM UTC: [END] Creating backup of the local database\nWed 04 Sep 2024 01:06:09 PM UTC: [START] Copying essential files\nWed 04 Sep 2024 01:06:10 PM UTC: [END] Copying essential files\nWed 04 Sep 2024 01:06:10 PM UTC: [START] Creating backup archive\nWed 04 Sep 2024 01:06:10 PM UTC: [END] Creating backup archive\n/var/www/storage/system_backups/app-5b0ea187cb-1725455170.tar.gz",
        "tasks_log": [
            {
                "date": "2024-09-04 13:06:09",
                "message": "Task pending",
                "type": "info"
            },
            {
                "date": "2024-09-04 13:06:09",
                "message": "Backup started",
                "type": "info"
            },
            {
                "date": "2024-09-04 13:06:10",
                "message": "Backup archive created",
                "type": "info"
            },
            {
                "date": "2024-09-04 13:06:10",
                "message": "local: Started retention task",
                "type": "info"
            },
            {
                "date": "2024-09-04 13:06:10",
                "message": "local: Deleting file app-5b0ea187cb-1725454759.tar.gz",
                "type": "info"
            },
            {
                "date": "2024-09-04 13:06:10",
                "message": "local: Retention task completed",
                "type": "info"
            },
            {
                "date": "2024-09-04 13:06:10",
                "message": "Backup ended",
                "type": "info"
            }
        ],
        "current_status": "Executed",
        "result": "Done",
        "warning": 0,
        "error": 0,
        "end_date": "2024-09-04 13:06:10"
    },
    "message": "success"
}
 

Request   

GET api/system/backups/history/{backupTaskId}

URL Parameters

backupTaskId  integer  

The ID of the backup task.

POST api/system/backups/create

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'domain.com/api/system/backups/create',
    [
        '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/backups/create"
);

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/system/backups/create" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Request   

POST api/system/backups/create

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/20/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/20/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/20/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/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/activitylog/agents/20"
);

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/20" \
    --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/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/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",
    "language": "en-us",
    "isSharedAccess": false,
    "sharedUserId": null,
    "realOrSharedUserId": 1,
    "permissions": [
        "system.version",
        "system.apiOutput.param.app_version",
        "..."
    ]
}
 

Request   

GET api/user

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/10/tokens',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => 'et',
            'allowedHosts' => [
                '10.10.12.10',
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/users/10/tokens"
);

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

let body = {
    "name": "et",
    "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/10/tokens" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"et\",
    \"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/1/tokens/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/users/1/tokens/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/users/1/tokens/8" \
    --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": "2024-09-04T13:06:09.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' => 'aliquam',
            'pubkey' => 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCPMKW3XDPL0k257n8IBrmJrhSTOfczRjD5V5nou8uYCg1HJHnaCtdgPPdCQPfg5jYVKP5MCsgFBbfCWXv8GgDZAI905Yel46ZcRBkC0JKVkkc53I+wS/zmwfxXzvkV6GRbCISnc1n98+wE4z+Qtg9FV+VAhJzinTCYFo9TV7hwkz7V5e+pj9/5NgfVbFy0H8B2aXqp1F6A7ENBXNrbejXdTyo3lVIq1/tHKfv6mcVmR4b4w7EVI4bvDMDdHeEKfMCvDUG359ElVp7gla5M0kohCCWtgLSchR/6NTEIa6rAFhsmCHCfIE6q959Ff+KUR40e8yzulZtp3NPu8ukUjJtkBA5c4lAE2UUNldyqkWiE8sWAr+GlMjU0UkB3xzB0ID53EKH93WoIapjAnpDYxah8dOdyfk2cSmkdSe8DFNLeWffi8j3Ea9XeCQnMa/VTcSarspnCKL8RG5LL8vGy//0Cs6QXQDn/gCTR2McTPbiiks2sFVWCaIIbgkTs9fGFuhM=',
            'description' => 'voluptatem',
        ],
    ]
);
$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": "aliquam",
    "pubkey": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCPMKW3XDPL0k257n8IBrmJrhSTOfczRjD5V5nou8uYCg1HJHnaCtdgPPdCQPfg5jYVKP5MCsgFBbfCWXv8GgDZAI905Yel46ZcRBkC0JKVkkc53I+wS\/zmwfxXzvkV6GRbCISnc1n98+wE4z+Qtg9FV+VAhJzinTCYFo9TV7hwkz7V5e+pj9\/5NgfVbFy0H8B2aXqp1F6A7ENBXNrbejXdTyo3lVIq1\/tHKfv6mcVmR4b4w7EVI4bvDMDdHeEKfMCvDUG359ElVp7gla5M0kohCCWtgLSchR\/6NTEIa6rAFhsmCHCfIE6q959Ff+KUR40e8yzulZtp3NPu8ukUjJtkBA5c4lAE2UUNldyqkWiE8sWAr+GlMjU0UkB3xzB0ID53EKH93WoIapjAnpDYxah8dOdyfk2cSmkdSe8DFNLeWffi8j3Ea9XeCQnMa\/VTcSarspnCKL8RG5LL8vGy\/\/0Cs6QXQDn\/gCTR2McTPbiiks2sFVWCaIIbgkTs9fGFuhM=",
    "description": "voluptatem"
};

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\": \"aliquam\",
    \"pubkey\": \"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCPMKW3XDPL0k257n8IBrmJrhSTOfczRjD5V5nou8uYCg1HJHnaCtdgPPdCQPfg5jYVKP5MCsgFBbfCWXv8GgDZAI905Yel46ZcRBkC0JKVkkc53I+wS\\/zmwfxXzvkV6GRbCISnc1n98+wE4z+Qtg9FV+VAhJzinTCYFo9TV7hwkz7V5e+pj9\\/5NgfVbFy0H8B2aXqp1F6A7ENBXNrbejXdTyo3lVIq1\\/tHKfv6mcVmR4b4w7EVI4bvDMDdHeEKfMCvDUG359ElVp7gla5M0kohCCWtgLSchR\\/6NTEIa6rAFhsmCHCfIE6q959Ff+KUR40e8yzulZtp3NPu8ukUjJtkBA5c4lAE2UUNldyqkWiE8sWAr+GlMjU0UkB3xzB0ID53EKH93WoIapjAnpDYxah8dOdyfk2cSmkdSe8DFNLeWffi8j3Ea9XeCQnMa\\/VTcSarspnCKL8RG5LL8vGy\\/\\/0Cs6QXQDn\\/gCTR2McTPbiiks2sFVWCaIIbgkTs9fGFuhM=\",
    \"description\": \"voluptatem\"
}"

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.

description  string optional  

GET api/users/{user}/sshkeys/{id}

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/users/1/sshkeys/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/users/1/sshkeys/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/users/1/sshkeys/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": "2024-09-04T13:06:09.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/{id}

URL Parameters

user  integer  

The ID of the user.

id  integer  

The ID of the SSH key.

PUT api/users/{user}/sshkeys/{id}

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->put(
    'domain.com/api/users/19/sshkeys/4',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => 'alias',
            'pubkey' => 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCPMKW3XDPL0k257n8IBrmJrhSTOfczRjD5V5nou8uYCg1HJHnaCtdgPPdCQPfg5jYVKP5MCsgFBbfCWXv8GgDZAI905Yel46ZcRBkC0JKVkkc53I+wS/zmwfxXzvkV6GRbCISnc1n98+wE4z+Qtg9FV+VAhJzinTCYFo9TV7hwkz7V5e+pj9/5NgfVbFy0H8B2aXqp1F6A7ENBXNrbejXdTyo3lVIq1/tHKfv6mcVmR4b4w7EVI4bvDMDdHeEKfMCvDUG359ElVp7gla5M0kohCCWtgLSchR/6NTEIa6rAFhsmCHCfIE6q959Ff+KUR40e8yzulZtp3NPu8ukUjJtkBA5c4lAE2UUNldyqkWiE8sWAr+GlMjU0UkB3xzB0ID53EKH93WoIapjAnpDYxah8dOdyfk2cSmkdSe8DFNLeWffi8j3Ea9XeCQnMa/VTcSarspnCKL8RG5LL8vGy//0Cs6QXQDn/gCTR2McTPbiiks2sFVWCaIIbgkTs9fGFuhM=',
            'description' => 'numquam',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/users/19/sshkeys/4"
);

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

let body = {
    "name": "alias",
    "pubkey": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCPMKW3XDPL0k257n8IBrmJrhSTOfczRjD5V5nou8uYCg1HJHnaCtdgPPdCQPfg5jYVKP5MCsgFBbfCWXv8GgDZAI905Yel46ZcRBkC0JKVkkc53I+wS\/zmwfxXzvkV6GRbCISnc1n98+wE4z+Qtg9FV+VAhJzinTCYFo9TV7hwkz7V5e+pj9\/5NgfVbFy0H8B2aXqp1F6A7ENBXNrbejXdTyo3lVIq1\/tHKfv6mcVmR4b4w7EVI4bvDMDdHeEKfMCvDUG359ElVp7gla5M0kohCCWtgLSchR\/6NTEIa6rAFhsmCHCfIE6q959Ff+KUR40e8yzulZtp3NPu8ukUjJtkBA5c4lAE2UUNldyqkWiE8sWAr+GlMjU0UkB3xzB0ID53EKH93WoIapjAnpDYxah8dOdyfk2cSmkdSe8DFNLeWffi8j3Ea9XeCQnMa\/VTcSarspnCKL8RG5LL8vGy\/\/0Cs6QXQDn\/gCTR2McTPbiiks2sFVWCaIIbgkTs9fGFuhM=",
    "description": "numquam"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request PUT \
    "domain.com/api/users/19/sshkeys/4" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"alias\",
    \"pubkey\": \"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCPMKW3XDPL0k257n8IBrmJrhSTOfczRjD5V5nou8uYCg1HJHnaCtdgPPdCQPfg5jYVKP5MCsgFBbfCWXv8GgDZAI905Yel46ZcRBkC0JKVkkc53I+wS\\/zmwfxXzvkV6GRbCISnc1n98+wE4z+Qtg9FV+VAhJzinTCYFo9TV7hwkz7V5e+pj9\\/5NgfVbFy0H8B2aXqp1F6A7ENBXNrbejXdTyo3lVIq1\\/tHKfv6mcVmR4b4w7EVI4bvDMDdHeEKfMCvDUG359ElVp7gla5M0kohCCWtgLSchR\\/6NTEIa6rAFhsmCHCfIE6q959Ff+KUR40e8yzulZtp3NPu8ukUjJtkBA5c4lAE2UUNldyqkWiE8sWAr+GlMjU0UkB3xzB0ID53EKH93WoIapjAnpDYxah8dOdyfk2cSmkdSe8DFNLeWffi8j3Ea9XeCQnMa\\/VTcSarspnCKL8RG5LL8vGy\\/\\/0Cs6QXQDn\\/gCTR2McTPbiiks2sFVWCaIIbgkTs9fGFuhM=\",
    \"description\": \"numquam\"
}"

Request   

PUT api/users/{user}/sshkeys/{id}

PATCH api/users/{user}/sshkeys/{id}

URL Parameters

user  integer  

The ID of the user.

id  integer  

The ID of the SSH key.

Body Parameters

name  string optional  

pubkey  string optional  

The new public SSH key.

description  string optional  

DELETE api/users/{user}/sshkeys/{id}

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->delete(
    'domain.com/api/users/16/sshkeys/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/users/16/sshkeys/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/users/16/sshkeys/6" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Request   

DELETE api/users/{user}/sshkeys/{id}

URL Parameters

user  integer  

The ID of the user.

id  integer  

The ID of the SSH key.

POST api/user/{user}/twofactor/enable

requires authentication

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

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

let body = {
    "code": "nostrum"
};

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

Request   

POST api/user/{user}/twofactor/enable

URL Parameters

user  integer  

The user.

Body Parameters

code  string  

GET api/user/{user}/twofactor/disable

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/user/1/twofactor/disable',
    [
        '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/1/twofactor/disable"
);

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/1/twofactor/disable" \
    --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/user/{user}/twofactor/disable

URL Parameters

user  integer  

The ID of the user.

POST api/users/{user}/generateSsoToken

requires authentication

Generates an one-time login link. Login via: https://domain.com/tokenLogin/$authToken

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

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

let body = {
    "endpoint": "\/servers",
    "validForSeconds": 7
};

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

Example response (200):


{
    "result": {
        "authToken": "1e4304d1ff81b3194c288a39e954d1122efc80a5a198ac05a6b9db21409d8223ed4cb44179d075eae08d6941dde2738bcb17",
        "validUntil": 1666430700
    },
    "message": "success"
}
 

Request   

POST api/users/{user}/generateSsoToken

URL Parameters

user  integer  

The ID of the user.

Body Parameters

endpoint  string optional  

The endpoint where the browser will be redirected after opening the login URL.

validForSeconds  integer optional  

GET api/users

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/users',
    [
        '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"
);

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" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200):


{
    "result": [
        {
            "id": 3,
            "name": "Ellie Mraz",
            "email": "233592_celine67@example.org",
            "two_factor_confirmed": 0,
            "created_at": "2022-10-21T19:28:24.000000Z",
            "root_owner": 1,
            "username": "keenan.rutherford1929810",
            "accountstatus": "enabled",
            "timezone": "Europe/Berlin",
            "datetimeFormat": "DD.MM.YYYY HH:mm:ss",
            "darkmode": null,
            "prefs": [],
            "allowedHosts": [
                "10.12.13.10"
            ],
            "isSharedAccess": false,
            "sharedUserId": null,
            "realOrSharedUserId": 3,
            "role_id": 3,
            "role_name": "user ",
            "root_owner_username": "adm",
            "lastlogin": {
                "date": "Never",
                "ip": "-"
            },
            "canCreateSubUsers": 0,
            "description": null,
            "subUsers": [],
            "permissions": []
        },
        {
            "id": 2,
            "name": "Magnus Kessler",
            "email": "421483_toy.gerhold@example.net",
            "two_factor_confirmed": 0,
            "created_at": "2022-10-21T19:28:24.000000Z",
            "root_owner": 1,
            "username": "fadel.cecil2797368",
            "accountstatus": "enabled",
            "timezone": "Europe/Berlin",
            "datetimeFormat": "DD.MM.YYYY HH:mm:ss",
            "darkmode": null,
            "prefs": [],
            "allowedHosts": [],
            "isSharedAccess": false,
            "sharedUserId": null,
            "realOrSharedUserId": 2,
            "role_id": 2,
            "role_name": "reseller ",
            "root_owner_username": "adm",
            "lastlogin": {
                "date": "Never",
                "ip": "-"
            },
            "canCreateSubUsers": 1,
            "description": null,
            "subUsers": [],
            "permissions": []
        },
        {
            "id": 1,
            "name": "Viva Botsford",
            "email": "admin@admin.com",
            "two_factor_confirmed": 0,
            "created_at": "2022-10-21T19:28:24.000000Z",
            "root_owner": 1,
            "username": "adm",
            "accountstatus": "enabled",
            "timezone": "Europe/Berlin",
            "datetimeFormat": "DD.MM.YYYY HH:mm:ss",
            "darkmode": null,
            "prefs": [],
            "allowedHosts": [],
            "isSharedAccess": false,
            "sharedUserId": null,
            "realOrSharedUserId": 1,
            "role_id": 1,
            "role_name": "admin ",
            "root_owner_username": "adm",
            "lastlogin": {
                "ip": "127.0.0.1",
                "date": "2022-10-21T19:32:52.000000Z"
            },
            "canCreateSubUsers": 1,
            "description": null,
            "subUsers": {
                "1": 2,
                "2": 3,
                "3": 4,
                "4": 5,
                "5": 6,
                "6": 7,
                "7": 8,
                "8": 9,
                "9": 10,
                "10": 12
            },
            "permissions": []
        }
    ],
    "message": "success"
}
 

Request   

GET api/users

POST api/users

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'domain.com/api/users',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => 'alias',
            'email' => 'beverly02@example.org',
            'password' => 'doloremque',
            'root_owner' => 20,
            'description' => 'rerum',
            'username' => 'wgwkxlligzxpdtpmbnqporjkyzncebedxtpdbnuoterktviacedydotxnnxeleytdcyzhnfzujtniqwqcthvbdgzaaahqbbafbomxgqwzdnphhbjtvbubmnmyfqkigbiakvtzzbqomibtjjlqmtzqlzcetiedqkbooz',
            'role_id' => 19,
            'accountstatus' => 'enabled',
            'timezone' => 'America/Indiana/Petersburg',
            'datetimeFormat' => 'recusandae',
            'darkmode' => '0',
            'allowedHosts' => [
                'tenetur',
            ],
            'language' => 'minima',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/users"
);

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

let body = {
    "name": "alias",
    "email": "beverly02@example.org",
    "password": "doloremque",
    "root_owner": 20,
    "description": "rerum",
    "username": "wgwkxlligzxpdtpmbnqporjkyzncebedxtpdbnuoterktviacedydotxnnxeleytdcyzhnfzujtniqwqcthvbdgzaaahqbbafbomxgqwzdnphhbjtvbubmnmyfqkigbiakvtzzbqomibtjjlqmtzqlzcetiedqkbooz",
    "role_id": 19,
    "accountstatus": "enabled",
    "timezone": "America\/Indiana\/Petersburg",
    "datetimeFormat": "recusandae",
    "darkmode": "0",
    "allowedHosts": [
        "tenetur"
    ],
    "language": "minima"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
    "domain.com/api/users" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"alias\",
    \"email\": \"beverly02@example.org\",
    \"password\": \"doloremque\",
    \"root_owner\": 20,
    \"description\": \"rerum\",
    \"username\": \"wgwkxlligzxpdtpmbnqporjkyzncebedxtpdbnuoterktviacedydotxnnxeleytdcyzhnfzujtniqwqcthvbdgzaaahqbbafbomxgqwzdnphhbjtvbubmnmyfqkigbiakvtzzbqomibtjjlqmtzqlzcetiedqkbooz\",
    \"role_id\": 19,
    \"accountstatus\": \"enabled\",
    \"timezone\": \"America\\/Indiana\\/Petersburg\",
    \"datetimeFormat\": \"recusandae\",
    \"darkmode\": \"0\",
    \"allowedHosts\": [
        \"tenetur\"
    ],
    \"language\": \"minima\"
}"

Request   

POST api/users

Body Parameters

name  string  

email  string optional  

Must be a valid email address.

password  string  

root_owner  integer optional  

description  string optional  

username  string  

Must not be greater than 255 characters.

role_id  integer  

accountstatus  string optional  

Must be one of enabled or disabled.

timezone  string optional  

Must be a valid time zone, such as Africa/Accra.

datetimeFormat  string optional  

darkmode  string optional  

Must be one of 0 or 1.

allowedHosts  string[] optional  

Must be an array of valid IP addresses. Login will be restricted to the specified IPs. Leave empty to allow all IPs.

language  string optional  

sessionTimeout  string optional  

GET api/users/{id}

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/users/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/users/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/users/1" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200):


{
    "result": {
        "id": 1,
        "name": "Dr. Eva Flatley",
        "email": "admin@admin.com",
        "two_factor_confirmed": 0,
        "created_at": "2022-10-20T21:38:15.000000Z",
        "root_owner": 1,
        "username": "adm",
        "accountstatus": "enabled",
        "timezone": "Europe/Berlin",
        "datetimeFormat": "DD.MM.YYYY HH:mm:ss",
        "darkmode": null,
        "prefs": [],
        "allowedHosts": [
            "10.12.10.13"
        ],
        "isSharedAccess": false,
        "sharedUserId": null,
        "realOrSharedUserId": 1,
        "role_id": 1,
        "role_name": "admin ",
        "root_owner_username": "adm",
        "lastlogin": {
            "ip": "192.168.166.5",
            "date": "2022-10-20T22:12:21.000000Z"
        },
        "canCreateSubUsers": 1,
        "description": null,
        "subUsers": {
            "1": 2,
            "2": 3
        },
        "roles": [
            []
        ],
        "permissions": [
            "inventorycomponents.index",
            "inventorycomponents.show",
            "..."
        ]
    },
    "message": "success"
}
 

Request   

GET api/users/{id}

URL Parameters

id  integer  

The ID of the user.

PUT api/users/{id}

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->put(
    'domain.com/api/users/1',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => 'saepe',
            'email' => 'terry.parker@example.net',
            'password' => 'laborum',
            'root_owner' => 3,
            'description' => 'fugiat',
            'username' => 'xdtasaiubrpxditusbftplelpjqhwbqemypunovhtgojqwbhbujnenjcqibubxziiflubceqjjmcfophhkiatbvadlplazetbyieqeejtwgtskhedxosmgalgjiqqkmglqybofjpiduiirqwsvhdqlnevsyznfkvktufxuoztqmxbsoambiayzgcducqcziviozamxbsyfyjecokneunoibhanckxieppidcruvsnrsukkwchgg',
            'accountstatus' => 'enabled',
            'role_id' => 5,
            'timezone' => 'Asia/Vladivostok',
            'datetimeFormat' => 'recusandae',
            'darkmode' => '0',
            'allowedHosts' => [
                'vel',
            ],
            'language' => 'blanditiis',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/users/1"
);

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

let body = {
    "name": "saepe",
    "email": "terry.parker@example.net",
    "password": "laborum",
    "root_owner": 3,
    "description": "fugiat",
    "username": "xdtasaiubrpxditusbftplelpjqhwbqemypunovhtgojqwbhbujnenjcqibubxziiflubceqjjmcfophhkiatbvadlplazetbyieqeejtwgtskhedxosmgalgjiqqkmglqybofjpiduiirqwsvhdqlnevsyznfkvktufxuoztqmxbsoambiayzgcducqcziviozamxbsyfyjecokneunoibhanckxieppidcruvsnrsukkwchgg",
    "accountstatus": "enabled",
    "role_id": 5,
    "timezone": "Asia\/Vladivostok",
    "datetimeFormat": "recusandae",
    "darkmode": "0",
    "allowedHosts": [
        "vel"
    ],
    "language": "blanditiis"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request PUT \
    "domain.com/api/users/1" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"saepe\",
    \"email\": \"terry.parker@example.net\",
    \"password\": \"laborum\",
    \"root_owner\": 3,
    \"description\": \"fugiat\",
    \"username\": \"xdtasaiubrpxditusbftplelpjqhwbqemypunovhtgojqwbhbujnenjcqibubxziiflubceqjjmcfophhkiatbvadlplazetbyieqeejtwgtskhedxosmgalgjiqqkmglqybofjpiduiirqwsvhdqlnevsyznfkvktufxuoztqmxbsoambiayzgcducqcziviozamxbsyfyjecokneunoibhanckxieppidcruvsnrsukkwchgg\",
    \"accountstatus\": \"enabled\",
    \"role_id\": 5,
    \"timezone\": \"Asia\\/Vladivostok\",
    \"datetimeFormat\": \"recusandae\",
    \"darkmode\": \"0\",
    \"allowedHosts\": [
        \"vel\"
    ],
    \"language\": \"blanditiis\"
}"

Request   

PUT api/users/{id}

PATCH api/users/{id}

URL Parameters

id  integer  

The ID of the user.

Body Parameters

name  string optional  

email  string optional  

Must be a valid email address.

password  string optional  

root_owner  integer optional  

description  string optional  

username  string optional  

Must not be greater than 255 characters.

accountstatus  string optional  

Must be one of enabled or disabled.

role_id  integer optional  

timezone  string optional  

Must be a valid time zone, such as Africa/Accra.

datetimeFormat  string optional  

darkmode  string optional  

Must be one of 0 or 1.

prefs  object optional  

Table prefs.

allowedHosts  string[] optional  

Must be an array of valid IP addresses. Login will be restricted to the specified IPs. Leave empty to allow all IPs.

language  string optional  

sessionTimeout  string optional  

DELETE api/users/{id}

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->delete(
    'domain.com/api/users/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/users/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/users/1" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Request   

DELETE api/users/{id}

URL Parameters

id  integer  

The ID of the user.

GET api/users/{user_id}/loginhistory

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/users/13/loginhistory',
    [
        '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/13/loginhistory"
);

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/13/loginhistory" \
    --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": [
        {
            "created_at": "2024-09-04T13:06:09.000000Z",
            "ip": "192.168.174.20",
            "userAgent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36"
        }
    ],
    "message": "success"
}
 

Request   

GET api/users/{user_id}/loginhistory

URL Parameters

user_id  integer  

The ID of the user.

GET api/users/{user_id}/accesslog

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/users/17/accesslog',
    [
        '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/17/accesslog"
);

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/17/accesslog" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200):


{
    "result": [
        {
            "id": 479,
            "request": "{\"tags\":[\"Internal\",\"New\"]}",
            "response": "{\"result\":{\"id\":61,\"hostname\":\"hostname.com\",\"...\":\"...\"}",
            "endpoint": "/api/servers/61",
            "method": "PUT",
            "statuscode": "200",
            "ip": "192.168.174.100",
            "userAgent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36",
            "created_at": "2022-10-20T22:03:55.000000Z",
            "requestSource": "web"
        }
    ],
    "message": "success"
}
 

Request   

GET api/users/{user_id}/accesslog

URL Parameters

user_id  integer  

The ID of the user.

limit  integer optional  

Limit the returned results.

PUT api/users/{user}/tokens/{id}

requires authentication

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

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

let body = {
    "name": "nesciunt",
    "allowedHosts": [
        "10.10.12.10"
    ]
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request PUT \
    "domain.com/api/users/11/tokens/2" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"nesciunt\",
    \"allowedHosts\": [
        \"10.10.12.10\"
    ]
}"

Request   

PUT api/users/{user}/tokens/{id}

PATCH api/users/{user}/tokens/{id}

URL Parameters

user  integer  

The ID of the user.

id  integer  

The ID of the token.

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.

POST api/users/loginDetails

requires authentication

Verify the login details of a user account via the API.

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

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

let body = {
    "identify": "nesciunt",
    "password": "iure",
    "two_factor_code": "123456"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
    "domain.com/api/user/testLoginDetails" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"identify\": \"nesciunt\",
    \"password\": \"iure\",
    \"two_factor_code\": \"123456\"
}"

Example response (200):


{
    "result": {
        "result": "success",
        "twoFactorAuthEnabled": false,
        "twoFactorAuthPassed": null,
        "userId": 1
    },
    "message": "success"
}
 

Request   

POST api/user/testLoginDetails

Body Parameters

identify  string  

The username or email of the user.

password  string  

The password of the user.

two_factor_code  string optional  

The two-factor authentication code.

VPS Plans

Feature: https://documentation.tenantos.com/Tenantos/virtualization/about-virtualization/

GET api/virtualization/vpsplans

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/virtualization/vpsplans',
    [
        '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/vpsplans"
);

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/vpsplans" \
    --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-21T09:43:54.000000Z",
            "updated_at": "2022-10-21T09:43:54.000000Z",
            "planname": "VPS PLAN #1",
            "planconfig": {
                "bios": "seabios",
                "display": "std",
                "machine": "pc-i440fx",
                "scsi_controller": "virtio-scsi-pci",
                "qemu_version": "6.0",
                "os_type": "l26",
                "ifaces": {
                    "iface0": {
                        "network_type": "virtio",
                        "interface": "vmbr1",
                        "subnets": [
                            1
                        ],
                        "amount_ipv4": "1",
                        "firewall": true,
                        "ipspoof_filter": true
                    }
                },
                "disks": {
                    "disk0": {
                        "disk_bus": "scsi",
                        "disk_cache": "none",
                        "discard": 1,
                        "storage": "local",
                        "disk_size": "20",
                        "disk_format": "qcow2"
                    }
                },
                "cpu_type": "kvm64",
                "cpu_flags": [
                    "aes"
                ],
                "cpu_units": 1024,
                "memory_ballooning": 1,
                "features": {
                    "enable_console_access": 1,
                    "enable_power_control": 1,
                    "auto_sync_hw": 1
                },
                "firewall": {
                    "policy_in": "ACCEPT",
                    "policy_out": "ACCEPT"
                },
                "agent": {
                    "pxeAgent": 1,
                    "pxe_iface": "iface0",
                    "dhcpAgent": 1
                },
                "sockets": "2",
                "cores": "4",
                "memory": "1024",
                "memory_min": "1024",
                "node": "host-01",
                "startVmid": "9000"
            },
            "providerId": 1,
            "summary": {
                "totalDiskSpace": 20,
                "cpucores": 8,
                "memory": "1024",
                "disks": [
                    "20"
                ],
                "node": "host-01",
                "provider": {
                    "name": "proxmox-cluster",
                    "provider": "proxmox",
                    "id": 1
                },
                "virtualization": "Proxmox KVM"
            }
        }
    ],
    "message": "success"
}
 

Request   

GET api/virtualization/vpsplans

POST api/virtualization/vpsplans

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'domain.com/api/virtualization/vpsplans',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'planname' => 'incidunt',
            'planconfig' => [
                [
                    'information' => 'See GET api/virtualization/vpsplans/{id} for a list of values - values may differ depending on the virtualization platform',
                ],
            ],
            'providerId' => 8,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/virtualization/vpsplans"
);

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

let body = {
    "planname": "incidunt",
    "planconfig": [
        {
            "information": "See GET api\/virtualization\/vpsplans\/{id} for a list of values - values may differ depending on the virtualization platform"
        }
    ],
    "providerId": 8
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
    "domain.com/api/virtualization/vpsplans" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"planname\": \"incidunt\",
    \"planconfig\": [
        {
            \"information\": \"See GET api\\/virtualization\\/vpsplans\\/{id} for a list of values - values may differ depending on the virtualization platform\"
        }
    ],
    \"providerId\": 8
}"

Request   

POST api/virtualization/vpsplans

Body Parameters

planname  string  

planconfig  object  

The plan configuration.

providerId  integer  

GET api/virtualization/vpsplans/{id}

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/virtualization/vpsplans/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/virtualization/vpsplans/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/virtualization/vpsplans/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-21T09:43:54.000000Z",
        "updated_at": "2022-10-21T09:43:54.000000Z",
        "planname": "VPS PLAN #1",
        "planconfig": {
            "bios": "seabios",
            "display": "std",
            "machine": "pc-i440fx",
            "scsi_controller": "virtio-scsi-pci",
            "qemu_version": "6.0",
            "os_type": "l26",
            "ifaces": {
                "iface0": {
                    "network_type": "virtio",
                    "interface": "vmbr1",
                    "subnets": [
                        1
                    ],
                    "amount_ipv4": "1",
                    "firewall": true,
                    "ipspoof_filter": true
                }
            },
            "disks": {
                "disk0": {
                    "disk_bus": "scsi",
                    "disk_cache": "none",
                    "discard": 1,
                    "storage": "local",
                    "disk_size": "20",
                    "disk_format": "qcow2"
                }
            },
            "cpu_type": "kvm64",
            "cpu_flags": [
                "aes"
            ],
            "cpu_units": 1024,
            "memory_ballooning": 1,
            "features": {
                "enable_console_access": 1,
                "enable_power_control": 1,
                "auto_sync_hw": 1
            },
            "firewall": {
                "policy_in": "ACCEPT",
                "policy_out": "ACCEPT"
            },
            "agent": {
                "pxeAgent": 1,
                "pxe_iface": "iface0",
                "dhcpAgent": 1
            },
            "sockets": "2",
            "cores": "4",
            "memory": "1024",
            "memory_min": "1024",
            "node": "host-01",
            "startVmid": "9000"
        },
        "providerId": 1
    },
    "message": "success"
}
 

Request   

GET api/virtualization/vpsplans/{id}

URL Parameters

id  integer  

The ID of the VPS plan.

PUT api/virtualization/vpsplans/{id}

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->put(
    'domain.com/api/virtualization/vpsplans/18',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'planname' => 'excepturi',
            'planconfig' => [
                [
                    'information' => 'See GET api/virtualization/vpsplans/{id} for a list of values - values may differ depending on the virtualization platform',
                ],
            ],
            'providerId' => 14,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/virtualization/vpsplans/18"
);

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

let body = {
    "planname": "excepturi",
    "planconfig": [
        {
            "information": "See GET api\/virtualization\/vpsplans\/{id} for a list of values - values may differ depending on the virtualization platform"
        }
    ],
    "providerId": 14
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request PUT \
    "domain.com/api/virtualization/vpsplans/18" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"planname\": \"excepturi\",
    \"planconfig\": [
        {
            \"information\": \"See GET api\\/virtualization\\/vpsplans\\/{id} for a list of values - values may differ depending on the virtualization platform\"
        }
    ],
    \"providerId\": 14
}"

Request   

PUT api/virtualization/vpsplans/{id}

PATCH api/virtualization/vpsplans/{id}

URL Parameters

id  integer  

The ID of the VPS plan.

Body Parameters

planname  string  

planconfig  object  

The plan configuration.

providerId  integer  

POST api/virtualization/vpsplans/{vpsplan}/duplicate

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'domain.com/api/virtualization/vpsplans/1/duplicate',
    [
        '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/vpsplans/1/duplicate"
);

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/virtualization/vpsplans/1/duplicate" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200):


{
    "result": {
        "id": 211,
        "created_at": "2022-10-21T19:01:52.000000Z",
        "updated_at": "2022-10-21T19:01:52.000000Z",
        "planname": "VPS PLAN #1 (Duplicated)",
        "planconfig": {
            "bios": "seabios",
            "display": "std",
            "machine": "pc-i440fx",
            "scsi_controller": "virtio-scsi-pci",
            "qemu_version": "6.0",
            "os_type": "l26",
            "ifaces": {
                "iface0": {
                    "network_type": "virtio",
                    "interface": "vmbr1",
                    "subnets": [
                        1
                    ],
                    "amount_ipv4": "1",
                    "firewall": true,
                    "ipspoof_filter": true
                }
            },
            "disks": {
                "disk0": {
                    "disk_bus": "scsi",
                    "disk_cache": "none",
                    "discard": 1,
                    "storage": "local",
                    "disk_size": "20",
                    "disk_format": "qcow2"
                }
            },
            "cpu_type": "kvm64",
            "cpu_flags": [
                "aes"
            ],
            "cpu_units": 1024,
            "memory_ballooning": 1,
            "features": {
                "enable_console_access": 1,
                "enable_power_control": 1,
                "auto_sync_hw": 1
            },
            "firewall": {
                "policy_in": "ACCEPT",
                "policy_out": "ACCEPT"
            },
            "agent": {
                "pxeAgent": 1,
                "pxe_iface": "iface0",
                "dhcpAgent": 1
            },
            "sockets": "2",
            "cores": "4",
            "memory": "1024",
            "memory_min": "1024",
            "node": "host03",
            "startVmid": "9000"
        },
        "providerId": 1
    },
    "message": "success"
}
 

Request   

POST api/virtualization/vpsplans/{vpsplan}/duplicate

URL Parameters

vpsplan  integer  

The ID of the VPS plan.

DELETE api/virtualization/vpsplans/{id}

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->delete(
    'domain.com/api/virtualization/vpsplans/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/virtualization/vpsplans/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/virtualization/vpsplans/5" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Request   

DELETE api/virtualization/vpsplans/{id}

URL Parameters

id  integer  

The ID of the VPS plan.

POST api/virtualization/balancerplans/testBalancerConfiguration

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'domain.com/api/virtualization/balancerplans/testBalancerConfiguration',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'providerId' => 13,
            'cpuPriority' => 74690,
            'cpuRequireIdlePercentage' => 47,
            'storagePriority' => 70957,
            'storageReserveFreeAmount' => 20,
            'ramPriority' => 24459,
            'ramReserveFreeAmount' => 4,
            'vmCountPriority' => 1329,
            'vmMaxAmount' => 603485,
            'vmMaxAmountPerCore' => 14546,
            'diskSize' => 12,
            'ramSize' => 10,
            'nodeMustMatchRegex' => '/^node[0-9]+$/',
            'nodeMustNotMatchRegex' => '/^gluster[0-9]+$/',
            'storages' => [
                [
                    'backendStorageName' => 'local',
                    'diskSize' => 4,
                ],
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/virtualization/balancerplans/testBalancerConfiguration"
);

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

let body = {
    "providerId": 13,
    "cpuPriority": 74690,
    "cpuRequireIdlePercentage": 47,
    "storagePriority": 70957,
    "storageReserveFreeAmount": 20,
    "ramPriority": 24459,
    "ramReserveFreeAmount": 4,
    "vmCountPriority": 1329,
    "vmMaxAmount": 603485,
    "vmMaxAmountPerCore": 14546,
    "diskSize": 12,
    "ramSize": 10,
    "nodeMustMatchRegex": "\/^node[0-9]+$\/",
    "nodeMustNotMatchRegex": "\/^gluster[0-9]+$\/",
    "storages": [
        {
            "backendStorageName": "local",
            "diskSize": 4
        }
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
    "domain.com/api/virtualization/balancerplans/testBalancerConfiguration" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"providerId\": 13,
    \"cpuPriority\": 74690,
    \"cpuRequireIdlePercentage\": 47,
    \"storagePriority\": 70957,
    \"storageReserveFreeAmount\": 20,
    \"ramPriority\": 24459,
    \"ramReserveFreeAmount\": 4,
    \"vmCountPriority\": 1329,
    \"vmMaxAmount\": 603485,
    \"vmMaxAmountPerCore\": 14546,
    \"diskSize\": 12,
    \"ramSize\": 10,
    \"nodeMustMatchRegex\": \"\\/^node[0-9]+$\\/\",
    \"nodeMustNotMatchRegex\": \"\\/^gluster[0-9]+$\\/\",
    \"storages\": [
        {
            \"backendStorageName\": \"local\",
            \"diskSize\": 4
        }
    ]
}"

Request   

POST api/virtualization/balancerplans/testBalancerConfiguration

Body Parameters

providerId  integer  

cpuPriority  number optional  

Must be at least 0.01. Must not be greater than 99999.

cpuRequireIdlePercentage  number optional  

Must be at least 0.01. Must not be greater than 100.

storagePriority  number optional  

Must be at least 0.01. Must not be greater than 99999.

storageReserveFreeAmount  integer optional  

ramPriority  number optional  

Must be at least 0.01. Must not be greater than 99999.

ramReserveFreeAmount  integer optional  

vmCountPriority  number optional  

Must be at least 0.01. Must not be greater than 99999.

vmMaxAmount  integer optional  

Must be at least 1. Must not be greater than 999999.

vmMaxAmountPerCore  number optional  

Must be at least 0.01. Must not be greater than 99999.

diskSize  integer optional  

ramSize  integer optional  

nodeMustMatchRegex  string optional  

Must not be greater than 65535 characters.

nodeMustNotMatchRegex  string optional  

Must not be greater than 65535 characters.

storages  object[] optional  

storages[].backendStorageName  string optional  

The name of the storage. Must not be greater than 255 characters.

storages[].diskSize  integer optional  

GET api/virtualization/balancerplans

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/virtualization/balancerplans',
    [
        '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/balancerplans"
);

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/balancerplans" \
    --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": "2024-09-04T13:06:10.000000Z",
            "updated_at": "2024-09-04T13:06:10.000000Z",
            "planname": "Balancer #1",
            "cpuPriority": 2,
            "cpuRequireIdlePercentage": 30,
            "storagePriority": 1,
            "storageReserveFreeAmount": 20,
            "ramPriority": 1.5,
            "ramReserveFreeAmount": 10,
            "vmCountPriority": 1,
            "vmMaxAmount": 50,
            "nodeMustMatchRegex": "/^node[0-9]+$/",
            "nodeMustNotMatchRegex": "/^gluster[0-9]+$/",
            "vmMaxAmountPerCore": null
        }
    ],
    "message": "success"
}
 

Request   

GET api/virtualization/balancerplans

POST api/virtualization/balancerplans

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'domain.com/api/virtualization/balancerplans',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'planname' => 'kxzhcnpfgzaqvfszerdyubmafvyykw',
            'cpuPriority' => 74190,
            'cpuRequireIdlePercentage' => 80,
            'storagePriority' => 40198,
            'storageReserveFreeAmount' => 1,
            'ramPriority' => 57449,
            'ramReserveFreeAmount' => 5,
            'vmCountPriority' => 6231,
            'vmMaxAmount' => 358688,
            'vmMaxAmountPerCore' => 11103,
            'nodeMustMatchRegex' => '/^node[0-9]+$/',
            'nodeMustNotMatchRegex' => '/^gluster[0-9]+$/',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/virtualization/balancerplans"
);

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

let body = {
    "planname": "kxzhcnpfgzaqvfszerdyubmafvyykw",
    "cpuPriority": 74190,
    "cpuRequireIdlePercentage": 80,
    "storagePriority": 40198,
    "storageReserveFreeAmount": 1,
    "ramPriority": 57449,
    "ramReserveFreeAmount": 5,
    "vmCountPriority": 6231,
    "vmMaxAmount": 358688,
    "vmMaxAmountPerCore": 11103,
    "nodeMustMatchRegex": "\/^node[0-9]+$\/",
    "nodeMustNotMatchRegex": "\/^gluster[0-9]+$\/"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
    "domain.com/api/virtualization/balancerplans" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"planname\": \"kxzhcnpfgzaqvfszerdyubmafvyykw\",
    \"cpuPriority\": 74190,
    \"cpuRequireIdlePercentage\": 80,
    \"storagePriority\": 40198,
    \"storageReserveFreeAmount\": 1,
    \"ramPriority\": 57449,
    \"ramReserveFreeAmount\": 5,
    \"vmCountPriority\": 6231,
    \"vmMaxAmount\": 358688,
    \"vmMaxAmountPerCore\": 11103,
    \"nodeMustMatchRegex\": \"\\/^node[0-9]+$\\/\",
    \"nodeMustNotMatchRegex\": \"\\/^gluster[0-9]+$\\/\"
}"

Request   

POST api/virtualization/balancerplans

Body Parameters

planname  string  

Must not be greater than 255 characters.

cpuPriority  number optional  

Must be at least 0.01. Must not be greater than 99999.

cpuRequireIdlePercentage  number optional  

Must be at least 0.01. Must not be greater than 100.

storagePriority  number optional  

Must be at least 0.01. Must not be greater than 99999.

storageReserveFreeAmount  integer optional  

ramPriority  number optional  

Must be at least 0.01. Must not be greater than 99999.

ramReserveFreeAmount  integer optional  

vmCountPriority  number optional  

Must be at least 0.01. Must not be greater than 99999.

vmMaxAmount  integer optional  

Must be at least 1. Must not be greater than 999999.

vmMaxAmountPerCore  number optional  

Must be at least 0.01. Must not be greater than 99999.

nodeMustMatchRegex  string optional  

Must not be greater than 65535 characters.

nodeMustNotMatchRegex  string optional  

Must not be greater than 65535 characters.

GET api/virtualization/balancerplans/{id}

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/virtualization/balancerplans/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/virtualization/balancerplans/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/virtualization/balancerplans/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": "2024-09-04T13:06:10.000000Z",
        "updated_at": "2024-09-04T13:06:10.000000Z",
        "planname": "Balancer #1",
        "cpuPriority": 2,
        "cpuRequireIdlePercentage": 30,
        "storagePriority": 1,
        "storageReserveFreeAmount": 20,
        "ramPriority": 1.5,
        "ramReserveFreeAmount": 10,
        "vmCountPriority": 1,
        "vmMaxAmount": 50,
        "nodeMustMatchRegex": "/^node[0-9]+$/",
        "nodeMustNotMatchRegex": "/^gluster[0-9]+$/",
        "vmMaxAmountPerCore": null
    },
    "message": "success"
}
 

Request   

GET api/virtualization/balancerplans/{id}

URL Parameters

id  integer  

The ID of the VPS balancer plan.

PUT api/virtualization/balancerplans/{id}

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->put(
    'domain.com/api/virtualization/balancerplans/1',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'planname' => 'fivoxccsbgcejcbvixldpgtzqbnzasqcwdcoqwyizyrcgyfpxidjhhylxrivufahxjrrtsjraobliytsjcpxyxosdmdlehkirvgtaq',
            'cpuPriority' => 75036,
            'cpuRequireIdlePercentage' => 20,
            'storagePriority' => 87870,
            'storageReserveFreeAmount' => 5,
            'ramPriority' => 39486,
            'ramReserveFreeAmount' => 4,
            'vmCountPriority' => 98405,
            'vmMaxAmount' => 662985,
            'vmMaxAmountPerCore' => 27441,
            'nodeMustMatchRegex' => '/^node[0-9]+$/',
            'nodeMustNotMatchRegex' => '/^gluster[0-9]+$/',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/virtualization/balancerplans/1"
);

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

let body = {
    "planname": "fivoxccsbgcejcbvixldpgtzqbnzasqcwdcoqwyizyrcgyfpxidjhhylxrivufahxjrrtsjraobliytsjcpxyxosdmdlehkirvgtaq",
    "cpuPriority": 75036,
    "cpuRequireIdlePercentage": 20,
    "storagePriority": 87870,
    "storageReserveFreeAmount": 5,
    "ramPriority": 39486,
    "ramReserveFreeAmount": 4,
    "vmCountPriority": 98405,
    "vmMaxAmount": 662985,
    "vmMaxAmountPerCore": 27441,
    "nodeMustMatchRegex": "\/^node[0-9]+$\/",
    "nodeMustNotMatchRegex": "\/^gluster[0-9]+$\/"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request PUT \
    "domain.com/api/virtualization/balancerplans/1" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"planname\": \"fivoxccsbgcejcbvixldpgtzqbnzasqcwdcoqwyizyrcgyfpxidjhhylxrivufahxjrrtsjraobliytsjcpxyxosdmdlehkirvgtaq\",
    \"cpuPriority\": 75036,
    \"cpuRequireIdlePercentage\": 20,
    \"storagePriority\": 87870,
    \"storageReserveFreeAmount\": 5,
    \"ramPriority\": 39486,
    \"ramReserveFreeAmount\": 4,
    \"vmCountPriority\": 98405,
    \"vmMaxAmount\": 662985,
    \"vmMaxAmountPerCore\": 27441,
    \"nodeMustMatchRegex\": \"\\/^node[0-9]+$\\/\",
    \"nodeMustNotMatchRegex\": \"\\/^gluster[0-9]+$\\/\"
}"

Request   

PUT api/virtualization/balancerplans/{id}

PATCH api/virtualization/balancerplans/{id}

URL Parameters

id  integer  

The ID of the VPS balancer plan.

Body Parameters

planname  string optional  

Must not be greater than 255 characters.

cpuPriority  number optional  

Must be at least 0.01. Must not be greater than 99999.

cpuRequireIdlePercentage  number optional  

Must be at least 0.01. Must not be greater than 100.

storagePriority  number optional  

Must be at least 0.01. Must not be greater than 99999.

storageReserveFreeAmount  integer optional  

ramPriority  number optional  

Must be at least 0.01. Must not be greater than 99999.

ramReserveFreeAmount  integer optional  

vmCountPriority  number optional  

Must be at least 0.01. Must not be greater than 99999.

vmMaxAmount  integer optional  

Must be at least 1. Must not be greater than 999999.

vmMaxAmountPerCore  number optional  

Must be at least 0.01. Must not be greater than 99999.

nodeMustMatchRegex  string optional  

Must not be greater than 65535 characters.

nodeMustNotMatchRegex  string optional  

Must not be greater than 65535 characters.

DELETE api/virtualization/balancerplans/{id}

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->delete(
    'domain.com/api/virtualization/balancerplans/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/virtualization/balancerplans/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/virtualization/balancerplans/1" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Request   

DELETE api/virtualization/balancerplans/{id}

URL Parameters

id  integer  

The ID of the VPS balancer plan.