Deploy Keys

List deploy keys

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 a deploy key

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"
}

Add a new deploy key

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 a deploy key

Deploy keys are immutable. If you need to update a key, remove the key and create a new one instead.

Remove a deploy key

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

Response

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