Add ssh key

POST /servers/{serverId}/sshcredentials

Parameters
label requiredStringLabel of the credential
username requiredStringUsername of user inside your server
publicKey requiredStringThe SSH Key string
HTTP Request
POST https://manage.runcloud.io/api/v2/servers/{serverId}/sshcredentials
Request
curl --request POST \
  --url https://manage.runcloud.io/api/v2servers/7/sshcredentials \
  -u YOUR_API_KEY:YOUR_API_SECRET \
  --header 'accept: application/json' \
  --header 'content-type: application/json' \
  --data '{
    "label": "mypc-runcloud",
    "username": "runcloud",
    "publicKey": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCjUkPY+cu9I25/3nH96vv6gwqKaKufohfQDv7sO5Z9UITba1vzeIMR1OGJaWgSY08ey9XTP/907hf/gfG0gP3AfrBd+bAuFoMc1W/NEQ5KXrfvGVX9VPR6A4or227NUDJ8NYeYigtsvCe8lMA8E19PUnUPQtl5mYSkN6lNZaxVWcMxhNrcHmvBcLHwxBsTGxn2DWYxBt+DMp/BirxYVInvd6kyY/a4Z6GKQ5iUAgjVyS/e683UX8bkNPN+s3Th20R+/ffvf93BRtwQQiw6KKa9OeWgFo4pdaNGE326RGwueE7bC7W2+vrG77ZG5eBx/R9Wvf/XJCUSGSHISo9lwQ69 [email protected]"
}'
Response
{
    "id": 17,
    "label": "mypc-runcloud",
    "user_id": 2,
    "publicKey": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCjUkPY+cu9I25/3nH96vv6gwqKaKufohfQDv7sO5Z9UITba1vzeIMR1OGJaWgSY08ey9XTP/907hf/gfG0gP3AfrBd+bAuFoMc1W/NEQ5KXrfvGVX9VPR6A4or227NUDJ8NYeYigtsvCe8lMA8E19PUnUPQtl5mYSkN6lNZaxVWcMxhNrcHmvBcLHwxBsTGxn2DWYxBt+DMp/BirxYVInvd6kyY/a4Z6GKQ5iUAgjVyS/e683UX8bkNPN+s3Th20R+/ffvf93BRtwQQiw6KKa9OeWgFo4pdaNGE326RGwueE7bC7W2+vrG77ZG5eBx/R9Wvf/XJCUSGSHISo9lwQ69 [email protected]",
    "created_at": "2019-06-22 14:50:22"
}

List SSH keys

GET /servers/{serverId}/sshcredentials

Query String Parameters
label optionalStringSearch string to search the label or the server user
HTTP Request
GET https://manage.runcloud.io/api/v2/servers/{serverId}/sshcredentials
Request
curl --request GET \
  --url https://manage.runcloud.io/api/v2/servers/7/sshcredentials \
  -u YOUR_API_KEY:YOUR_API_SECRET \
  --header 'accept: application/json' \
  --header 'content-type: application/json'
Response
{
    "data": [
        {
            "id": 17,
            "label": "mypc-runcloud",
            "user_id": 2,
            "publicKey": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCjUkPY+cu9I25/3nH96vv6gwqKaKufohfQDv7sO5Z9UITba1vzeIMR1OGJaWgSY08ey9XTP/907hf/gfG0gP3AfrBd+bAuFoMc1W/NEQ5KXrfvGVX9VPR6A4or227NUDJ8NYeYigtsvCe8lMA8E19PUnUPQtl5mYSkN6lNZaxVWcMxhNrcHmvBcLHwxBsTGxn2DWYxBt+DMp/BirxYVInvd6kyY/a4Z6GKQ5iUAgjVyS/e683UX8bkNPN+s3Th20R+/ffvf93BRtwQQiw6KKa9OeWgFo4pdaNGE326RGwueE7bC7W2+vrG77ZG5eBx/R9Wvf/XJCUSGSHISo9lwQ69 [email protected]",
            "created_at": "2019-06-22 14:50:22"
        },
        {
            "id": 14,
            "label": "test",
            "user_id": 2,
            "publicKey": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCjUkPY+cu9I25/3nH96vv6gwqKaKufohfQDv7sO5Z9UITba1vzeIMR1OGJaWgSY08ey9XTP/907hf/gfG0gP3AfrBd+bAuFoMc1W/NEQ5KXrfvGVX9VPR6A4or227NUDJ8NYeYigtsvCe8lMA8E19PUnUPQtl5mYSkN6lNZaxVWcMxhNrcHmvBcLHwxBsTGxn2DWYxBt+DMp/BirxYVInvd6kyY/a4Z6GKQ5iUAgjVyS/e683UX8bkNPN+s3Th20R+/ffvf93BRtwQQiw6KKa9OeWgFo4pdaNGE326RGwueE7bC7W2+vrG77ZG5eBx/R9Wvf/XJCUSGSHISo9lwQ69 [email protected]",
            "created_at": "2019-06-22 14:38:52"
        }
    ],
    "meta": {
        "pagination": {
            "total": 2,
            "count": 2,
            "per_page": 15,
            "current_page": 1,
            "total_pages": 1,
            "links": {}
        }
    }
}

