Server/Build
Build
Use this endpoint to build (or rebuild) the specified server. Before running the build method, you can use the other related endpoints to retrieve the required values, such as Operating System Templates and Swap Options to include in your request.
POST
/
server
/
{serverId}
/
build
Build
curl --request POST \
--url https://api.example.com/api/server/{serverId}/build \
--header 'Accept: <accept>' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"method": "template",
"templateId": 71,
"hostname": "test.example.com",
"name": "Example Server",
"timezone": "UTC",
"swap": 256,
"ipv6": true,
"sshKeys": [
1,
4,
8
],
"userData": ""
}
'import requests
url = "https://api.example.com/api/server/{serverId}/build"
payload = {
"method": "template",
"templateId": 71,
"hostname": "test.example.com",
"name": "Example Server",
"timezone": "UTC",
"swap": 256,
"ipv6": True,
"sshKeys": [1, 4, 8],
"userData": ""
}
headers = {
"Accept": "<accept>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Accept: '<accept>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
method: 'template',
templateId: 71,
hostname: 'test.example.com',
name: 'Example Server',
timezone: 'UTC',
swap: 256,
ipv6: true,
sshKeys: [1, 4, 8],
userData: ''
})
};
fetch('https://api.example.com/api/server/{serverId}/build', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/server/{serverId}/build",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'method' => 'template',
'templateId' => 71,
'hostname' => 'test.example.com',
'name' => 'Example Server',
'timezone' => 'UTC',
'swap' => 256,
'ipv6' => true,
'sshKeys' => [
1,
4,
8
],
'userData' => ''
]),
CURLOPT_HTTPHEADER => [
"Accept: <accept>",
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/server/{serverId}/build"
payload := strings.NewReader("{\n \"method\": \"template\",\n \"templateId\": 71,\n \"hostname\": \"test.example.com\",\n \"name\": \"Example Server\",\n \"timezone\": \"UTC\",\n \"swap\": 256,\n \"ipv6\": true,\n \"sshKeys\": [\n 1,\n 4,\n 8\n ],\n \"userData\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Accept", "<accept>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/api/server/{serverId}/build")
.header("Accept", "<accept>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"method\": \"template\",\n \"templateId\": 71,\n \"hostname\": \"test.example.com\",\n \"name\": \"Example Server\",\n \"timezone\": \"UTC\",\n \"swap\": 256,\n \"ipv6\": true,\n \"sshKeys\": [\n 1,\n 4,\n 8\n ],\n \"userData\": \"\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/server/{serverId}/build")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Accept"] = '<accept>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"method\": \"template\",\n \"templateId\": 71,\n \"hostname\": \"test.example.com\",\n \"name\": \"Example Server\",\n \"timezone\": \"UTC\",\n \"swap\": 256,\n \"ipv6\": true,\n \"sshKeys\": [\n 1,\n 4,\n 8\n ],\n \"userData\": \"\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"task": {
"id": 2892,
"status": "accepted"
}
}
}This response has no body data.{
"errors": [
"This is an error returned from the API",
"This is another error return from the API"
]
}{
"errors": [
"This is an error returned from the API",
"This is another error return from the API"
]
}{
"errors": [
"This is an error returned from the API",
"This is another error return from the API"
]
}This response has no body data.Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Available options:
application/json Path Parameters
Body
application/json
Available options:
template, self A template ID. This is only required when using the template method.
Available options:
Pacific/Midway, Pacific/Niue, Pacific/Pago_Pago, America/Adak, Pacific/Honolulu, Pacific/Rarotonga, Pacific/Tahiti, Pacific/Marquesas, America/Anchorage, America/Juneau, America/Metlakatla, America/Nome, America/Sitka, America/Yakutat, Pacific/Gambier, America/Los_Angeles, America/Tijuana, America/Vancouver, Pacific/Pitcairn, America/Boise, America/Cambridge_Bay, America/Chihuahua, America/Creston, America/Dawson, America/Dawson_Creek, America/Denver, America/Edmonton, America/Fort_Nelson, America/Hermosillo, America/Inuvik, America/Mazatlan, America/Ojinaga, America/Phoenix, America/Whitehorse, America/Yellowknife, America/Bahia_Banderas, America/Belize, America/Chicago, America/Costa_Rica, America/El_Salvador, America/Guatemala, America/Indiana/Knox, America/Indiana/Tell_City, America/Managua, America/Matamoros, America/Menominee, America/Merida, America/Mexico_City, America/Monterrey, America/North_Dakota/Beulah, America/North_Dakota/Center, America/North_Dakota/New_Salem, America/Rainy_River, America/Rankin_Inlet, America/Regina, America/Resolute, America/Swift_Current, America/Tegucigalpa, America/Winnipeg, Pacific/Galapagos, America/Atikokan, America/Bogota, America/Cancun, America/Cayman, America/Detroit, America/Eirunepe, America/Grand_Turk, America/Guayaquil, America/Havana, America/Indiana/Indianapolis, America/Indiana/Marengo, America/Indiana/Petersburg, America/Indiana/Vevay, America/Indiana/Vincennes, America/Indiana/Winamac, America/Iqaluit, America/Jamaica, America/Kentucky/Louisville, America/Kentucky/Monticello, America/Lima, America/Nassau, America/New_York, America/Nipigon, America/Panama, America/Pangnirtung, America/Port-au-Prince, America/Rio_Branco, America/Thunder_Bay, America/Toronto, Pacific/Easter, America/Anguilla, America/Antigua, America/Aruba, America/Barbados, America/Blanc-Sablon, America/Boa_Vista, America/Campo_Grande, America/Caracas, America/Cuiaba, America/Curacao, America/Dominica, America/Glace_Bay, America/Goose_Bay, America/Grenada, America/Guadeloupe, America/Guyana, America/Halifax, America/Kralendijk, America/La_Paz, America/Lower_Princes, America/Manaus, America/Marigot, America/Martinique, America/Moncton, America/Montserrat, America/Port_of_Spain, America/Porto_Velho, America/Puerto_Rico, America/Santo_Domingo, America/St_Barthelemy, America/St_Kitts, America/St_Lucia, America/St_Thomas, America/St_Vincent, America/Thule, America/Tortola, Atlantic/Bermuda, America/St_Johns, America/Araguaina, America/Argentina/Buenos_Aires, America/Argentina/Catamarca, America/Argentina/Cordoba, America/Argentina/Jujuy, America/Argentina/La_Rioja, America/Argentina/Mendoza, America/Argentina/Rio_Gallegos, America/Argentina/Salta, America/Argentina/San_Juan, America/Argentina/San_Luis, America/Argentina/Tucuman, America/Argentina/Ushuaia, America/Asuncion, America/Bahia, America/Belem, America/Cayenne, America/Fortaleza, America/Maceio, America/Miquelon, America/Montevideo, America/Nuuk, America/Paramaribo, America/Punta_Arenas, America/Recife, America/Santarem, America/Santiago, America/Sao_Paulo, Antarctica/Palmer, Antarctica/Rothera, Atlantic/Stanley, America/Noronha, Atlantic/South_Georgia, America/Scoresbysund, Atlantic/Azores, Atlantic/Cape_Verde, Africa/Abidjan, Africa/Accra, Africa/Bamako, Africa/Banjul, Africa/Bissau, Africa/Conakry, Africa/Dakar, Africa/Freetown, Africa/Lome, Africa/Monrovia, Africa/Nouakchott, Africa/Ouagadougou, Africa/Sao_Tome, America/Danmarkshavn, Antarctica/Troll, Atlantic/Canary, Atlantic/Faroe, Atlantic/Madeira, Atlantic/Reykjavik, Atlantic/St_Helena, Europe/Dublin, Europe/Guernsey, Europe/Isle_of_Man, Europe/Jersey, Europe/Lisbon, Europe/London, UTC, Africa/Algiers, Africa/Bangui, Africa/Brazzaville, Africa/Casablanca, Africa/Ceuta, Africa/Douala, Africa/El_Aaiun, Africa/Kinshasa, Africa/Lagos, Africa/Libreville, Africa/Luanda, Africa/Malabo, Africa/Ndjamena, Africa/Niamey, Africa/Porto-Novo, Africa/Tunis, Europe/Amsterdam, Europe/Andorra, Europe/Belgrade, Europe/Berlin, Europe/Bratislava, Europe/Brussels, Europe/Budapest, Europe/Busingen, Europe/Copenhagen, Europe/Gibraltar, Europe/Ljubljana, Europe/Luxembourg, Europe/Madrid, Europe/Malta, Europe/Monaco, Europe/Oslo, Europe/Paris, Europe/Podgorica, Europe/Prague, Europe/Rome, Europe/San_Marino, Europe/Sarajevo, Europe/Skopje, Europe/Stockholm, Europe/Tirane, Europe/Vaduz, Europe/Vatican, Europe/Vienna, Europe/Warsaw, Europe/Zagreb, Europe/Zurich, Africa/Blantyre, Africa/Bujumbura, Africa/Cairo, Africa/Gaborone, Africa/Harare, Africa/Johannesburg, Africa/Khartoum, Africa/Kigali, Africa/Lubumbashi, Africa/Lusaka, Africa/Maputo, Africa/Maseru, Africa/Mbabane, Africa/Tripoli, Africa/Windhoek, Asia/Amman, Asia/Beirut, Asia/Damascus, Asia/Famagusta, Asia/Gaza, Asia/Hebron, Asia/Jerusalem, Asia/Nicosia, Europe/Athens, Europe/Bucharest, Europe/Chisinau, Europe/Helsinki, Europe/Kaliningrad, Europe/Kiev, Europe/Mariehamn, Europe/Riga, Europe/Sofia, Europe/Tallinn, Europe/Uzhgorod, Europe/Vilnius, Europe/Zaporozhye, Africa/Addis_Ababa, Africa/Asmara, Africa/Dar_es_Salaam, Africa/Djibouti, Africa/Juba, Africa/Kampala, Africa/Mogadishu, Africa/Nairobi, Antarctica/Syowa, Asia/Aden, Asia/Baghdad, Asia/Bahrain, Asia/Kuwait, Asia/Qatar, Asia/Riyadh, Europe/Istanbul, Europe/Kirov, Europe/Minsk, Europe/Moscow, Europe/Simferopol, Indian/Antananarivo, Indian/Comoro, Indian/Mayotte, Asia/Tehran, Asia/Baku, Asia/Dubai, Asia/Muscat, Asia/Tbilisi, Asia/Yerevan, Europe/Astrakhan, Europe/Samara, Europe/Saratov, Europe/Ulyanovsk, Europe/Volgograd, Indian/Mahe, Indian/Mauritius, Indian/Reunion, Asia/Kabul, Antarctica/Mawson, Asia/Aqtau, Asia/Aqtobe, Asia/Ashgabat, Asia/Atyrau, Asia/Dushanbe, Asia/Karachi, Asia/Oral, Asia/Qyzylorda, Asia/Samarkand, Asia/Tashkent, Asia/Yekaterinburg, Indian/Kerguelen, Indian/Maldives, Asia/Colombo, Asia/Kolkata, Asia/Kathmandu, Antarctica/Vostok, Asia/Almaty, Asia/Bishkek, Asia/Dhaka, Asia/Omsk, Asia/Qostanay, Asia/Thimphu, Asia/Urumqi, Indian/Chagos, Asia/Yangon, Indian/Cocos, Antarctica/Davis, Asia/Bangkok, Asia/Barnaul, Asia/Ho_Chi_Minh, Asia/Hovd, Asia/Jakarta, Asia/Krasnoyarsk, Asia/Novokuznetsk, Asia/Novosibirsk, Asia/Phnom_Penh, Asia/Pontianak, Asia/Tomsk, Asia/Vientiane, Indian/Christmas, Asia/Brunei, Asia/Choibalsan, Asia/Hong_Kong, Asia/Irkutsk, Asia/Kuala_Lumpur, Asia/Kuching, Asia/Macau, Asia/Makassar, Asia/Manila, Asia/Shanghai, Asia/Singapore, Asia/Taipei, Asia/Ulaanbaatar, Australia/Perth, Australia/Eucla, Asia/Chita, Asia/Dili, Asia/Jayapura, Asia/Khandyga, Asia/Pyongyang, Asia/Seoul, Asia/Tokyo, Asia/Yakutsk, Pacific/Palau, Australia/Darwin, Antarctica/DumontDUrville, Asia/Ust-Nera, Asia/Vladivostok, Australia/Brisbane, Australia/Lindeman, Pacific/Chuuk, Pacific/Guam, Pacific/Port_Moresby, Pacific/Saipan, Australia/Adelaide, Australia/Broken_Hill, Antarctica/Casey, Antarctica/Macquarie, Asia/Magadan, Asia/Sakhalin, Asia/Srednekolymsk, Australia/Currie, Australia/Hobart, Australia/Lord_Howe, Australia/Melbourne, Australia/Sydney, Pacific/Bougainville, Pacific/Efate, Pacific/Guadalcanal, Pacific/Kosrae, Pacific/Noumea, Pacific/Pohnpei, Asia/Anadyr, Asia/Kamchatka, Pacific/Fiji, Pacific/Funafuti, Pacific/Kwajalein, Pacific/Majuro, Pacific/Nauru, Pacific/Norfolk, Pacific/Tarawa, Pacific/Wake, Pacific/Wallis, Antarctica/McMurdo, Pacific/Auckland, Pacific/Enderbury, Pacific/Fakaofo, Pacific/Tongatapu, Pacific/Chatham, Pacific/Apia, Pacific/Kiritimati Valid cloud-init user_data as referenced here https://cloudinit.readthedocs.io/en/latest/reference/examples.html
Response
Show child attributes
Show child attributes
⌘I
Build
curl --request POST \
--url https://api.example.com/api/server/{serverId}/build \
--header 'Accept: <accept>' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"method": "template",
"templateId": 71,
"hostname": "test.example.com",
"name": "Example Server",
"timezone": "UTC",
"swap": 256,
"ipv6": true,
"sshKeys": [
1,
4,
8
],
"userData": ""
}
'import requests
url = "https://api.example.com/api/server/{serverId}/build"
payload = {
"method": "template",
"templateId": 71,
"hostname": "test.example.com",
"name": "Example Server",
"timezone": "UTC",
"swap": 256,
"ipv6": True,
"sshKeys": [1, 4, 8],
"userData": ""
}
headers = {
"Accept": "<accept>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Accept: '<accept>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
method: 'template',
templateId: 71,
hostname: 'test.example.com',
name: 'Example Server',
timezone: 'UTC',
swap: 256,
ipv6: true,
sshKeys: [1, 4, 8],
userData: ''
})
};
fetch('https://api.example.com/api/server/{serverId}/build', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/server/{serverId}/build",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'method' => 'template',
'templateId' => 71,
'hostname' => 'test.example.com',
'name' => 'Example Server',
'timezone' => 'UTC',
'swap' => 256,
'ipv6' => true,
'sshKeys' => [
1,
4,
8
],
'userData' => ''
]),
CURLOPT_HTTPHEADER => [
"Accept: <accept>",
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/server/{serverId}/build"
payload := strings.NewReader("{\n \"method\": \"template\",\n \"templateId\": 71,\n \"hostname\": \"test.example.com\",\n \"name\": \"Example Server\",\n \"timezone\": \"UTC\",\n \"swap\": 256,\n \"ipv6\": true,\n \"sshKeys\": [\n 1,\n 4,\n 8\n ],\n \"userData\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Accept", "<accept>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/api/server/{serverId}/build")
.header("Accept", "<accept>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"method\": \"template\",\n \"templateId\": 71,\n \"hostname\": \"test.example.com\",\n \"name\": \"Example Server\",\n \"timezone\": \"UTC\",\n \"swap\": 256,\n \"ipv6\": true,\n \"sshKeys\": [\n 1,\n 4,\n 8\n ],\n \"userData\": \"\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/server/{serverId}/build")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Accept"] = '<accept>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"method\": \"template\",\n \"templateId\": 71,\n \"hostname\": \"test.example.com\",\n \"name\": \"Example Server\",\n \"timezone\": \"UTC\",\n \"swap\": 256,\n \"ipv6\": true,\n \"sshKeys\": [\n 1,\n 4,\n 8\n ],\n \"userData\": \"\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"task": {
"id": 2892,
"status": "accepted"
}
}
}This response has no body data.{
"errors": [
"This is an error returned from the API",
"This is another error return from the API"
]
}{
"errors": [
"This is an error returned from the API",
"This is another error return from the API"
]
}{
"errors": [
"This is an error returned from the API",
"This is another error return from the API"
]
}This response has no body data.