API Documentation

Generate SSH Key

Generates a new SSH key pair on a VPS. The public key is returned in the response. Optionally stores the key 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 "generate"
displayName string No Display name for the key
useForWebTerminal boolean No Store the key for web terminal access (default: false)

Response

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

Response Fields

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

Errors

Status Code Description
400 INVALID_ACTION action must be "generate" or "upload"
404 NOT_FOUND VPS not found or no access
502 PROVIDER_ERROR Key generation 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": "generate", "displayName": "my-key", "useForWebTerminal": true}'

MCP

This action is also available via the generate_ssh_key MCP tool.