SSH Key object

GET /servers/{serverId}/sshcredentials/{credentialId}

HTTP Request
GET https://manage.runcloud.io/api/v2/servers/{serverId}/sshcredentials/{credentialId}
Request
curl -X GET "https://manage.runcloud.io/api/v2/servers/yO4VAbX2BkNz/sshcredentials/OGv82zb25XLm" \
    -u YOUR_API_KEY:YOUR_API_SECRET \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"


curl --request GET \
  --url https://manage.runcloud.io/api/v2/servers/7/sshcredentials/17 \
  -u YOUR_API_KEY:YOUR_API_SECRET \
  --header 'accept: application/json' \
  --header 'content-type: application/json'
Response
{
    "id": 17,
    "label": "mypc-runcloud",
    "user_id": 2,
    "publicKey": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCjUkPY+cu9I25/3nH96vv6gwqKaKufohfQDv7sO5Z9UITba1vzeIMR1OGJaWgSY08ey9XTP/907hf/gfG0gP3AfrBd+bAuFoMc1W/NEQ5KXrfvGVX9VPR6A4or227NUDJ8NYeYigtsvCe8lMA8E19PUnUPQtl5mYSkN6lNZaxVWcMxhNrcHmvBcLHwxBsTGxn2DWYxBt+DMp/BirxYVInvd6kyY/a4Z6GKQ5iUAgjVyS/e683UX8bkNPN+s3Th20R+/ffvf93BRtwQQiw6KKa9OeWgFo4pdaNGE326RGwueE7bC7W2+vrG77ZG5eBx/R9Wvf/XJCUSGSHISo9lwQ69 [email protected]",
    "created_at": "2019-06-22 14:50:22"
}

Delete SSH key

DELETE /servers/{serverId}/sshcredentials/{credentialId}

HTTP Request
DELETE https://manage.runcloud.io/api/v2/servers/{serverId}/sshcredentials/{credentialId}
Request
curl --request DELETE \
  --url https://manage.runcloud.io/api/v2/servers/7/sshcredentials/17 \
  -u YOUR_API_KEY:YOUR_API_SECRET \
  --header 'accept: application/json' \
  --header 'content-type: application/json'
Response
{
    "id": 17,
    "label": "mypc-runcloud",
    "user_id": 2,
    "publicKey": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCjUkPY+cu9I25/3nH96vv6gwqKaKufohfQDv7sO5Z9UITba1vzeIMR1OGJaWgSY08ey9XTP/907hf/gfG0gP3AfrBd+bAuFoMc1W/NEQ5KXrfvGVX9VPR6A4or227NUDJ8NYeYigtsvCe8lMA8E19PUnUPQtl5mYSkN6lNZaxVWcMxhNrcHmvBcLHwxBsTGxn2DWYxBt+DMp/BirxYVInvd6kyY/a4Z6GKQ5iUAgjVyS/e683UX8bkNPN+s3Th20R+/ffvf93BRtwQQiw6KKa9OeWgFo4pdaNGE326RGwueE7bC7W2+vrG77ZG5eBx/R9Wvf/XJCUSGSHISo9lwQ69 [email protected]",
    "created_at": "2019-06-22 14:50:22"
}