# Get a public SSH key for the authenticated user

From **GitHub v3 REST API**.

`GET /user/keys/{key_id}`

View extended details for a single public SSH key. Requires that you are authenticated via Basic Auth or via OAuth with at least `read:public_key` [scope](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).

## Parameters

### `key_id`

- Location: path
- Required: true
- Type: `integer`

key_id parameter

## Responses

### `200`

Response

### `application/json`

- Type: `object`

Key

```json
{
  "created_at": "2020-06-11T21:31:57Z",
  "id": 2,
  "key": "2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234",
  "read_only": false,
  "title": "ssh-rsa AAAAB3NzaC1yc2EAAA",
  "url": "https://api.github.com/user/keys/2",
  "verified": false
}
```

```json
{"description":"Key","properties":{"created_at":{"format":"date-time","type":"string"},"id":{"type":"integer"},"key":{"type":"string"},"read_only":{"type":"boolean"},"title":{"type":"string"},"url":{"type":"string"},"verified":{"type":"boolean"}},"required":["key","id","url","title","created_at","verified","read_only"],"title":"Key","type":"object"}
```

### `304`

Not modified

### `401`

Requires authentication

### `application/json`

- Type: `object`

Basic Error

```json
{"description":"Basic Error","properties":{"documentation_url":{"type":"string"},"message":{"type":"string"},"status":{"type":"string"},"url":{"type":"string"}},"title":"Basic Error","type":"object"}
```

### `403`

Forbidden

### `application/json`

- Type: `object`

Basic Error

```json
{"description":"Basic Error","properties":{"documentation_url":{"type":"string"},"message":{"type":"string"},"status":{"type":"string"},"url":{"type":"string"}},"title":"Basic Error","type":"object"}
```

### `404`

Resource not found

### `application/json`

- Type: `object`

Basic Error

```json
{"description":"Basic Error","properties":{"documentation_url":{"type":"string"},"message":{"type":"string"},"status":{"type":"string"},"url":{"type":"string"}},"title":"Basic Error","type":"object"}
```

## Request examples

### cURL

```shell
curl --request GET \
  --url {protocol}://{hostname}/api/v3/user/keys/{key_id}
```
