---
title: "Create a New SSH Key"
method: POST
path: "/v2/account/keys"
tags: ["DigitalOcean-public.v2-new_SSH Keys"]
---

# Create a New SSH Key

`POST /v2/account/keys`

To add a new SSH public key to your DigitalOcean account, send a POST request to `/v2/account/keys`. Set the `name` attribute to the name you wish to use and the `public_key` attribute to the full public key you are adding.

## Request body

- SshKeys
  - `id` integer — A unique identification number for this key. Can be used to embed a specific SSH key into a Droplet.
  - `fingerprint` string — A unique identifier that differentiates this key from other keys using a format that SSH recognizes. The fingerprint is created when the key is added to your account.
  - `public_key` string, required — The entire public key string that was uploaded. Embedded into the root user's `authorized_keys` file if you include this key during Droplet creation.
  - `name` string, required — A human-readable display name for this key, used to easily identify the SSH keys when they are displayed.

## Response `201`

The response body will be a JSON object with a key set to `ssh_key`.

- object
  - `ssh_key` SshKeys
    - `id` integer — A unique identification number for this key. Can be used to embed a specific SSH key into a Droplet.
    - `fingerprint` string — A unique identifier that differentiates this key from other keys using a format that SSH recognizes. The fingerprint is created when the key is added to your account.
    - `public_key` string, required — The entire public key string that was uploaded. Embedded into the root user's `authorized_keys` file if you include this key during Droplet creation.
    - `name` string, required — A human-readable display name for this key, used to easily identify the SSH keys when they are displayed.

## Other responses

- `401` — Authentication failed due to invalid credentials.
- `429` — The API rate limit has been exceeded.
- `500` — There was a server error.
- `default` — There was an unexpected error.

---

[API](https://skmtc.net/digitalocean/apis/digitalocean-api.md) · [All operations](https://skmtc.net/digitalocean/apis/digitalocean-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/digitalocean/digitalocean-api/revisions/cb3bf9b21459/schema)
