# Update the authenticated user

From **GitHub v3 REST API**.

`PATCH /user`

**Note:** If your email is set to private and you send an `email` parameter as part of this request to update your profile, your privacy settings are still enforced: the email address will not be displayed on your public profile or via the API.

## Request body

- Required: false
### `application/json`

- Type: `object`

```json
{"properties":{"bio":{"description":"The new short biography of the user.","type":"string"},"blog":{"description":"The new blog URL of the user.","example":"blog.example.com","type":"string"},"company":{"description":"The new company of the user.","example":"Acme corporation","type":"string"},"email":{"description":"The publicly visible email address of the user.","example":"omar@example.com","type":"string"},"hireable":{"description":"The new hiring availability of the user.","type":"boolean"},"location":{"description":"The new location of the user.","example":"Berlin, Germany","type":"string"},"name":{"description":"The new name of the user.","example":"Omar Jahandar","type":"string"},"twitter_username":{"description":"The new Twitter username of the user.","example":"therealomarj","nullable":true,"type":"string"}},"type":"object"}
```

## Responses

### `200`

Response

### `application/json`

- Type: `object`

Private User

```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
{"description":"Private User","properties":{"avatar_url":{"example":"https://github.com/images/error/octocat_happy.gif","format":"uri","type":"string"},"bio":{"example":"There once was...","nullable":true,"type":"string"},"blog":{"example":"https://github.com/blog","nullable":true,"type":"string"},"business_plus":{"type":"boolean"},"collaborators":{"example":8,"type":"integer"},"company":{"example":"GitHub","nullable":true,"type":"string"},"created_at":{"example":"2008-01-14T04:33:35Z","format":"date-time","type":"string"},"disk_usage":{"example":10000,"type":"integer"},"email":{"example":"octocat@github.com","format":"email","nullable":true,"type":"string"},"events_url":{"example":"https://api.github.com/users/octocat/events{/privacy}","type":"string"},"followers":{"example":20,"type":"integer"},"followers_url":{"example":"https://api.github.com/users/octocat/followers","format":"uri","type":"string"},"following":{"example":0,"type":"integer"},"following_url":{"example":"https://api.github.com/users/octocat/following{/other_user}","type":"string"},"gists_url":{"example":"https://api.github.com/users/octocat/gists{/gist_id}","type":"string"},"gravatar_id":{"example":"41d064eb2195891e12d0413f63227ea7","nullable":true,"type":"string"},"hireable":{"nullable":true,"type":"boolean"},"html_url":{"example":"https://github.com/octocat","format":"uri","type":"string"},"id":{"example":1,"type":"integer"},"ldap_dn":{"type":"string"},"location":{"example":"San Francisco","nullable":true,"type":"string"},"login":{"example":"octocat","type":"string"},"name":{"example":"monalisa octocat","nullable":true,"type":"string"},"node_id":{"example":"MDQ6VXNlcjE=","type":"string"},"organizations_url":{"example":"https://api.github.com/users/octocat/orgs","format":"uri","type":"string"},"owned_private_repos":{"example":100,"type":"integer"},"plan":{"properties":{"collaborators":{"type":"integer"},"name":{"type":"string"},"private_repos":{"type":"integer"},"space":{"type":"integer"}},"required":["collaborators","name","space","private_repos"],"type":"object"},"private_gists":{"example":81,"type":"integer"},"public_gists":{"example":1,"type":"integer"},"public_repos":{"example":2,"type":"integer"},"received_events_url":{"example":"https://api.github.com/users/octocat/received_events","format":"uri","type":"string"},"repos_url":{"example":"https://api.github.com/users/octocat/repos","format":"uri","type":"string"},"site_admin":{"type":"boolean"},"starred_url":{"example":"https://api.github.com/users/octocat/starred{/owner}{/repo}","type":"string"},"subscriptions_url":{"example":"https://api.github.com/users/octocat/subscriptions","format":"uri","type":"string"},"suspended_at":{"format":"date-time","nullable":true,"type":"string"},"total_private_repos":{"example":100,"type":"integer"},"two_factor_authentication":{"example":true,"type":"boolean"},"type":{"example":"User","type":"string"},"updated_at":{"example":"2008-01-14T04:33:35Z","format":"date-time","type":"string"},"url":{"example":"https://api.github.com/users/octocat","format":"uri","type":"string"}},"required":["avatar_url","events_url","followers_url","following_url","gists_url","gravatar_id","html_url","id","node_id","login","organizations_url","received_events_url","repos_url","site_admin","starred_url","subscriptions_url","type","url","bio","blog","company","email","followers","following","hireable","location","name","public_gists","public_repos","created_at","updated_at","collaborators","disk_usage","owned_private_repos","private_gists","total_private_repos","two_factor_authentication"],"title":"Private User","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"}
```

### `422`

Validation failed

### `application/json`

- Type: `object`

Validation Error

```json
{"description":"Validation Error","properties":{"documentation_url":{"type":"string"},"errors":{"items":{"properties":{"code":{"type":"string"},"field":{"type":"string"},"index":{"type":"integer"},"message":{"type":"string"},"resource":{"type":"string"},"value":{"oneOf":[{"nullable":true,"type":"string"},{"nullable":true,"type":"integer"},{"items":{"type":"string"},"nullable":true,"type":"array"}]}},"required":["code"],"type":"object"},"type":"array"},"message":{"type":"string"}},"required":["message","documentation_url"],"title":"Validation Error","type":"object"}
```

## Request examples

### cURL

```shell
curl --request PATCH \
  --url {protocol}://{hostname}/api/v3/user \
  --header 'content-type: application/json' \
  --data '{
  "bio": "string",
  "blog": "string",
  "company": "string",
  "email": "string",
  "hireable": true,
  "location": "string",
  "name": "string",
  "twitter_username": "string"
}'
```
