Skip to content

Get a deploy key

GET
/repos/{owner}/{repo}/keys/{key_id}

API method documentation

owner
required
string

The account owner of the repository. The name is not case sensitive.

repo
required
string

The name of the repository without the .git extension. The name is not case sensitive.

key_id
required
integer

The unique identifier of the key.

Response

Media type application/json
Deploy Key

An SSH key granting access to a single repository.

object
id
required
integer
key
required
string
url
required
string
title
required
string
verified
required
boolean
created_at
required
string
read_only
required
boolean
added_by
string
nullable
last_used
string format: date-time
nullable
enabled
boolean
Examples
Example default
{
"id": 1,
"key": "ssh-rsa AAA...",
"url": "https://api.github.com/repos/octocat/Hello-World/keys/1",
"title": "octocat@octomac",
"verified": true,
"created_at": "2014-12-10T15:53:42Z",
"read_only": true,
"added_by": "octocat",
"last_used": "2022-01-10T15:53:42Z",
"enabled": true
}

Resource not found

Media type application/json
Basic Error

Basic Error

object
message
string
documentation_url
string
url
string
status
string
Example generated
{
"message": "example",
"documentation_url": "example",
"url": "example",
"status": "example"
}