# List the caller's saved SSH public keys

> GET /v1/ssh-keys. Lists the SSH public keys the caller saved in their organization, oldest first.

Source: https://legion.ambient.xyz/docs/api/identity/list-ssh-keys

`GET https://api.legion.ambient.xyz/v1/ssh-keys`

Authenticate with an API key: `Authorization: Bearer $LEGION_API_KEY`.

Lists the SSH public keys the caller saved in their organization,
oldest first. Saved keys belong to one person in one
organization: nobody else, in the organization or outside it, can
list, use or delete them. They are only a convenience for renting: a
rental's key is whatever `ssh_public_key` the `createRental` request
carries, or the last `updateRental` set. Needs `rentals.manage`.

## Responses

### 200

The caller's saved keys, at most 20.

- `items`, array of SshKey, required
  - `id`, string (uuid), required
  - `label`, string, required: The person's name for the key.
  - `key_type`, SshKeyType, required
  - `public_key`, string, required: The canonical OpenSSH public key, `type base64` with no comment, ready to send as a rental's `ssh_public_key`.
  - `fingerprint`, string, required: The SHA-256 fingerprint as `ssh-keygen -l` prints it.
  - `created_at`, string (date-time), required

Example:

```json
{
  "items": [
    {
      "id": "0192f1a2-7c3d-7e4f-8a9b-0c1d2e3f4a5b",
      "label": "string",
      "key_type": "ssh-ed25519",
      "public_key": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEZ0ZXN0a2V5Zm9ybGVnaW9uZG9jcw",
      "fingerprint": "SHA256:2fmxiBMT0FMF3tnMUkvVAPLNdAOaCFoNtoGSJENyf8Q",
      "created_at": "2026-10-15T12:00:00Z"
    }
  ]
}
```

### 401

Missing, unknown, expired or revoked credentials.

### 403

The caller lacks the permission this operation requires (`forbidden`),
or signed in without having joined an organization yet
(`no_organization`; `getOnboarding` and the invitation and
organization operations under it work), or could not sign in
(`email_unverified`, `account_conflict`, and `domain_not_allowed`). `not_invited` is no longer returned to
session tokens.

`access_not_approved`: a signed-in person who is not approved
for the beta yet. Every operation that takes a credential answers it to
them, except `getMe` and `joinMyWaitlist`; the problem carries
`access` (`waitlisted` or `not_requested`, and the email). Approved
means a member of an organization, holding a pending invitation, or Legion; an API key always belongs to a member.

`oauth_token_mcp_only`: the caller sent an OAuth access token (`lgo_`), which is accepted
only by `mcpMessage` and the tool calls it dispatches. Every other operation answers it, whatever
the token's scope. Use an API key or the Legion web app.

`org_suspended`: the caller's organization is suspended. Every operation that takes a
credential answers it, by session or API key, except `getMe` (which shows `org.suspended_at` and
`org.suspension_reason`) and the support operations under `/v1/support/`.

`terms_not_accepted`: an approved caller who has not accepted
the current version of the Terms of Use and the Acceptable Use Policy. Every operation that takes a credential answers it, except `getMe`,
`acceptLegalDocuments`, `joinMyWaitlist` and the wind-down operations
(`listRentals`, `stopRental`, `deleteRental`, `listHosts`,
`updateListing` with `listed` false, `removeHost`); the problem
carries `legal`. An API key acts for the person who created it, so it
is refused until that person accepts. Terminal
operations also return
`session_required` (called with an API key) and `step_up_required`
(neither a sign-in nor a step-up challenge within the step-up window).

### 500

An unexpected server error. Safe to retry.

## Errors

- 403 [`no_organization`](https://legion.ambient.xyz/docs/errors#no_organization)

## Example request

```sh
curl -s "https://api.legion.ambient.xyz/v1/ssh-keys" \
  -H "Authorization: Bearer $LEGION_API_KEY"
```
