SSH Keys

Update an SSH key

Updates an SSH key. You can update an SSH key name and an SSH key labels.

put/ssh_keys/{id}

Request

  • Base URL: https://api.hetzner.cloud/v1
  • URL: https://api.hetzner.cloud/v1/ssh_keys/{id}
  • Auth: HTTP bearer

Path parameters

idinteger required

ID of the SSH Key.

Example:42

ID of the SSH Key.

Request body

namestring

New name Name to set.

labelsobject

User-defined labels (key/value pairs) for the Resource.

Note that the set of Labels provided in the request will overwrite the existing one.

For more information, see "Labels".

Example request

{
  "name": "My ssh key",
  "labels": {
    "environment": "prod",
    "example.com/my": "label",
    "just-a-key": ""
  }
}

Response

Request succeeded.

Example response

{
  "ssh_key": {
    "id": 42,
    "name": "my-resource",
    "fingerprint": "b7:2f:30:a0:2f:6c:58:6c:21:04:58:61:ba:06:3b:2f",
    "public_key": "ssh-rsa AAAjjk76kgf...Xt",
    "labels": {
      "environment": "prod",
      "example.com/my": "label",
      "just-a-key": ""
    },
    "created": "2016-01-30T23:55:00Z"
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.