Update an SSH key

Update an SSH key's tags. An update replaces every tag.

PATCH https://{availability_zone}.betterstackcloud.com/v1/ssh-keys/{slug}
slug string required

The slug of the key. Dots are part of the slug.

team_id string

The ID of the team that owns the key. Send it when more than one of your teams has a key with this slug.

Authorization string required

Bearer $TOKEN

Content-Type string

application/json

metadata object

Your tags, as an object of string keys and values, at most 10. An update replaces every tag, so an empty object removes all tags. Accepts any keys.

200 OK
{
  "slug": "my-laptop",
  "public_key": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEF0uIiLF54lpavoiG7O95cChLJ80vbi0Nh08Kf3+G/a me@example.com",
  "created_at": "2026-07-01T12:00:00.000Z",
  "updated_at": "2026-07-01T12:00:00.000Z",
  "team_id": "t123",
  "metadata": {
    "example": "value"
  }
}

Returns the updated SSH key.

id string

The ID of the SSH key.

slug string

The key's name, unique in its team. The name is up to 255 characters long and starts and ends with a letter or digit. Dots, hyphens and underscores are allowed in between. A deleted key's slug stays taken until the key is removed from every zone.

public_key string

Exactly one OpenSSH public key. Never send a private key. The CLI can read it from a file or from standard input, or import it from GitHub. The public key can't be changed after the key is created.

created_at datetime

When the key was created. In ISO 8601 format, such as 2026-07-01T12:00:00Z.

updated_at datetime

When the key was last updated. In ISO 8601 format, such as 2026-07-01T12:00:00Z.

team_id string

The ID of the team that owns the key. betterstack team list shows it.

metadata object

Your tags, as an object of string keys and values, at most 10.