curl --request POST \
--url https://api.ornn.com/v1/organizations/{organization_id}/ssh-keys \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"public_key": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIExampleKeyMaterialForDocsOnly0000000000 dev@example.com",
"label": "laptop"
}
'import requests
url = "https://api.ornn.com/v1/organizations/{organization_id}/ssh-keys"
payload = {
"public_key": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIExampleKeyMaterialForDocsOnly0000000000 dev@example.com",
"label": "laptop"
}
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({
public_key: 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIExampleKeyMaterialForDocsOnly0000000000 dev@example.com',
label: 'laptop'
})
};
fetch('https://api.ornn.com/v1/organizations/{organization_id}/ssh-keys', 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.ornn.com/v1/organizations/{organization_id}/ssh-keys",
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([
'public_key' => 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIExampleKeyMaterialForDocsOnly0000000000 dev@example.com',
'label' => 'laptop'
]),
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://api.ornn.com/v1/organizations/{organization_id}/ssh-keys"
payload := strings.NewReader("{\n \"public_key\": \"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIExampleKeyMaterialForDocsOnly0000000000 dev@example.com\",\n \"label\": \"laptop\"\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://api.ornn.com/v1/organizations/{organization_id}/ssh-keys")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"public_key\": \"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIExampleKeyMaterialForDocsOnly0000000000 dev@example.com\",\n \"label\": \"laptop\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ornn.com/v1/organizations/{organization_id}/ssh-keys")
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 \"public_key\": \"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIExampleKeyMaterialForDocsOnly0000000000 dev@example.com\",\n \"label\": \"laptop\"\n}"
response = http.request(request)
puts response.read_body{
"id": "77777777-7777-4777-8777-777777777777",
"organization_id": "22222222-2222-4222-8222-222222222222",
"tenant_id": "22222222-2222-4222-8222-222222222222",
"public_key": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIExampleKeyMaterialForDocsOnly0000000000 dev@example.com",
"fingerprint": "SHA256:ExampleFingerprintForDocumentationOnly000000",
"label": "laptop",
"status": "active",
"created_at": "2026-10-01T09:30:00Z",
"revoked_at": null,
"outcome": "already_registered"
}{
"id": "77777777-7777-4777-8777-777777777777",
"organization_id": "22222222-2222-4222-8222-222222222222",
"tenant_id": "22222222-2222-4222-8222-222222222222",
"public_key": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIExampleKeyMaterialForDocsOnly0000000000 dev@example.com",
"fingerprint": "SHA256:ExampleFingerprintForDocumentationOnly000000",
"label": "laptop",
"status": "active",
"created_at": "2026-10-14T12:00:00Z",
"revoked_at": null,
"outcome": "created"
}{
"code": "<string>",
"detail": "<string>"
}{
"code": "<string>",
"detail": "<string>"
}{
"detail": "An SSH key with this fingerprint is already registered."
}{
"detail": "unsupported_ssh_key_type"
}{
"error": "rate_limited",
"retry_after": 42,
"detail": "Too many requests. Try again in 42 seconds."
}{
"code": "<string>",
"detail": "<string>"
}Add an organization SSH key
Registers one SSH public key for your organization. Adding a key does not install it on any machine; assign it to a reservation or include it in a launch. If the organization already has an active key with the same fingerprint, the existing key is returned with outcome already_registered and your label is not applied. Adding a revoked key again reactivates it with outcome reactivated; reactivation does not push it to machines. Send only the public key, never the private key. Requires an approved organization.
curl --request POST \
--url https://api.ornn.com/v1/organizations/{organization_id}/ssh-keys \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"public_key": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIExampleKeyMaterialForDocsOnly0000000000 dev@example.com",
"label": "laptop"
}
'import requests
url = "https://api.ornn.com/v1/organizations/{organization_id}/ssh-keys"
payload = {
"public_key": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIExampleKeyMaterialForDocsOnly0000000000 dev@example.com",
"label": "laptop"
}
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({
public_key: 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIExampleKeyMaterialForDocsOnly0000000000 dev@example.com',
label: 'laptop'
})
};
fetch('https://api.ornn.com/v1/organizations/{organization_id}/ssh-keys', 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.ornn.com/v1/organizations/{organization_id}/ssh-keys",
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([
'public_key' => 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIExampleKeyMaterialForDocsOnly0000000000 dev@example.com',
'label' => 'laptop'
]),
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://api.ornn.com/v1/organizations/{organization_id}/ssh-keys"
payload := strings.NewReader("{\n \"public_key\": \"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIExampleKeyMaterialForDocsOnly0000000000 dev@example.com\",\n \"label\": \"laptop\"\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://api.ornn.com/v1/organizations/{organization_id}/ssh-keys")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"public_key\": \"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIExampleKeyMaterialForDocsOnly0000000000 dev@example.com\",\n \"label\": \"laptop\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ornn.com/v1/organizations/{organization_id}/ssh-keys")
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 \"public_key\": \"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIExampleKeyMaterialForDocsOnly0000000000 dev@example.com\",\n \"label\": \"laptop\"\n}"
response = http.request(request)
puts response.read_body{
"id": "77777777-7777-4777-8777-777777777777",
"organization_id": "22222222-2222-4222-8222-222222222222",
"tenant_id": "22222222-2222-4222-8222-222222222222",
"public_key": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIExampleKeyMaterialForDocsOnly0000000000 dev@example.com",
"fingerprint": "SHA256:ExampleFingerprintForDocumentationOnly000000",
"label": "laptop",
"status": "active",
"created_at": "2026-10-01T09:30:00Z",
"revoked_at": null,
"outcome": "already_registered"
}{
"id": "77777777-7777-4777-8777-777777777777",
"organization_id": "22222222-2222-4222-8222-222222222222",
"tenant_id": "22222222-2222-4222-8222-222222222222",
"public_key": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIExampleKeyMaterialForDocsOnly0000000000 dev@example.com",
"fingerprint": "SHA256:ExampleFingerprintForDocumentationOnly000000",
"label": "laptop",
"status": "active",
"created_at": "2026-10-14T12:00:00Z",
"revoked_at": null,
"outcome": "created"
}{
"code": "<string>",
"detail": "<string>"
}{
"code": "<string>",
"detail": "<string>"
}{
"detail": "An SSH key with this fingerprint is already registered."
}{
"detail": "unsupported_ssh_key_type"
}{
"error": "rate_limited",
"retry_after": 42,
"detail": "Too many requests. Try again in 42 seconds."
}{
"code": "<string>",
"detail": "<string>"
}ornn ssh-keys add --public-key-file ~/.ssh/id_ed25519.pub --label laptop.Authorizations
Create an organization API key in Account Settings > Developer. Do not send this key to the Kubernetes API server.
Path Parameters
Your organization ID, from the organizations array of GET /v1/auth/session.
Body
One line containing an OpenSSH public key. Supported types are ssh-ed25519, ecdsa-sha2-nistp256, ecdsa-sha2-nistp384, ecdsa-sha2-nistp521, sk-ssh-ed25519@openssh.com, sk-ecdsa-sha2-nistp256@openssh.com, ssh-rsa, rsa-sha2-256, and rsa-sha2-512.
Optional name for the key. Leading and trailing spaces are removed.
Response
The organization already had this key. outcome is already_registered (returned unchanged) or reactivated (a revoked key is active again).
Your organization.
The OpenSSH public key as registered, including any comment.
SHA-256 fingerprint in OpenSSH format, such as SHA256:...
active, revoked created for a new key; already_registered when an active key with this fingerprint existed and was returned unchanged; reactivated when a revoked key became active again.
created, already_registered, reactivated Same value as organization_id. Use organization_id.
Your name for the key.
Was this page helpful?