> ## Documentation Index
> Fetch the complete documentation index at: https://www.latitude.sh/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Update SSH Key

> Allows you update SSH Key in a project. These keys can be used to access servers after deploy and reinstall actions.




## OpenAPI

````yaml https://spec.speakeasy.com/latitude/latitude/latitude-sh-api-with-code-samples patch /ssh_keys/{ssh_key_id}
openapi: 3.0.1
info:
  title: Latitude.sh API
  version: '2023-06-01'
  description: >-
    The Latitude.sh API is a RESTful API to manage your Latitude.sh account. It
    allows you to perform the same actions as the Latitude.sh dashboard.
servers:
  - url: https://api.latitude.sh
    variables:
      latitude_api_key:
        default: <insert your api key here>
  - url: http://api.latitude.sh
    variables:
      latitude_api_key:
        default: <insert your api key here>
security: []
tags:
  - name: API keys
  - name: Billing
  - name: Elastic Ips
  - name: Events
  - name: Firewalls
  - name: IP Addresses
  - name: Kubernetes Clusters
  - name: Operating Systems
  - name: Plans
  - name: Private Networks
  - name: Projects
  - name: Regions
  - name: Roles
  - name: SSH Keys
  - name: Servers
  - name: Storage
  - name: Tags
  - name: Teams
  - name: Team members
  - name: Traffic
  - name: User data
  - name: User profile
  - name: VPN Sessions
  - name: Virtual machines
paths:
  /ssh_keys/{ssh_key_id}:
    patch:
      tags:
        - SSH Keys
      summary: Update SSH Key
      description: >
        Allows you update SSH Key in a project. These keys can be used to access
        servers after deploy and reinstall actions.
      operationId: put-ssh-key
      parameters:
        - name: ssh_key_id
          in: path
          required: true
          examples:
            Success:
              value: ssh_GnzRD5xAqM5yw
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                data:
                  type: object
                  properties:
                    id:
                      type: string
                      default: ssh_81EVOtR1N4J2Z
                    type:
                      type: string
                      enum:
                        - ssh_keys
                    attributes:
                      type: object
                      properties:
                        tags:
                          type: array
                          items:
                            type: string
                          default: []
                        name:
                          type: string
                          description: Name of the SSH Key
                          default: New SSH Key Name
                  required:
                    - id
                    - type
              required:
                - data
            examples:
              Success:
                summary: Success
                value:
                  data:
                    id: ssh_GnzRD5xAqM5yw
                    type: ssh_keys
                    attributes:
                      tags:
                        - tag_JLA906BzyKHLyVJbJr8NH3QQbev
                        - tag_Yy7PJ68y22FoQyBppnW7FjNGX1k
          application/vnd.api+json:
            schema:
              type: object
              properties:
                data:
                  type: object
                  properties:
                    id:
                      type: string
                      default: ssh_81EVOtR1N4J2Z
                    type:
                      type: string
                      enum:
                        - ssh_keys
                    attributes:
                      type: object
                      properties:
                        tags:
                          type: array
                          items:
                            type: string
                          default: []
                        name:
                          type: string
                          description: Name of the SSH Key
                          default: New SSH Key Name
                  required:
                    - id
                    - type
              required:
                - data
            examples:
              Success:
                summary: Success
                value:
                  data:
                    id: ssh_GnzRD5xAqM5yw
                    type: ssh_keys
                    attributes:
                      tags:
                        - tag_JLA906BzyKHLyVJbJr8NH3QQbev
                        - tag_Yy7PJ68y22FoQyBppnW7FjNGX1k
        required: true
      responses:
        '200':
          description: Success
          content:
            application/vnd.api+json:
              examples:
                Success:
                  value:
                    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: {}
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/ssh_key_data'
      security:
        - Bearer: []
      x-codeSamples:
        - lang: python
          label: Python (SDK)
          source: |-
            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)
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tlatitudeshgosdk \"github.com/latitudesh/latitudesh-go-sdk\"\n\t\"github.com/latitudesh/latitudesh-go-sdk/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := latitudeshgosdk.New(\n        latitudeshgosdk.WithSecurity(os.Getenv(\"LATITUDESH_BEARER\")),\n    )\n\n    res, err := s.SSHKeys.Update(ctx, \"ssh_GnzRD5xAqM5yw\", operations.PutSSHKeySSHKeysRequestBody{\n        Data: operations.PutSSHKeySSHKeysData{\n            ID: latitudeshgosdk.Pointer(\"ssh_GnzRD5xAqM5yw\"),\n            Type: operations.PutSSHKeySSHKeysTypeSSHKeys,\n            Attributes: &operations.PutSSHKeySSHKeysAttributes{\n                Tags: []string{\n                    \"tag_JLA906BzyKHLyVJbJr8NH3QQbev\",\n                    \"tag_Yy7PJ68y22FoQyBppnW7FjNGX1k\",\n                },\n            },\n        },\n    })\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.Object != nil {\n        // handle response\n    }\n}"
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            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();
components:
  schemas:
    ssh_key_data:
      type: object
      properties:
        id:
          type: string
        type:
          type: string
          enum:
            - ssh_keys
        attributes:
          type: object
          properties:
            name:
              type: string
              description: Name of the SSH Key
            public_key:
              type: string
              description: SSH Public Key
            fingerprint:
              type: string
              description: SSH Key fingerprint
            user:
              $ref: '#/components/schemas/user_include'
            project:
              $ref: '#/components/schemas/project_include'
            created_at:
              type: string
            updated_at:
              type: string
      required:
        - type
    user_include:
      type: object
      properties:
        id:
          type: string
        first_name:
          type: string
        last_name:
          type: string
        email:
          type: string
        authentication_factor_id:
          type: string
          nullable: true
        created_at:
          type: string
        updated_at:
          type: string
        role:
          type: object
          properties:
            id:
              type: string
            name:
              type: string
            created_at:
              type: string
            updated_at:
              type: string
    project_include:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        slug:
          type: string
        description:
          type: string
          nullable: true
        billing_type:
          type: string
          nullable: true
        provisioning_type:
          type: string
          nullable: true
        billing_method:
          type: string
          nullable: true
        bandwidth_alert:
          type: boolean
        environment:
          type: string
          nullable: true
        billing:
          type: object
          properties:
            subscription_id:
              type: string
              nullable: true
            type:
              type: string
            method:
              type: string
        stats:
          type: object
          properties:
            ip_addresses:
              type: integer
            prefixes:
              type: integer
            servers:
              type: integer
            vlans:
              type: integer
  securitySchemes:
    Bearer:
      type: apiKey
      name: Authorization
      in: header

````