Sign up

Add an SSH key

POST/api/v1/ssh-keys/import

Adds a public key you already have.

Request body

FieldTypeDescription
key_namestring, optionalKey name (letters, digits, space, . _ -; max 64). Auto-generated if empty.
public_keystringrequiredPublic key in OpenSSH format (e.g., 'ssh-ed25519 AAAA... comment')

Example request

curl -X POST "https://platform.serverscamp.com/api/v1/ssh-keys/import" \
  -H "Authorization: Bearer $API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "key_name": "laptop",
    "public_key": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAI... me@laptop"
  }'

Answer

Status 201 with this body.

FieldTypeDescription
idintegerrequiredKey ID
key_namestringrequiredKey name
key_typestringrequiredKey type (ed25519, rsa, ecdsa, etc.)
public_keystringrequiredPublic key in OpenSSH format
fingerprintstringrequiredKey fingerprint (SHA256)
has_private_keybooleanrequiredWhether private key is available for download
created_atstring, optionalCreation timestamp
commentstring, optionalTrailing comment from OpenSSH public key (e.g. user@host)
bitsinteger, optionalKey strength in bits
sourcestring'generated' if private key is stored, else 'imported'
strengthstring'modern' for ed25519/ecdsa, 'legacy' for rsa
statestring'in-use' if at least one VM trusts this key, else 'unused'
last_attached_atstring, optionalWhen the most recent VM using this key was created
trusted_bylist of SSHKeyTrustedVMVMs that have this key installed
trusted_by[].vm_uuidstringrequired
trusted_by[].namestringrequired
{
  "id": 42,
  "key_name": "laptop",
  "key_type": "ed25519",
  "public_key": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAI... me@laptop",
  "fingerprint": "SHA256:7Ke...",
  "has_private_key": false,
  "created_at": "2026-10-23T09:00:00Z"
}

Errors

StatusWhen
400Not a public key in OpenSSH format
401No token, or a token that is not valid
409The key is already in your account
422The body or a parameter is not what the operation takes

Every operation can also answer 401 without a valid token. All errors