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.ssh_keys.put_ssh_key(ssh_key_id="ssh_GnzRD5xAqM5yw", data={
"id": "ssh_GnzRD5xAqM5yw",
"type": latitudesh_python_sdk.PutSSHKeySSHKeysType.SSH_KEYS,
"attributes": {
"tags": [
"tag_JLA906BzyKHLyVJbJr8NH3QQbev",
"tag_Yy7PJ68y22FoQyBppnW7FjNGX1k",
],
},
})
# 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.SSHKeys.Update(ctx, "ssh_GnzRD5xAqM5yw", operations.PutSSHKeySSHKeysRequestBody{
Data: operations.PutSSHKeySSHKeysData{
ID: latitudeshgosdk.Pointer("ssh_GnzRD5xAqM5yw"),
Type: operations.PutSSHKeySSHKeysTypeSSHKeys,
Attributes: &operations.PutSSHKeySSHKeysAttributes{
Tags: []string{
"tag_JLA906BzyKHLyVJbJr8NH3QQbev",
"tag_Yy7PJ68y22FoQyBppnW7FjNGX1k",
},
},
},
})
if err != nil {
log.Fatal(err)
}
if res.Object != 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.sshKeys.update({
sshKeyId: "ssh_GnzRD5xAqM5yw",
requestBody: {
data: {
id: "ssh_GnzRD5xAqM5yw",
type: "ssh_keys",
attributes: {
tags: [
"tag_JLA906BzyKHLyVJbJr8NH3QQbev",
"tag_Yy7PJ68y22FoQyBppnW7FjNGX1k",
],
},
},
},
});
console.log(result);
}
run();curl --request PATCH \
--url https://api.latitude.sh/ssh_keys/{ssh_key_id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"data": {
"id": "ssh_GnzRD5xAqM5yw",
"type": "ssh_keys",
"attributes": {
"tags": [
"tag_JLA906BzyKHLyVJbJr8NH3QQbev",
"tag_Yy7PJ68y22FoQyBppnW7FjNGX1k"
]
}
}
}
'const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
data: {
id: 'ssh_GnzRD5xAqM5yw',
type: 'ssh_keys',
attributes: {tags: ['tag_JLA906BzyKHLyVJbJr8NH3QQbev', 'tag_Yy7PJ68y22FoQyBppnW7FjNGX1k']}
}
})
};
fetch('https://api.latitude.sh/ssh_keys/{ssh_key_id}', 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/ssh_keys/{ssh_key_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'data' => [
'id' => 'ssh_GnzRD5xAqM5yw',
'type' => 'ssh_keys',
'attributes' => [
'tags' => [
'tag_JLA906BzyKHLyVJbJr8NH3QQbev',
'tag_Yy7PJ68y22FoQyBppnW7FjNGX1k'
]
]
]
]),
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.patch("https://api.latitude.sh/ssh_keys/{ssh_key_id}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"id\": \"ssh_GnzRD5xAqM5yw\",\n \"type\": \"ssh_keys\",\n \"attributes\": {\n \"tags\": [\n \"tag_JLA906BzyKHLyVJbJr8NH3QQbev\",\n \"tag_Yy7PJ68y22FoQyBppnW7FjNGX1k\"\n ]\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.latitude.sh/ssh_keys/{ssh_key_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"data\": {\n \"id\": \"ssh_GnzRD5xAqM5yw\",\n \"type\": \"ssh_keys\",\n \"attributes\": {\n \"tags\": [\n \"tag_JLA906BzyKHLyVJbJr8NH3QQbev\",\n \"tag_Yy7PJ68y22FoQyBppnW7FjNGX1k\"\n ]\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "ssh_GnzRD5xAqM5yw",
"type": "ssh_keys",
"attributes": {
"tags": [
{
"id": "tag_JLA906BzyKHLyVJbJr8NH3QQbev",
"name": "Elfstan Fairbairn",
"description": "Culpa fuga asperiores et.",
"color": "#3fd53f"
},
{
"id": "tag_Yy7PJ68y22FoQyBppnW7FjNGX1k",
"name": "Lindir",
"description": "Et voluptas sequi rerum.",
"color": "#172717"
}
],
"name": "bradtke.example",
"public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCZzuE/2myrBWwvs5ayKE/p37nbhUWBpVfKjFA/6meaIFj3pKHv7lK3rZxOz/QnrUPsTS04kXVwvOG1Ms+ZQk7irHNzSWksKIFK8mPZWf9T6Pb2DbUduela1jUnmelVKPoiF6lUVnA8IayHbeRD5kaGS1zr35WzstNhUPXoab6QI9NSakvxUxciGitJ/nMWSJlfV3y48OQ1NE9iuqoSWomWc8/NEjk5x2uJcte2ZA336hjYHQxo9+DYhLq9jRcxw3RrzqkWFDuVT4SW82x5ERIZYUKZmywOwk8gCePNaUkzRU4G6qwADfpBovbicZ4+9WBpZsJ7vj8OqM35TdFS7ZjJ",
"fingerprint": "52:c8:05:f4:9b:f0:42:17:40:07:64:0d:33:12:9a:47",
"created_at": "2026-01-14T15:57:06+00:00",
"updated_at": "2026-01-14T15:57:06+00:00",
"project": {},
"user": {
"id": "user_yReEYZlaagFl4YmjMZ6GCpvwJJJb",
"first_name": "Gale",
"last_name": "Brown",
"email": "willa.wunsch@veum.example",
"created_at": "2025-02-17T00:00:00.000Z",
"updated_at": "2025-05-31T00:00:00.000Z",
"role": {
"id": "role_bBeWeR8mBLuyLVoQwzNWcng2ekv",
"name": "owner",
"created_at": "2025-11-16T00:00:00.000Z",
"updated_at": "2026-06-05T00:00:00.000Z"
}
}
}
},
"meta": {}
}SSH Keys
Update SSH Key
Allows you update SSH Key in a project. These keys can be used to access servers after deploy and reinstall actions.
PATCH
/
ssh_keys
/
{ssh_key_id}
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.ssh_keys.put_ssh_key(ssh_key_id="ssh_GnzRD5xAqM5yw", data={
"id": "ssh_GnzRD5xAqM5yw",
"type": latitudesh_python_sdk.PutSSHKeySSHKeysType.SSH_KEYS,
"attributes": {
"tags": [
"tag_JLA906BzyKHLyVJbJr8NH3QQbev",
"tag_Yy7PJ68y22FoQyBppnW7FjNGX1k",
],
},
})
# 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.SSHKeys.Update(ctx, "ssh_GnzRD5xAqM5yw", operations.PutSSHKeySSHKeysRequestBody{
Data: operations.PutSSHKeySSHKeysData{
ID: latitudeshgosdk.Pointer("ssh_GnzRD5xAqM5yw"),
Type: operations.PutSSHKeySSHKeysTypeSSHKeys,
Attributes: &operations.PutSSHKeySSHKeysAttributes{
Tags: []string{
"tag_JLA906BzyKHLyVJbJr8NH3QQbev",
"tag_Yy7PJ68y22FoQyBppnW7FjNGX1k",
},
},
},
})
if err != nil {
log.Fatal(err)
}
if res.Object != 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.sshKeys.update({
sshKeyId: "ssh_GnzRD5xAqM5yw",
requestBody: {
data: {
id: "ssh_GnzRD5xAqM5yw",
type: "ssh_keys",
attributes: {
tags: [
"tag_JLA906BzyKHLyVJbJr8NH3QQbev",
"tag_Yy7PJ68y22FoQyBppnW7FjNGX1k",
],
},
},
},
});
console.log(result);
}
run();curl --request PATCH \
--url https://api.latitude.sh/ssh_keys/{ssh_key_id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"data": {
"id": "ssh_GnzRD5xAqM5yw",
"type": "ssh_keys",
"attributes": {
"tags": [
"tag_JLA906BzyKHLyVJbJr8NH3QQbev",
"tag_Yy7PJ68y22FoQyBppnW7FjNGX1k"
]
}
}
}
'const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
data: {
id: 'ssh_GnzRD5xAqM5yw',
type: 'ssh_keys',
attributes: {tags: ['tag_JLA906BzyKHLyVJbJr8NH3QQbev', 'tag_Yy7PJ68y22FoQyBppnW7FjNGX1k']}
}
})
};
fetch('https://api.latitude.sh/ssh_keys/{ssh_key_id}', 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/ssh_keys/{ssh_key_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'data' => [
'id' => 'ssh_GnzRD5xAqM5yw',
'type' => 'ssh_keys',
'attributes' => [
'tags' => [
'tag_JLA906BzyKHLyVJbJr8NH3QQbev',
'tag_Yy7PJ68y22FoQyBppnW7FjNGX1k'
]
]
]
]),
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.patch("https://api.latitude.sh/ssh_keys/{ssh_key_id}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"id\": \"ssh_GnzRD5xAqM5yw\",\n \"type\": \"ssh_keys\",\n \"attributes\": {\n \"tags\": [\n \"tag_JLA906BzyKHLyVJbJr8NH3QQbev\",\n \"tag_Yy7PJ68y22FoQyBppnW7FjNGX1k\"\n ]\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.latitude.sh/ssh_keys/{ssh_key_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"data\": {\n \"id\": \"ssh_GnzRD5xAqM5yw\",\n \"type\": \"ssh_keys\",\n \"attributes\": {\n \"tags\": [\n \"tag_JLA906BzyKHLyVJbJr8NH3QQbev\",\n \"tag_Yy7PJ68y22FoQyBppnW7FjNGX1k\"\n ]\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "ssh_GnzRD5xAqM5yw",
"type": "ssh_keys",
"attributes": {
"tags": [
{
"id": "tag_JLA906BzyKHLyVJbJr8NH3QQbev",
"name": "Elfstan Fairbairn",
"description": "Culpa fuga asperiores et.",
"color": "#3fd53f"
},
{
"id": "tag_Yy7PJ68y22FoQyBppnW7FjNGX1k",
"name": "Lindir",
"description": "Et voluptas sequi rerum.",
"color": "#172717"
}
],
"name": "bradtke.example",
"public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCZzuE/2myrBWwvs5ayKE/p37nbhUWBpVfKjFA/6meaIFj3pKHv7lK3rZxOz/QnrUPsTS04kXVwvOG1Ms+ZQk7irHNzSWksKIFK8mPZWf9T6Pb2DbUduela1jUnmelVKPoiF6lUVnA8IayHbeRD5kaGS1zr35WzstNhUPXoab6QI9NSakvxUxciGitJ/nMWSJlfV3y48OQ1NE9iuqoSWomWc8/NEjk5x2uJcte2ZA336hjYHQxo9+DYhLq9jRcxw3RrzqkWFDuVT4SW82x5ERIZYUKZmywOwk8gCePNaUkzRU4G6qwADfpBovbicZ4+9WBpZsJ7vj8OqM35TdFS7ZjJ",
"fingerprint": "52:c8:05:f4:9b:f0:42:17:40:07:64:0d:33:12:9a:47",
"created_at": "2026-01-14T15:57:06+00:00",
"updated_at": "2026-01-14T15:57:06+00:00",
"project": {},
"user": {
"id": "user_yReEYZlaagFl4YmjMZ6GCpvwJJJb",
"first_name": "Gale",
"last_name": "Brown",
"email": "willa.wunsch@veum.example",
"created_at": "2025-02-17T00:00:00.000Z",
"updated_at": "2025-05-31T00:00:00.000Z",
"role": {
"id": "role_bBeWeR8mBLuyLVoQwzNWcng2ekv",
"name": "owner",
"created_at": "2025-11-16T00:00:00.000Z",
"updated_at": "2026-06-05T00:00:00.000Z"
}
}
}
},
"meta": {}
}Was this page helpful?
⌘I