SSH Keys

The SSH keys endpoints allow you to manage SSH keys, including adding, listing, and removing SSH keys.


POST/sshkeys

Add SSH Key

This endpoint allows you to add a new SSH key.

Required attributes

  • Name
    name
    Type
    string
    Description

    The name of the SSH key.

  • Name
    key
    Type
    string
    Description

    The public SSH key.

Request

POST
/sshkeys
curl -X POST https://api.puregpu.com/sshkeys \
  -H "X-API-Key: {token}" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Research Laptop Key",
    "key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC3..."
  }'

Response

{
  "result": "success",
  "ssh_key": {
      "id": 28,
      "name": "Research Laptop Key",
      "key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC3..."
  }
}

GET/sshkeys

List SSH Keys

This endpoint allows you to list all available SSH keys.

Request

GET
/sshkeys
curl -G https://api.puregpu.com/sshkeys \
  -H "X-API-Key: {token}"

Response

{
  "result": "success",
  "ssh_keys": [
      {
        "id": 28,
        "name": "Research Laptop Key",
        "key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC3..."
      }
  ]
}

DELETE/sshkeys/:id

Remove SSH Key

This endpoint allows you to remove an SSH key.

Required attributes

  • Name
    id
    Type
    integer
    Description

    The ID of the SSH key to remove, fetched from the List SSH Keys endpoint.

Request

DELETE
/sshkeys/:id
curl -X DELETE https://api.puregpu.com/sshkeys/28 \
  -H "X-API-Key: {token}"

Response

{
  "result": "success",
  "message": "SSH key removed"
}