# Get the authenticated user

From **GitHub v3 REST API**.

`GET /user`

If the authenticated user is authenticated through basic authentication or OAuth with the `user` scope, then the response lists public and private profile information.

If the authenticated user is authenticated through OAuth without the `user` scope, then the response lists only public profile information.

## Responses

### `200`

Response

### `application/json`

```json
{
  "avatar_url": "https://github.com/images/error/octocat_happy.gif",
  "bio": "There once was...",
  "blog": "https://github.com/blog",
  "collaborators": 8,
  "company": "GitHub",
  "created_at": "2008-01-14T04:33:35Z",
  "disk_usage": 10000,
  "email": "octocat@github.com",
  "events_url": "https://api.github.com/users/octocat/events{/privacy}",
  "followers": 20,
  "followers_url": "https://api.github.com/users/octocat/followers",
  "following": 0,
  "following_url": "https://api.github.com/users/octocat/following{/other_user}",
  "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
  "gravatar_id": "",
  "hireable": false,
  "html_url": "https://github.com/octocat",
  "id": 1,
  "location": "San Francisco",
  "login": "octocat",
  "name": "monalisa octocat",
  "node_id": "MDQ6VXNlcjE=",
  "organizations_url": "https://api.github.com/users/octocat/orgs",
  "owned_private_repos": 100,
  "plan": {
    "collaborators": 0,
    "name": "Medium",
    "private_repos": 20,
    "space": 400
  },
  "private_gists": 81,
  "public_gists": 1,
  "public_repos": 2,
  "received_events_url": "https://api.github.com/users/octocat/received_events",
  "repos_url": "https://api.github.com/users/octocat/repos",
  "site_admin": false,
  "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
  "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
  "total_private_repos": 100,
  "two_factor_authentication": true,
  "type": "User",
  "updated_at": "2008-01-14T04:33:35Z",
  "url": "https://api.github.com/users/octocat"
}
```

```json
{"oneOf":[{"$ref":"#/components/schemas/private-user"},{"$ref":"#/components/schemas/public-user"}]}
```

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

## Request examples

### cURL

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