---
title: "Replace a Computer's authorised ssh keys."
method: PUT
path: "/v1/computers/{id}/ssh-keys"
tags: ["Computers"]
---

# Replace a Computer's authorised ssh keys.

`PUT /v1/computers/{id}/ssh-keys`

## Request

- Base URL: `https://api.scalix.world`
- URL: `https://api.scalix.world/v1/computers/{id}/ssh-keys`
- Auth: HTTP bearer

Sends the whole list every time, so removing a key is the same operation as
adding one. On a RUNNING machine the change applies immediately — a
revoked key stops working now, not at the next restart. On a stopped
machine it is stored and delivered when it next boots.

## Path parameters

- `id` string, required

## Request body

- ComputerSshKeysRequest: Request body for replacing a Computer's authorised ssh keys.
  - `ssh_keys` string[], required: The complete list, max 32. Not a patch: whatever you send becomes the whole of `authorized_keys`, and an empty array removes every key.

## Response `200`

The Computer, with the new key list

- ComputerInfo: A Computer as returned by create/get/list.
  - `id` string, required
  - `name` string, required
  - `image` string, required
  - `status` string, required: CREATING | RUNNING | STOPPING | STOPPED | STARTING | DELETING | FAILED
  - `statusReason` string, nullable: Human-readable reason for the current status (set on FAILED).
  - `ipAddress` string, nullable: Private address inside your network. Reserved for the Computer's lifetime — the same address comes back after a stop/start.
  - `vcpus` integer, required
  - `memoryMb` integer, required
  - `diskGb` integer, required
  - `sshKeys` string[]: The OpenSSH public keys currently authorised for `root`. Public halves only — there is nothing secret to withhold here, and being able to read back what is installed is how you confirm a revocation took.
  - `createdAt` string, required
  - `updatedAt` string, required

## Other responses

- `400`: Not an OpenSSH public key, or more than 32
- `404`: Not found
- `502`: The keys could not be delivered to the running machine

---

[API](https://skmtc.dev/scalix/apis/scalix-cloud-api.md) · [All operations](https://skmtc.dev/scalix/apis/scalix-cloud-api/llms.txt) · [OpenAPI document](https://skmtc.dev/scalix/apis/scalix-cloud-api/revisions/2c04ca0a90bb?raw)
