API Documentation

Upload SSH Key

Uploads an existing SSH public key to a VPS. Optionally stores the key ID for web terminal access.

Required scope: vps:manage

Path Parameters

Parameter Type Description
id string The VPS ID

Headers

Header Required Value
Authorization Yes Bearer YOUR_API_KEY
Content-Type Yes application/json

Body

Field Type Required Description
action string Yes Must be "upload"
publicKey string Yes The SSH public key (must start with ssh-)
displayName string No Display name for the key
useForWebTerminal boolean No Store the key ID for web terminal access (default: false)

Response

{
  "data": {
    "keyId": "abc123",
    "displayName": "my-key",
    "publicKey": "ssh-ed25519 AAAAC3NzaC1...",
    "webTerminalKeyId": null
  }
}

Response Fields

Field Type Description
keyId string Unique identifier for the uploaded key
displayName string Display name of the key
publicKey string The uploaded public key
webTerminalKeyId string | null The key ID if stored for web terminal, otherwise null

Note: Uploading a public key for web terminal access only stores the key ID. The web terminal still requires a stored private key (from a previously generated key or rescue flow) to connect.

Errors

Status Code Description
400 INVALID_ACTION action must be "generate" or "upload"
400 MISSING_PUBLIC_KEY publicKey is required for upload
400 INVALID_PUBLIC_KEY Public key must start with ssh-
404 NOT_FOUND VPS not found or no access
502 PROVIDER_ERROR Key upload failed at the provider

Example

curl -X POST "https://hosting.site.quest/api/v1/vps/699cdea2ab57a244bb5273fd/ssh/keys" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"action": "upload", "publicKey": "ssh-ed25519 AAAAC3NzaC1...", "displayName": "my-laptop"}'

MCP

This action is also available via the upload_ssh_key MCP tool.