SSH keys

List public keys

Returns the public SSH keys of the authorized user.
Required scopes: USER_KEY

Resource URL

GET
/user/keys

Example

Request
GET
https://api.buddy.works/user/keys
Sample Response
Status: 200 OK
X-Rate-Limit-Limit: 1
X-Rate-Limit-Remaining: 999
{
  "url": "https://api.buddy.works/user/keys",
  "html_url": "https://app.buddy.works/my-id",
  "keys": [
    {
      "url": "https://api.buddy.works/user/keys/1",
      "html_url": "https://app.buddy.works/my-id",
      "id": 1,
      "title": " BuddyKey",
      "content": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCG0Ug3U8DoJ6+z36D2h2+oc4UoQRihLNGcAO9SHglFXp+dn1aGJrqeoOrmo4bj5AcydjY33Ylm7ixZEe85vD5INCeldMd8JGmZTj57mwzqpKXFrag+/v9F9qmSEPxKZ1cQj7Q/nRi/hJIoJbsxymrxWhdJZnDNeqwdusR78Xkftw== BuddyKey"
    }
  ]
}

Create a public key

Registers a new public SSH key for the authorized user.
Required scopes: USER_KEY

Resource URL

POST
/user/keys

POST Parameters

Name Description
content Required String The unique contents of the public SSH key. Located by default in ~/.ssh/id_rsa.pub.
title String The title of the key.

Example

Request
POST
https://api.buddy.works/user/keys
{
  "content": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCG0Ug3U8DoJ6+z36D2h2+oc4UoQRihLNGcAO9SHglFXp+dn1aGJrqeoOrmo4bj5AcydjY33Ylm7ixZEe85vD5INCeldMd8JGmZTj57mwzqpKXFrag+/v9F9qmSEPxKZ1cQj7Q/nRi/hJIoJbsxymrxWhdJZnDNeqwdusR78Xkftw== mike@mike-Macmini"
}
Sample Response
Status: 201 Created
X-Rate-Limit-Limit: 1
X-Rate-Limit-Remaining: 999
{
  "url": "https://api.buddy.works/user/keys/1",
  "html_url": "https://app.buddy.works/my-id",
  "id": 1,
  "title": " mike@mike-Macmini",
  "content": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCG0Ug3U8DoJ6+z36D2h2+oc4UoQRihLNGcAO9SHglFXp+dn1aGJrqeoOrmo4bj5AcydjY33Ylm7ixZEe85vD5INCeldMd8JGmZTj57mwzqpKXFrag+/v9F9qmSEPxKZ1cQj7Q/nRi/hJIoJbsxymrxWhdJZnDNeqwdusR78Xkftw== mike@mike-Macmini"
}

Update a public key

Public SSH keys cannot be edited. If you want to edit a public key, you must remove and add it again.

Delete a public key

Deletes the public SSH key of the authorized user.
Required scopes: USER_KEY

Resource URL

DELETE
/user/keys/:key_id

URL Parameters

Name Description
key_id Required Integer The key ID.

Example

Request
DELETE
https://api.buddy.works/user/keys/1
Sample Response
Status: 204 NoContent
X-Rate-Limit-Limit: 1
X-Rate-Limit-Remaining: 999

Get a public SSH key

Returns the public SSH key of the authorized user.
Required scopes: USER_KEY

Resource URL

GET
/user/keys/:key_id

URL Parameters

Name Description
key_id Required Integer The key ID.

Example

Request
GET
https://api.buddy.works/user/keys/1
Sample Response
Status: 200 OK
X-Rate-Limit-Limit: 1
X-Rate-Limit-Remaining: 999
{
  "url": "https://api.buddy.works/user/keys/1",
  "html_url": "https://app.buddy.works/my-id",
  "id": 1,
  "title": " BuddyKey",
  "content": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCG0Ug3U8DoJ6+z36D2h2+oc4UoQRihLNGcAO9SHglFXp+dn1aGJrqeoOrmo4bj5AcydjY33Ylm7ixZEe85vD5INCeldMd8JGmZTj57mwzqpKXFrag+/v9F9qmSEPxKZ1cQj7Q/nRi/hJIoJbsxymrxWhdJZnDNeqwdusR78Xkftw== BuddyKey"
}