---
title: "Create SSH key"
method: POST
path: "/api/v1/ssh-keys"
tags: ["SSH Keys"]
---

# Create SSH key

`POST /api/v1/ssh-keys`

Add an SSH public key to your account. Pass the key on VM create via the `ssh_keys` array to enable key-based login.

Supported key types: RSA, ECDSA, Ed25519. The `key_type` field on the response is parsed automatically from the public key.

## Request body

- CreateSSHKeyRequest
  - `name` string, required — SSH key display name
  - `public_key` string, required — Full SSH public key string

## Response `201`

SSH key created

- object
  - `success` boolean
  - `data` SSHKey
    - `id` string, uuid, required — SSH key ID
    - `name` string, required — SSH key display name
    - `public_key` string, required — Full SSH public key string (e.g. `ssh-ed25519 AAAA... user@host`)
    - `key_type` 'ssh-rsa' | 'ssh-ed25519' | 'ecdsa-sha2-nistp256' | 'ecdsa-sha2-nistp384' | 'ecdsa-sha2-nistp521', required — Parsed key algorithm
    - `created_at` string, date-time
    - `updated_at` string, date-time

## Other responses

- `400` — Invalid request parameters
- `401` — Authentication required

## Changes

- **2026-05-08** `64c270db1c2e` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/rafftechnologies/apis/raff-api/changes/api/v1/ssh-keys/post.md)

---

[API](https://skmtc.dev/rafftechnologies/apis/raff-api.md) · [All operations](https://skmtc.dev/rafftechnologies/apis/raff-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/rafftechnologies/raff-api/revisions/2f4df56be77c/schema)
