Typescript (SDK)
import { Latitudesh } from "latitudesh-typescript-sdk";
const latitudesh = new Latitudesh({
bearer: process.env["LATITUDESH_BEARER"] ?? "",
});
async function run() {
const result = await latitudesh.baselinesPreview.createBaseline({
data: {
type: "baselines",
attributes: {
name: "web-fleet-v3",
description: "Standard build for the public web tier",
targetType: "platforms",
operatingSystem: "ubuntu_22_04_x64_lts",
platforms: [
"g3-l40s-small-76",
],
sshKeyIds: [
"ssh_RLYV8DZ2D5QoE",
],
userDataId: "ud_r0MK4O4kDa95w",
diskLayout: [
{
role: "os",
count: 2,
raidLevel: "raid-1",
},
{
role: "storage",
count: 2,
filesystem: "ext4",
mountPoint: "/data",
},
],
bios: {},
},
},
});
console.log(result);
}
run();package main
import(
"context"
"os"
latitudeshgosdk "github.com/latitudesh/latitudesh-go-sdk"
"github.com/latitudesh/latitudesh-go-sdk/models/operations"
"github.com/latitudesh/latitudesh-go-sdk/models/components"
"log"
)
func main() {
ctx := context.Background()
s := latitudeshgosdk.New(
latitudeshgosdk.WithSecurity(os.Getenv("LATITUDESH_BEARER")),
)
res, err := s.BaselinesPreview.CreateBaseline(ctx, operations.CreateBaselineBaselinesPreviewRequestBody{
Data: &operations.CreateBaselineData{
Type: operations.CreateBaselineTypeBaselines.ToPointer(),
Attributes: &operations.CreateBaselineAttributes{
Name: "web-fleet-v3",
Description: latitudeshgosdk.Pointer("Standard build for the public web tier"),
TargetType: operations.CreateBaselineTargetTypePlatforms,
OperatingSystem: "ubuntu_22_04_x64_lts",
Platforms: []string{
"g3-l40s-small-76",
},
SSHKeyIds: []string{
"ssh_RLYV8DZ2D5QoE",
},
UserDataID: latitudeshgosdk.Pointer("ud_r0MK4O4kDa95w"),
DiskLayout: []components.BaselineDiskLayoutGroup{
components.BaselineDiskLayoutGroup{
Role: components.BaselineDiskLayoutGroupRoleOs.ToPointer(),
Count: latitudeshgosdk.Pointer[int64](2),
RaidLevel: components.RaidLevelRaid1.ToPointer(),
},
components.BaselineDiskLayoutGroup{
Role: components.BaselineDiskLayoutGroupRoleStorage.ToPointer(),
Count: latitudeshgosdk.Pointer[int64](2),
Filesystem: components.FilesystemExt4.ToPointer(),
MountPoint: latitudeshgosdk.Pointer("/data"),
},
},
Bios: &operations.CreateBaselineBios{},
},
},
})
if err != nil {
log.Fatal(err)
}
if res.Baseline != nil {
// handle response
}
}curl --request POST \
--url https://api.latitude.sh/baselines \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"data": {
"type": "baselines",
"attributes": {
"name": "web-fleet-v3",
"description": "Standard build for the public web tier",
"target_type": "platforms",
"operating_system": "ubuntu_22_04_x64_lts",
"platforms": [
"g3-l40s-small-76"
],
"ssh_key_ids": [
"ssh_RLYV8DZ2D5QoE"
],
"user_data_id": "ud_r0MK4O4kDa95w",
"disk_layout": [
{
"role": "os",
"count": 2,
"raid_level": "raid-1"
},
{
"role": "storage",
"count": 2,
"filesystem": "ext4",
"mount_point": "/data"
}
],
"bios": {
"smt": true,
"cstates": false
}
}
}
}
'import requests
url = "https://api.latitude.sh/baselines"
payload = { "data": {
"type": "baselines",
"attributes": {
"name": "web-fleet-v3",
"description": "Standard build for the public web tier",
"target_type": "platforms",
"operating_system": "ubuntu_22_04_x64_lts",
"platforms": ["g3-l40s-small-76"],
"ssh_key_ids": ["ssh_RLYV8DZ2D5QoE"],
"user_data_id": "ud_r0MK4O4kDa95w",
"disk_layout": [
{
"role": "os",
"count": 2,
"raid_level": "raid-1"
},
{
"role": "storage",
"count": 2,
"filesystem": "ext4",
"mount_point": "/data"
}
],
"bios": {
"smt": True,
"cstates": False
}
}
} }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
data: {
type: 'baselines',
attributes: {
name: 'web-fleet-v3',
description: 'Standard build for the public web tier',
target_type: 'platforms',
operating_system: 'ubuntu_22_04_x64_lts',
platforms: ['g3-l40s-small-76'],
ssh_key_ids: ['ssh_RLYV8DZ2D5QoE'],
user_data_id: 'ud_r0MK4O4kDa95w',
disk_layout: [
{role: 'os', count: 2, raid_level: 'raid-1'},
{role: 'storage', count: 2, filesystem: 'ext4', mount_point: '/data'}
],
bios: {smt: true, cstates: false}
}
}
})
};
fetch('https://api.latitude.sh/baselines', 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.latitude.sh/baselines",
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([
'data' => [
'type' => 'baselines',
'attributes' => [
'name' => 'web-fleet-v3',
'description' => 'Standard build for the public web tier',
'target_type' => 'platforms',
'operating_system' => 'ubuntu_22_04_x64_lts',
'platforms' => [
'g3-l40s-small-76'
],
'ssh_key_ids' => [
'ssh_RLYV8DZ2D5QoE'
],
'user_data_id' => 'ud_r0MK4O4kDa95w',
'disk_layout' => [
[
'role' => 'os',
'count' => 2,
'raid_level' => 'raid-1'
],
[
'role' => 'storage',
'count' => 2,
'filesystem' => 'ext4',
'mount_point' => '/data'
]
],
'bios' => [
'smt' => true,
'cstates' => false
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.post("https://api.latitude.sh/baselines")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"type\": \"baselines\",\n \"attributes\": {\n \"name\": \"web-fleet-v3\",\n \"description\": \"Standard build for the public web tier\",\n \"target_type\": \"platforms\",\n \"operating_system\": \"ubuntu_22_04_x64_lts\",\n \"platforms\": [\n \"g3-l40s-small-76\"\n ],\n \"ssh_key_ids\": [\n \"ssh_RLYV8DZ2D5QoE\"\n ],\n \"user_data_id\": \"ud_r0MK4O4kDa95w\",\n \"disk_layout\": [\n {\n \"role\": \"os\",\n \"count\": 2,\n \"raid_level\": \"raid-1\"\n },\n {\n \"role\": \"storage\",\n \"count\": 2,\n \"filesystem\": \"ext4\",\n \"mount_point\": \"/data\"\n }\n ],\n \"bios\": {\n \"smt\": true,\n \"cstates\": false\n }\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.latitude.sh/baselines")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"data\": {\n \"type\": \"baselines\",\n \"attributes\": {\n \"name\": \"web-fleet-v3\",\n \"description\": \"Standard build for the public web tier\",\n \"target_type\": \"platforms\",\n \"operating_system\": \"ubuntu_22_04_x64_lts\",\n \"platforms\": [\n \"g3-l40s-small-76\"\n ],\n \"ssh_key_ids\": [\n \"ssh_RLYV8DZ2D5QoE\"\n ],\n \"user_data_id\": \"ud_r0MK4O4kDa95w\",\n \"disk_layout\": [\n {\n \"role\": \"os\",\n \"count\": 2,\n \"raid_level\": \"raid-1\"\n },\n {\n \"role\": \"storage\",\n \"count\": 2,\n \"filesystem\": \"ext4\",\n \"mount_point\": \"/data\"\n }\n ],\n \"bios\": {\n \"smt\": true,\n \"cstates\": false\n }\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "bl_VaNmodjeObE8W",
"type": "baselines",
"attributes": {
"name": "web-fleet-v3",
"description": "Standard build for the public web tier",
"target_type": "platforms",
"operating_system": "ubuntu_22_04_x64_lts",
"platforms": [
{
"id": "plan_1R3zq24bOWxyn",
"slug": "g3-l40s-small-76",
"name": "g3.l40s.small-76"
}
],
"ssh_keys": [
{
"id": "ssh_RLYV8DZ2D5QoE",
"name": "lindgren.example",
"fingerprint": "45:de:3e:19:41:1d:0e:8d:c8:22:70:34:db:5f:67:4b"
}
],
"user_data": {
"id": "ud_r0MK4O4kDa95w",
"description": "Two buttermilk waffles, topped with whipped cream and maple syrup, a side of two eggs served any style, and your choice of smoked bacon or smoked ham."
},
"disk_layout": [
{
"count": 2,
"role": "os",
"raid_level": "raid-1"
},
{
"count": 2,
"role": "storage",
"filesystem": "ext4",
"mount_point": "/data"
}
],
"bios": {
"smt": true,
"cstates": false
},
"created_at": "2026-07-30T16:21:19.430Z"
}
}
}Baselines (Preview)
Create baseline
Preview. Available to teams with the baselines_api feature flag.
Create a baseline in the team. A baseline can target all servers, a custom set (when the plan is not yet known), or one or more specific platforms. When it targets platforms, the disk layout is validated by the same rules a deploy applies — against the smallest of the selected platforms — so a baseline that saves here can be dispatched verbatim.
POST
/
baselines
Typescript (SDK)
import { Latitudesh } from "latitudesh-typescript-sdk";
const latitudesh = new Latitudesh({
bearer: process.env["LATITUDESH_BEARER"] ?? "",
});
async function run() {
const result = await latitudesh.baselinesPreview.createBaseline({
data: {
type: "baselines",
attributes: {
name: "web-fleet-v3",
description: "Standard build for the public web tier",
targetType: "platforms",
operatingSystem: "ubuntu_22_04_x64_lts",
platforms: [
"g3-l40s-small-76",
],
sshKeyIds: [
"ssh_RLYV8DZ2D5QoE",
],
userDataId: "ud_r0MK4O4kDa95w",
diskLayout: [
{
role: "os",
count: 2,
raidLevel: "raid-1",
},
{
role: "storage",
count: 2,
filesystem: "ext4",
mountPoint: "/data",
},
],
bios: {},
},
},
});
console.log(result);
}
run();package main
import(
"context"
"os"
latitudeshgosdk "github.com/latitudesh/latitudesh-go-sdk"
"github.com/latitudesh/latitudesh-go-sdk/models/operations"
"github.com/latitudesh/latitudesh-go-sdk/models/components"
"log"
)
func main() {
ctx := context.Background()
s := latitudeshgosdk.New(
latitudeshgosdk.WithSecurity(os.Getenv("LATITUDESH_BEARER")),
)
res, err := s.BaselinesPreview.CreateBaseline(ctx, operations.CreateBaselineBaselinesPreviewRequestBody{
Data: &operations.CreateBaselineData{
Type: operations.CreateBaselineTypeBaselines.ToPointer(),
Attributes: &operations.CreateBaselineAttributes{
Name: "web-fleet-v3",
Description: latitudeshgosdk.Pointer("Standard build for the public web tier"),
TargetType: operations.CreateBaselineTargetTypePlatforms,
OperatingSystem: "ubuntu_22_04_x64_lts",
Platforms: []string{
"g3-l40s-small-76",
},
SSHKeyIds: []string{
"ssh_RLYV8DZ2D5QoE",
},
UserDataID: latitudeshgosdk.Pointer("ud_r0MK4O4kDa95w"),
DiskLayout: []components.BaselineDiskLayoutGroup{
components.BaselineDiskLayoutGroup{
Role: components.BaselineDiskLayoutGroupRoleOs.ToPointer(),
Count: latitudeshgosdk.Pointer[int64](2),
RaidLevel: components.RaidLevelRaid1.ToPointer(),
},
components.BaselineDiskLayoutGroup{
Role: components.BaselineDiskLayoutGroupRoleStorage.ToPointer(),
Count: latitudeshgosdk.Pointer[int64](2),
Filesystem: components.FilesystemExt4.ToPointer(),
MountPoint: latitudeshgosdk.Pointer("/data"),
},
},
Bios: &operations.CreateBaselineBios{},
},
},
})
if err != nil {
log.Fatal(err)
}
if res.Baseline != nil {
// handle response
}
}curl --request POST \
--url https://api.latitude.sh/baselines \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"data": {
"type": "baselines",
"attributes": {
"name": "web-fleet-v3",
"description": "Standard build for the public web tier",
"target_type": "platforms",
"operating_system": "ubuntu_22_04_x64_lts",
"platforms": [
"g3-l40s-small-76"
],
"ssh_key_ids": [
"ssh_RLYV8DZ2D5QoE"
],
"user_data_id": "ud_r0MK4O4kDa95w",
"disk_layout": [
{
"role": "os",
"count": 2,
"raid_level": "raid-1"
},
{
"role": "storage",
"count": 2,
"filesystem": "ext4",
"mount_point": "/data"
}
],
"bios": {
"smt": true,
"cstates": false
}
}
}
}
'import requests
url = "https://api.latitude.sh/baselines"
payload = { "data": {
"type": "baselines",
"attributes": {
"name": "web-fleet-v3",
"description": "Standard build for the public web tier",
"target_type": "platforms",
"operating_system": "ubuntu_22_04_x64_lts",
"platforms": ["g3-l40s-small-76"],
"ssh_key_ids": ["ssh_RLYV8DZ2D5QoE"],
"user_data_id": "ud_r0MK4O4kDa95w",
"disk_layout": [
{
"role": "os",
"count": 2,
"raid_level": "raid-1"
},
{
"role": "storage",
"count": 2,
"filesystem": "ext4",
"mount_point": "/data"
}
],
"bios": {
"smt": True,
"cstates": False
}
}
} }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
data: {
type: 'baselines',
attributes: {
name: 'web-fleet-v3',
description: 'Standard build for the public web tier',
target_type: 'platforms',
operating_system: 'ubuntu_22_04_x64_lts',
platforms: ['g3-l40s-small-76'],
ssh_key_ids: ['ssh_RLYV8DZ2D5QoE'],
user_data_id: 'ud_r0MK4O4kDa95w',
disk_layout: [
{role: 'os', count: 2, raid_level: 'raid-1'},
{role: 'storage', count: 2, filesystem: 'ext4', mount_point: '/data'}
],
bios: {smt: true, cstates: false}
}
}
})
};
fetch('https://api.latitude.sh/baselines', 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.latitude.sh/baselines",
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([
'data' => [
'type' => 'baselines',
'attributes' => [
'name' => 'web-fleet-v3',
'description' => 'Standard build for the public web tier',
'target_type' => 'platforms',
'operating_system' => 'ubuntu_22_04_x64_lts',
'platforms' => [
'g3-l40s-small-76'
],
'ssh_key_ids' => [
'ssh_RLYV8DZ2D5QoE'
],
'user_data_id' => 'ud_r0MK4O4kDa95w',
'disk_layout' => [
[
'role' => 'os',
'count' => 2,
'raid_level' => 'raid-1'
],
[
'role' => 'storage',
'count' => 2,
'filesystem' => 'ext4',
'mount_point' => '/data'
]
],
'bios' => [
'smt' => true,
'cstates' => false
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.post("https://api.latitude.sh/baselines")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"type\": \"baselines\",\n \"attributes\": {\n \"name\": \"web-fleet-v3\",\n \"description\": \"Standard build for the public web tier\",\n \"target_type\": \"platforms\",\n \"operating_system\": \"ubuntu_22_04_x64_lts\",\n \"platforms\": [\n \"g3-l40s-small-76\"\n ],\n \"ssh_key_ids\": [\n \"ssh_RLYV8DZ2D5QoE\"\n ],\n \"user_data_id\": \"ud_r0MK4O4kDa95w\",\n \"disk_layout\": [\n {\n \"role\": \"os\",\n \"count\": 2,\n \"raid_level\": \"raid-1\"\n },\n {\n \"role\": \"storage\",\n \"count\": 2,\n \"filesystem\": \"ext4\",\n \"mount_point\": \"/data\"\n }\n ],\n \"bios\": {\n \"smt\": true,\n \"cstates\": false\n }\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.latitude.sh/baselines")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"data\": {\n \"type\": \"baselines\",\n \"attributes\": {\n \"name\": \"web-fleet-v3\",\n \"description\": \"Standard build for the public web tier\",\n \"target_type\": \"platforms\",\n \"operating_system\": \"ubuntu_22_04_x64_lts\",\n \"platforms\": [\n \"g3-l40s-small-76\"\n ],\n \"ssh_key_ids\": [\n \"ssh_RLYV8DZ2D5QoE\"\n ],\n \"user_data_id\": \"ud_r0MK4O4kDa95w\",\n \"disk_layout\": [\n {\n \"role\": \"os\",\n \"count\": 2,\n \"raid_level\": \"raid-1\"\n },\n {\n \"role\": \"storage\",\n \"count\": 2,\n \"filesystem\": \"ext4\",\n \"mount_point\": \"/data\"\n }\n ],\n \"bios\": {\n \"smt\": true,\n \"cstates\": false\n }\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "bl_VaNmodjeObE8W",
"type": "baselines",
"attributes": {
"name": "web-fleet-v3",
"description": "Standard build for the public web tier",
"target_type": "platforms",
"operating_system": "ubuntu_22_04_x64_lts",
"platforms": [
{
"id": "plan_1R3zq24bOWxyn",
"slug": "g3-l40s-small-76",
"name": "g3.l40s.small-76"
}
],
"ssh_keys": [
{
"id": "ssh_RLYV8DZ2D5QoE",
"name": "lindgren.example",
"fingerprint": "45:de:3e:19:41:1d:0e:8d:c8:22:70:34:db:5f:67:4b"
}
],
"user_data": {
"id": "ud_r0MK4O4kDa95w",
"description": "Two buttermilk waffles, topped with whipped cream and maple syrup, a side of two eggs served any style, and your choice of smoked bacon or smoked ham."
},
"disk_layout": [
{
"count": 2,
"role": "os",
"raid_level": "raid-1"
},
{
"count": 2,
"role": "storage",
"filesystem": "ext4",
"mount_point": "/data"
}
],
"bios": {
"smt": true,
"cstates": false
},
"created_at": "2026-07-30T16:21:19.430Z"
}
}
}Was this page helpful?
⌘I