Skip to main content

List SSH Keys

curl -X GET "https://panel.example.com/api/account/ssh-keys?page=1&limit=50" \
  -H "Authorization: Bearer YOUR_API_KEY"
Retrieve a paginated list of SSH keys for the authenticated user.

Query Parameters

page
number
default:"1"
The page number to retrieve (minimum: 1).
limit
number
default:"50"
Number of items per page (minimum: 1, maximum: 100).

Response

data
array
Array of SSH key objects.
pagination
object
Pagination metadata.
{
  "data": [
    {
      "id": "clx1a2b3c4d5e6f7g8h9i0j1",
      "name": "Work Laptop",
      "fingerprint": "SHA256:abc123def456ghi789jkl012mno345pqr678stu901vwx234yz",
      "public_key": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOMqqnkVzrm0SdG6UOoqKLsabgH5C9okWi0dh2l9GKJl",
      "created_at": "2024-01-15T10:30:00.000Z"
    }
  ],
  "pagination": {
    "page": 1,
    "perPage": 50,
    "total": 1,
    "totalPages": 1
  }
}

Create SSH Key

curl -X POST "https://panel.example.com/api/account/ssh-keys" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Work Laptop",
    "publicKey": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOMqqnkVzrm0SdG6UOoqKLsabgH5C9okWi0dh2l9GKJl [email protected]"
  }'
Add a new SSH public key to the authenticated user’s account.

Request Body

name
string
required
A friendly name for the SSH key (maximum 255 characters).
publicKey
string
required
The SSH public key string. Must be a valid SSH public key in OpenSSH format.Supported key types:
  • ssh-rsa
  • ssh-dss
  • ssh-ed25519
  • ecdsa-sha2-nistp256
  • ecdsa-sha2-nistp384
  • ecdsa-sha2-nistp521
Each account can have a maximum of 25 SSH keys.

Response

data
object
The created SSH key object.
{
  "data": {
    "id": "clx1a2b3c4d5e6f7g8h9i0j1",
    "name": "Work Laptop",
    "fingerprint": "SHA256:abc123def456ghi789jkl012mno345pqr678stu901vwx234yz",
    "public_key": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOMqqnkVzrm0SdG6UOoqKLsabgH5C9okWi0dh2l9GKJl",
    "created_at": "2024-03-15T10:30:00.000Z"
  }
}

Error Codes

400
error
Invalid SSH public key format or maximum of 25 keys exceeded.
409
error
This SSH key already exists in the system.

Delete SSH Key

curl -X DELETE "https://panel.example.com/api/account/ssh-keys/clx1a2b3c4d5e6f7g8h9i0j1" \
  -H "Authorization: Bearer YOUR_API_KEY"
Delete an SSH key by its ID.

Path Parameters

id
string
required
The unique identifier of the SSH key to delete.

Response

success
boolean
Always true if the deletion was successful.
message
string
Confirmation message.
{
  "success": true,
  "message": "SSH key deleted successfully"
}

Error Codes

400
error
Missing SSH key ID in request.
404
error
SSH key not found or does not belong to the authenticated user.

Build docs developers (and LLMs) love