# SSHKeyService

**Spinbox is experimental: APIs change and data may be lost.** What is built and what proves it is on [Status](https://docs.spinbox.dev/reference/status.md); what Spinbox does not do is on [Limitations](https://docs.spinbox.dev/overview/limitations.md).

> spin.v1.SSHKeyService: each procedure, its request and its response.

<!-- Generated by tools/refgen from spin:internal/controlplane/apidocs/spin.v1.openapi.json. Edit the source, not this file. -->

SSHKeyService is the keys that log in as the person, to every workspace that lets them in: a key. of their own, for good, or a browser's or a CLI's enrolled for twelve hours. Each is added with an. assertion of a passkey of theirs (PasskeyService), so a session alone adds none.

## AddSSHKey

`POST /spin.v1.SSHKeyService/AddSSHKey`

Adds a key, with an assertion of a passkey of the caller's over a PASSKEY_PURPOSE_ADD_SSH_KEY challenge naming it.

**Request**

| Field | Type | What it is |
|---|---|---|
| `name` | string | Human-readable name |
| `publicKey` | string | SSH public key content |
| `stepUp` | [PasskeyAssertion](https://docs.spinbox.dev/reference/api/types.md#passkeyassertion) |  |
| `forSession` | boolean | A key enrolled for twelve hours - a browser's, a CLI's - rather than for good. |

**Response**

| Field | Type | What it is |
|---|---|---|
| `sshKey` | [SSHKey](https://docs.spinbox.dev/reference/api/types.md#sshkey) |  |

## DeleteSSHKey

`POST /spin.v1.SSHKeyService/DeleteSSHKey`

Delete an SSH key from user's account

**Request**

| Field | Type | What it is |
|---|---|---|
| `id` | string |  |

**Response**

No fields: `{}`.

## ListSSHKeys

`POST /spin.v1.SSHKeyService/ListSSHKeys`

List user's SSH public keys

**Request**

| Field | Type | What it is |
|---|---|---|
| `page` | [PageRequest](https://docs.spinbox.dev/reference/api/types.md#pagerequest) |  |

**Response**

| Field | Type | What it is |
|---|---|---|
| `sshKeys` | list of [SSHKey](https://docs.spinbox.dev/reference/api/types.md#sshkey) |  |
| `page` | [PageResponse](https://docs.spinbox.dev/reference/api/types.md#pageresponse) |  |
