curl --request POST \
--url https://console.advinservers.com/api/v1/client/user-scripts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "HEV telemetry agent",
"type": "cloud-config",
"content": "#cloud-config\npackage_update: true\npackages:\n - nginx\n - prometheus-node-exporter\nwrite_files:\n - path: /etc/hev/telemetry.env\n content: |\n SECTOR=C\n LAB=anomalous-materials\nruncmd:\n - systemctl enable --now nginx prometheus-node-exporter\n"
}
'import requests
url = "https://console.advinservers.com/api/v1/client/user-scripts"
payload = {
"name": "HEV telemetry agent",
"type": "cloud-config",
"content": "#cloud-config
package_update: true
packages:
- nginx
- prometheus-node-exporter
write_files:
- path: /etc/hev/telemetry.env
content: |
SECTOR=C
LAB=anomalous-materials
runcmd:
- systemctl enable --now nginx prometheus-node-exporter
"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'HEV telemetry agent',
type: 'cloud-config',
content: '#cloud-config\npackage_update: true\npackages:\n - nginx\n - prometheus-node-exporter\nwrite_files:\n - path: /etc/hev/telemetry.env\n content: |\n SECTOR=C\n LAB=anomalous-materials\nruncmd:\n - systemctl enable --now nginx prometheus-node-exporter\n'
})
};
fetch('https://console.advinservers.com/api/v1/client/user-scripts', 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://console.advinservers.com/api/v1/client/user-scripts",
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([
'name' => 'HEV telemetry agent',
'type' => 'cloud-config',
'content' => '#cloud-config
package_update: true
packages:
- nginx
- prometheus-node-exporter
write_files:
- path: /etc/hev/telemetry.env
content: |
SECTOR=C
LAB=anomalous-materials
runcmd:
- systemctl enable --now nginx prometheus-node-exporter
'
]),
CURLOPT_HTTPHEADER => [
"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://console.advinservers.com/api/v1/client/user-scripts"
payload := strings.NewReader("{\n \"name\": \"HEV telemetry agent\",\n \"type\": \"cloud-config\",\n \"content\": \"#cloud-config\\npackage_update: true\\npackages:\\n - nginx\\n - prometheus-node-exporter\\nwrite_files:\\n - path: /etc/hev/telemetry.env\\n content: |\\n SECTOR=C\\n LAB=anomalous-materials\\nruncmd:\\n - systemctl enable --now nginx prometheus-node-exporter\\n\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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://console.advinservers.com/api/v1/client/user-scripts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"HEV telemetry agent\",\n \"type\": \"cloud-config\",\n \"content\": \"#cloud-config\\npackage_update: true\\npackages:\\n - nginx\\n - prometheus-node-exporter\\nwrite_files:\\n - path: /etc/hev/telemetry.env\\n content: |\\n SECTOR=C\\n LAB=anomalous-materials\\nruncmd:\\n - systemctl enable --now nginx prometheus-node-exporter\\n\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://console.advinservers.com/api/v1/client/user-scripts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"HEV telemetry agent\",\n \"type\": \"cloud-config\",\n \"content\": \"#cloud-config\\npackage_update: true\\npackages:\\n - nginx\\n - prometheus-node-exporter\\nwrite_files:\\n - path: /etc/hev/telemetry.env\\n content: |\\n SECTOR=C\\n LAB=anomalous-materials\\nruncmd:\\n - systemctl enable --now nginx prometheus-node-exporter\\n\"\n}"
response = http.request(request)
puts response.read_body{
"id": "8edb21bc-9aee-4bd9-8a02-17043fa82a87",
"name": "HEV telemetry agent",
"type": "cloud-config",
"content": "#cloud-config\npackage_update: true\npackages:\n - nginx\n - prometheus-node-exporter\nwrite_files:\n - path: /etc/hev/telemetry.env\n content: |\n SECTOR=C\n LAB=anomalous-materials\nruncmd:\n - systemctl enable --now nginx prometheus-node-exporter\n",
"owner": {
"name": "Gordon Freeman",
"email": "gordon.freeman@blackmesa.example.com"
},
"created_at": "2026-03-02T18:58:40+00:00",
"updated_at": "2026-06-19T10:12:05+00:00"
}{
"message": "Unauthenticated."
}{
"message": "This API key is not allowed to do that in this team. It needs the \"snapshot.delete\" permission."
}{
"message": "The name field is required.",
"errors": {}
}{
"message": "Too Many Attempts."
}Add a setup script
Overview
Adds a setup script for future server reinstalls. The script runs on the first boot after a reinstall that selects it. Existing servers are not changed.
Send type as cloud-config to merge settings with the operating system image’s configuration, or bash to run a shell script. Send a unique account-wide name of up to 64 characters and content of up to 1 MiB.
Permissions
Requires the script.update (Manage setup scripts) permission for the selected team. Resources outside that team return 404.
curl --request POST \
--url https://console.advinservers.com/api/v1/client/user-scripts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "HEV telemetry agent",
"type": "cloud-config",
"content": "#cloud-config\npackage_update: true\npackages:\n - nginx\n - prometheus-node-exporter\nwrite_files:\n - path: /etc/hev/telemetry.env\n content: |\n SECTOR=C\n LAB=anomalous-materials\nruncmd:\n - systemctl enable --now nginx prometheus-node-exporter\n"
}
'import requests
url = "https://console.advinservers.com/api/v1/client/user-scripts"
payload = {
"name": "HEV telemetry agent",
"type": "cloud-config",
"content": "#cloud-config
package_update: true
packages:
- nginx
- prometheus-node-exporter
write_files:
- path: /etc/hev/telemetry.env
content: |
SECTOR=C
LAB=anomalous-materials
runcmd:
- systemctl enable --now nginx prometheus-node-exporter
"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'HEV telemetry agent',
type: 'cloud-config',
content: '#cloud-config\npackage_update: true\npackages:\n - nginx\n - prometheus-node-exporter\nwrite_files:\n - path: /etc/hev/telemetry.env\n content: |\n SECTOR=C\n LAB=anomalous-materials\nruncmd:\n - systemctl enable --now nginx prometheus-node-exporter\n'
})
};
fetch('https://console.advinservers.com/api/v1/client/user-scripts', 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://console.advinservers.com/api/v1/client/user-scripts",
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([
'name' => 'HEV telemetry agent',
'type' => 'cloud-config',
'content' => '#cloud-config
package_update: true
packages:
- nginx
- prometheus-node-exporter
write_files:
- path: /etc/hev/telemetry.env
content: |
SECTOR=C
LAB=anomalous-materials
runcmd:
- systemctl enable --now nginx prometheus-node-exporter
'
]),
CURLOPT_HTTPHEADER => [
"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://console.advinservers.com/api/v1/client/user-scripts"
payload := strings.NewReader("{\n \"name\": \"HEV telemetry agent\",\n \"type\": \"cloud-config\",\n \"content\": \"#cloud-config\\npackage_update: true\\npackages:\\n - nginx\\n - prometheus-node-exporter\\nwrite_files:\\n - path: /etc/hev/telemetry.env\\n content: |\\n SECTOR=C\\n LAB=anomalous-materials\\nruncmd:\\n - systemctl enable --now nginx prometheus-node-exporter\\n\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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://console.advinservers.com/api/v1/client/user-scripts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"HEV telemetry agent\",\n \"type\": \"cloud-config\",\n \"content\": \"#cloud-config\\npackage_update: true\\npackages:\\n - nginx\\n - prometheus-node-exporter\\nwrite_files:\\n - path: /etc/hev/telemetry.env\\n content: |\\n SECTOR=C\\n LAB=anomalous-materials\\nruncmd:\\n - systemctl enable --now nginx prometheus-node-exporter\\n\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://console.advinservers.com/api/v1/client/user-scripts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"HEV telemetry agent\",\n \"type\": \"cloud-config\",\n \"content\": \"#cloud-config\\npackage_update: true\\npackages:\\n - nginx\\n - prometheus-node-exporter\\nwrite_files:\\n - path: /etc/hev/telemetry.env\\n content: |\\n SECTOR=C\\n LAB=anomalous-materials\\nruncmd:\\n - systemctl enable --now nginx prometheus-node-exporter\\n\"\n}"
response = http.request(request)
puts response.read_body{
"id": "8edb21bc-9aee-4bd9-8a02-17043fa82a87",
"name": "HEV telemetry agent",
"type": "cloud-config",
"content": "#cloud-config\npackage_update: true\npackages:\n - nginx\n - prometheus-node-exporter\nwrite_files:\n - path: /etc/hev/telemetry.env\n content: |\n SECTOR=C\n LAB=anomalous-materials\nruncmd:\n - systemctl enable --now nginx prometheus-node-exporter\n",
"owner": {
"name": "Gordon Freeman",
"email": "gordon.freeman@blackmesa.example.com"
},
"created_at": "2026-03-02T18:58:40+00:00",
"updated_at": "2026-06-19T10:12:05+00:00"
}{
"message": "Unauthenticated."
}{
"message": "This API key is not allowed to do that in this team. It needs the \"snapshot.delete\" permission."
}{
"message": "The name field is required.",
"errors": {}
}{
"message": "Too Many Attempts."
}Authorizations
Your API key, sent as a bearer token. Create one in the control panel under API Keys, give it only the permissions the integration needs, and copy it when it is created. It cannot be shown again. Each key is restricted to one owned team. The key determines the team for every request.
Body
Send a JSON object containing the fields below. Required fields are marked in the schema.
A name unique across the account, 1 to 64 characters, without control characters.
"HEV telemetry agent"
Use cloud-config for configuration settings or bash for a shell script.
cloud-config, bash "cloud-config"
The complete script, up to 1 MiB.
"#cloud-config\npackage_update: true\npackages:\n - nginx\n - prometheus-node-exporter\nwrite_files:\n - path: /etc/hev/telemetry.env\n content: |\n SECTOR=C\n LAB=anomalous-materials\nruncmd:\n - systemctl enable --now nginx prometheus-node-exporter\n"
Response
The record, as a JSON object. There is no envelope.
A script that runs while a server is provisioned.
The uuid. A script's autoincrement id never leaves the server.
"8edb21bc-9aee-4bd9-8a02-17043fa82a87"
The name shown to customers.
"HEV telemetry agent"
The type of operation or resource.
cloud-config, bash "cloud-config"
The complete script content, which may contain credentials. Stored encrypted and readable by its owner.
"#cloud-config\npackage_update: true\npackages:\n - nginx\n - prometheus-node-exporter\nwrite_files:\n - path: /etc/hev/telemetry.env\n content: |\n SECTOR=C\n LAB=anomalous-materials\nruncmd:\n - systemctl enable --now nginx prometheus-node-exporter\n"
The value of owner.
Show child attributes
Show child attributes
{ "name": "Gordon Freeman", "email": "gordon.freeman@blackmesa.example.com" }
The date and time for created at, in UTC.
"2026-03-02T18:58:40+00:00"
The date and time for updated at, in UTC.
"2026-06-19T10:12:05+00:00"