Repo Deploy Keys API

List

GET /repos/:owner/:repo/keys

Response

Status: 200 OK
X-RateLimit-Limit: 5000
X-RateLimit-Remaining: 4999
[
  {
    "id": 1,
    "key": "ssh-rsa AAA...",
    "url": "https://api.github.com/user/keys/1",
    "title": "octocat@octomac"
  }
]

Get

GET /repos/:owner/:repo/keys/:id

Response

Status: 200 OK
X-RateLimit-Limit: 5000
X-RateLimit-Remaining: 4999
{
  "id": 1,
  "key": "ssh-rsa AAA...",
  "url": "https://api.github.com/user/keys/1",
  "title": "octocat@octomac"
}

Create

POST /repos/:owner/:repo/keys

Input

{
  "title": "octocat@octomac",
  "key": "ssh-rsa AAA..."
}

Response

Status: 201 Created
Location: https://api.github.com/user/repo/keys/1
X-RateLimit-Limit: 5000
X-RateLimit-Remaining: 4999
{
  "id": 1,
  "key": "ssh-rsa AAA...",
  "url": "https://api.github.com/user/keys/1",
  "title": "octocat@octomac"
}

Edit

PATCH /repos/:owner/:repo/keys/:id

Input

{
  "title": "octocat@octomac",
  "key": "ssh-rsa AAA..."
}

Response

Status: 200 OK
X-RateLimit-Limit: 5000
X-RateLimit-Remaining: 4999
{
  "id": 1,
  "key": "ssh-rsa AAA...",
  "url": "https://api.github.com/user/keys/1",
  "title": "octocat@octomac"
}

Delete

DELETE /repos/:owner/:repo/keys/:id

Response

Status: 204 No Content
X-RateLimit-Limit: 5000
X-RateLimit-Remaining: 4999