dots.v2.account.keys.bySsh_key_identifier().put()

Generated on 13 Nov 2026 from DoTs version v1.24.0

Usage

client.v2.account.keys.bySsh_key_identifier(ssh_key_identifier).put(body: WithSsh_key_identifierPutRequestBody, requestConfiguration?: RequestConfiguration<object>): Promise<undefined | WithSsh_key_identifierPutResponse>

Description

To update the name of an SSH key, send a PUT request to either /v2/account/keys/{ssh_key_identifier} or /v2/account/keys/{ssh_key_identifier}. Set the name attribute to the new name you want to use.

Parameters

Path Parameters

ssh_key_identifier integer or string required

Example: 512189

Either the ID or the fingerprint of an existing SSH key.

Request Body

name string optional

Example: My SSH Public Key

A human-readable display name for this key, used to easily identify the SSH keys when they are displayed.

Request Sample

Show Request Sample
import { FetchRequestAdapter } from "@microsoft/kiota-http-fetchlibrary";
import {
    createDigitalOceanClient,
    DigitalOceanApiKeyAuthenticationProvider,
} from "@digitalocean/dots";

const authProvider = new DigitalOceanApiKeyAuthenticationProvider(process.env.DIGITALOCEAN_TOKEN!);
const adapter = new FetchRequestAdapter(authProvider);
const client = createDigitalOceanClient(adapter);

const response = await client.v2.account.keys
    .bySsh_key_identifier(512189).put({
    name: "My SSH Public Key",
});

Response Example

Show Response Example
{
  "ssh_key": {
    "id": 512189,
    "fingerprint": "3b:16:bf:e4:8b:00:8b:b8:59:8c:a9:d3:f0:19:45:fa",
    "public_key": "ssh-rsa AEXAMPLEaC1yc2EAAAADAQABAAAAQQDDHr/jh2Jy4yALcK4JyWbVkPRaWmhck3IgCoeOO3z1e2dBowLh64QAM+Qb72pxekALga2oi4GvT+TlWNhzPH4V example",
    "name": "My SSH Public Key"
  }
}

More Information

See /v2/account/keys/{ssh_key_identifier} in the API reference for additional detail on responses, headers, parameters, and more.

We can't find any results for your search.

Try using different keywords or simplifying your search terms.