Python (SDK)
import latitudesh_python_sdk
from latitudesh_python_sdk import Latitudesh
import os
with Latitudesh(
bearer=os.getenv("LATITUDESH_BEARER", ""),
) as latitudesh:
res = latitudesh.servers.create_out_of_band_connection(server_id="sv_8NkvdyGKDeLpx", data={
"type": latitudesh_python_sdk.CreateServerOutOfBandServersType.OUT_OF_BAND,
"attributes": {
"ssh_key_id": "ssh_3YjJOLMydvZ87",
},
})
# Handle response
print(res)package main
import(
"context"
"os"
latitudeshgosdk "github.com/latitudesh/latitudesh-go-sdk"
"github.com/latitudesh/latitudesh-go-sdk/models/operations"
"log"
)
func main() {
ctx := context.Background()
s := latitudeshgosdk.New(
latitudeshgosdk.WithSecurity(os.Getenv("LATITUDESH_BEARER")),
)
res, err := s.Servers.StartOutOfBandConnection(ctx, "sv_8NkvdyGKDeLpx", operations.CreateServerOutOfBandServersRequestBody{
Data: operations.CreateServerOutOfBandServersData{
Type: operations.CreateServerOutOfBandServersTypeOutOfBand,
Attributes: &operations.CreateServerOutOfBandServersAttributes{
SSHKeyID: latitudeshgosdk.Pointer("ssh_3YjJOLMydvZ87"),
},
},
})
if err != nil {
log.Fatal(err)
}
if res.OutOfBandConnection != nil {
// handle response
}
}import { Latitudesh } from "latitudesh-typescript-sdk";
const latitudesh = new Latitudesh({
bearer: process.env["LATITUDESH_BEARER"] ?? "",
});
async function run() {
const result = await latitudesh.servers.startOutOfBandConnection({
serverId: "sv_8NkvdyGKDeLpx",
requestBody: {
data: {
type: "out_of_band",
attributes: {
sshKeyId: "ssh_3YjJOLMydvZ87",
},
},
},
});
console.log(result);
}
run();curl --request POST \
--url https://api.latitude.sh/servers/{server_id}/out_of_band_connection \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"data": {
"type": "out_of_band",
"attributes": {
"ssh_key_id": "ssh_3YjJOLMydvZ87"
}
}
}
'const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({data: {type: 'out_of_band', attributes: {ssh_key_id: 'ssh_3YjJOLMydvZ87'}}})
};
fetch('https://api.latitude.sh/servers/{server_id}/out_of_band_connection', 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/servers/{server_id}/out_of_band_connection",
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' => 'out_of_band',
'attributes' => [
'ssh_key_id' => 'ssh_3YjJOLMydvZ87'
]
]
]),
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/servers/{server_id}/out_of_band_connection")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"type\": \"out_of_band\",\n \"attributes\": {\n \"ssh_key_id\": \"ssh_3YjJOLMydvZ87\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.latitude.sh/servers/{server_id}/out_of_band_connection")
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\": \"out_of_band\",\n \"attributes\": {\n \"ssh_key_id\": \"ssh_3YjJOLMydvZ87\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "obc_mw49QDB5qagKb",
"type": "out_of_band",
"attributes": {
"ssh_key": {
"id": "ssh_3YjJOLMydvZ87",
"description": "wisozk-gislason.example",
"fingerprint": "14:e2:8e:b3:9e:f5:08:31:b6:c7:43:6d:f5:1e:6d:b2"
},
"created_at": "2026-01-14T15:56:58+00:00",
"username": "server-1",
"credentials": {
"user": "donn",
"password": "398ig362ci"
},
"port": "2222",
"access_ip": "189.1.2.0",
"server_id": "sv_8NkvdyGKDeLpx",
"status": "connected"
}
},
"meta": {}
}Servers
Create out-of-band connection
POST
/
servers
/
{server_id}
/
out_of_band_connection
Python (SDK)
import latitudesh_python_sdk
from latitudesh_python_sdk import Latitudesh
import os
with Latitudesh(
bearer=os.getenv("LATITUDESH_BEARER", ""),
) as latitudesh:
res = latitudesh.servers.create_out_of_band_connection(server_id="sv_8NkvdyGKDeLpx", data={
"type": latitudesh_python_sdk.CreateServerOutOfBandServersType.OUT_OF_BAND,
"attributes": {
"ssh_key_id": "ssh_3YjJOLMydvZ87",
},
})
# Handle response
print(res)package main
import(
"context"
"os"
latitudeshgosdk "github.com/latitudesh/latitudesh-go-sdk"
"github.com/latitudesh/latitudesh-go-sdk/models/operations"
"log"
)
func main() {
ctx := context.Background()
s := latitudeshgosdk.New(
latitudeshgosdk.WithSecurity(os.Getenv("LATITUDESH_BEARER")),
)
res, err := s.Servers.StartOutOfBandConnection(ctx, "sv_8NkvdyGKDeLpx", operations.CreateServerOutOfBandServersRequestBody{
Data: operations.CreateServerOutOfBandServersData{
Type: operations.CreateServerOutOfBandServersTypeOutOfBand,
Attributes: &operations.CreateServerOutOfBandServersAttributes{
SSHKeyID: latitudeshgosdk.Pointer("ssh_3YjJOLMydvZ87"),
},
},
})
if err != nil {
log.Fatal(err)
}
if res.OutOfBandConnection != nil {
// handle response
}
}import { Latitudesh } from "latitudesh-typescript-sdk";
const latitudesh = new Latitudesh({
bearer: process.env["LATITUDESH_BEARER"] ?? "",
});
async function run() {
const result = await latitudesh.servers.startOutOfBandConnection({
serverId: "sv_8NkvdyGKDeLpx",
requestBody: {
data: {
type: "out_of_band",
attributes: {
sshKeyId: "ssh_3YjJOLMydvZ87",
},
},
},
});
console.log(result);
}
run();curl --request POST \
--url https://api.latitude.sh/servers/{server_id}/out_of_band_connection \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"data": {
"type": "out_of_band",
"attributes": {
"ssh_key_id": "ssh_3YjJOLMydvZ87"
}
}
}
'const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({data: {type: 'out_of_band', attributes: {ssh_key_id: 'ssh_3YjJOLMydvZ87'}}})
};
fetch('https://api.latitude.sh/servers/{server_id}/out_of_band_connection', 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/servers/{server_id}/out_of_band_connection",
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' => 'out_of_band',
'attributes' => [
'ssh_key_id' => 'ssh_3YjJOLMydvZ87'
]
]
]),
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/servers/{server_id}/out_of_band_connection")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"type\": \"out_of_band\",\n \"attributes\": {\n \"ssh_key_id\": \"ssh_3YjJOLMydvZ87\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.latitude.sh/servers/{server_id}/out_of_band_connection")
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\": \"out_of_band\",\n \"attributes\": {\n \"ssh_key_id\": \"ssh_3YjJOLMydvZ87\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "obc_mw49QDB5qagKb",
"type": "out_of_band",
"attributes": {
"ssh_key": {
"id": "ssh_3YjJOLMydvZ87",
"description": "wisozk-gislason.example",
"fingerprint": "14:e2:8e:b3:9e:f5:08:31:b6:c7:43:6d:f5:1e:6d:b2"
},
"created_at": "2026-01-14T15:56:58+00:00",
"username": "server-1",
"credentials": {
"user": "donn",
"password": "398ig362ci"
},
"port": "2222",
"access_ip": "189.1.2.0",
"server_id": "sv_8NkvdyGKDeLpx",
"status": "connected"
}
},
"meta": {}
}Was this page helpful?
⌘I