Skip to main content
POST
/
ssh_keys
Typescript (SDK)
import { Latitudesh } from "latitudesh-typescript-sdk";

const latitudesh = new Latitudesh({
  bearer: process.env["LATITUDESH_BEARER"] ?? "",
});

async function run() {
  const result = await latitudesh.sshKeys.create({
    data: {
      type: "ssh_keys",
      attributes: {
        name: "SSH Key",
        project: "proj_z2A3DV4wdnawP",
        publicKey: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDOLFnjGP3Jsh1usHNS2EILgfqZNC9pOvNqBZqxH+qNAdZdQCzy2csMuiq+ZwLA8Mm4Vo5CvSgBHs/kuZRUKyTl+79YUMZIj8PhHzL4XbdqX1ZnAIklHWcJaveB0+UXLEPKGzFIFq+FkuwtiXQsVe5NnSpIDYgpzhqEs38NsnXvsubKphGUdARDhaxvMdUUl4YsAtLHKMzSyIvE6xwfTtIVwA9bZt/8GoBzrn9px9PEcf25Rgd2NhOYs3WYcZuwvRmfcFdi2vGhVqTPqL9n16R/n5jknxHYrTyqWNxJdpdvg2YqXpN7vnFNoOjYFD6EahJ0pF/+WL4tPCIkLfoaVaSx",
      },
    },
  });

  console.log(result);
}

run();
{
  "data": {
    "id": "ssh_QraYDPweqpjwW",
    "type": "ssh_keys",
    "attributes": {
      "tags": [],
      "name": "SSH Key",
      "public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDOLFnjGP3Jsh1usHNS2EILgfqZNC9pOvNqBZqxH+qNAdZdQCzy2csMuiq+ZwLA8Mm4Vo5CvSgBHs/kuZRUKyTl+79YUMZIj8PhHzL4XbdqX1ZnAIklHWcJaveB0+UXLEPKGzFIFq+FkuwtiXQsVe5NnSpIDYgpzhqEs38NsnXvsubKphGUdARDhaxvMdUUl4YsAtLHKMzSyIvE6xwfTtIVwA9bZt/8GoBzrn9px9PEcf25Rgd2NhOYs3WYcZuwvRmfcFdi2vGhVqTPqL9n16R/n5jknxHYrTyqWNxJdpdvg2YqXpN7vnFNoOjYFD6EahJ0pF/+WL4tPCIkLfoaVaSx",
      "fingerprint": "0a:00:34:53:51:0e:a5:4e:06:2c:d7:16:88:96:82:f3",
      "created_at": "2026-01-14T15:57:05+00:00",
      "updated_at": "2026-01-14T15:57:05+00:00",
      "project": {
        "id": "proj_z2A3DV4wdnawP",
        "name": "Ergonomic Cotton Gloves",
        "slug": "ergonomic-cotton-gloves",
        "description": "Small Concrete Bottle",
        "provisioning_type": "on_demand",
        "billing_type": "Normal",
        "billing_method": "Normal",
        "bandwidth_alert": false,
        "environment": null,
        "billing": {},
        "stats": {
          "databases": 0,
          "ip_addresses": 0,
          "prefixes": 0,
          "servers": 0,
          "storages": 0,
          "virtual_machines": 0,
          "vlans": 0
        }
      },
      "user": {
        "id": "user_RJK9eae5KlTAKQoBReVKFGQRVJ7",
        "first_name": "Meda",
        "last_name": "Schowalter",
        "email": "[email protected]",
        "created_at": "2025-04-25T00:00:00.000Z",
        "updated_at": "2025-07-21T00:00:00.000Z",
        "role": {
          "id": "role_AzG5AagWN1fKg1okmoG9uWWoN5my",
          "name": "owner",
          "created_at": "2025-05-15T00:00:00.000Z",
          "updated_at": "2026-12-02T00:00:00.000Z"
        }
      }
    }
  },
  "meta": {}
}

Authorizations

Authorization
string
header
required

Body

data
object
required

Response

201 - application/vnd.api+json

Created

data
object