Sample - GitHub REST API
GET/repos/{owner}/{repo}/keys/{key_id}

Get a deploy key

Retrieves a specific deploy key from a repository. Supply key_id to identify the key you want to inspect and use owner and repo to select the repository.

  • RetriesRetries up to 2×, 500ms backoff, 30s timeout.

3 parameters
ownerstringrequired
The account owner of the repository; the name is not case sensitive.
repostringrequired
The repository name without the `.git` extension; the name is not case sensitive.
key_idintegerrequired
The unique identifier of the deploy key to retrieve.

2 status codes
200Returns the deploy key object, including its identifier, SSH key contents, title, verification status, creation time, access mode, and enabled state.
idintegerrequired
keystringrequired
urlstringrequired
titlestringrequired
verifiedbooleanrequired
created_atstringrequired
read_onlybooleanrequired
added_bystringoptional
last_usedstringoptional
enabledbooleanoptional
404Returned when the repository or deploy key cannot be found.
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional

Error handling

A 404 is returned when the repository or deploy key cannot be found. key_id must identify the deploy key within the repository specified by owner and repo.