REST API endpoints for users

Use the REST API to get public and private information about authenticated users.

Note

Most endpoints use Authorization: Bearer <YOUR-TOKEN> and Accept: application/vnd.github+json headers, plus X-GitHub-Api-Version: 2026-03-10. Curl examples below omit these standard headers for brevity.

Get the authenticated user

GET /user

OAuth app tokens and personal access tokens (classic) need the read:user scope, or the broader user scope, for this endpoint to return the private user response. The private user response includes additional fields such as private_gists, total_private_repos, owned_private_repos, disk_usage, collaborators, and two_factor_authentication. Tokens without these scopes receive the public user response.
The private and public user response types are unrelated to the private profile setting. A token without scopes still authenticates as the token's owner, so values subject to private profile visibility, such as followers and following, may differ from an unauthenticated response.

HTTP response status codes

Code examples

Example 1: Status Code 200

Request:

curl -L \
  -X GET \
  https://api.github.com/user

Response schema (Status: 200):

Example 2: Status Code 200

Request:

curl -L \
  -X GET \
  https://api.github.com/user

Response schema (Status: 200):

Update the authenticated user

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.

Parameters

Headers

Body parameters

HTTP response status codes

Code examples

Example of updating blog and name

Request:

curl -L \
  -X PATCH \
  https://api.github.com/user \
  -d '{
  "blog": "https://github.com/blog",
  "name": "monalisa octocat"
}'

Response schema (Status: 200):

Get a user using their ID

GET /user/{account_id}

Provides publicly available information about someone with a GitHub account. This method takes their durable user ID instead of their login, which can change over time.
If you are requesting information about an Enterprise Managed User, or a GitHub App bot that is installed in an organization that uses Enterprise Managed Users, your requests must be authenticated as a user or GitHub App that has access to the organization to view that account's information. If you are not authorized, the request will return a 404 Not Found status.
The email key in the following response is the publicly visible email address from your GitHub profile page. When setting up your profile, you can select a primary email address to be public which provides an email entry for this endpoint. If you do not set a public email address for email, then it will have a value of null. You only see publicly visible email addresses when authenticated with GitHub. For more information, see Authentication.
The Emails API enables you to list all of your email addresses, and toggle a primary email to be visible publicly. For more information, see Emails API.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example 1: Status Code 200

Request:

curl -L \
  -X GET \
  https://api.github.com/user/ACCOUNT_ID

Response schema (Status: 200):

Same response schema as Get the authenticated user.

Example 2: Status Code 200

Request:

curl -L \
  -X GET \
  https://api.github.com/user/ACCOUNT_ID

Response schema (Status: 200):

Same response schema as Get the authenticated user.

List users

GET /users

Lists all users, in the order that they signed up on GitHub. This list includes personal user accounts and organization accounts.
Note: Pagination is powered exclusively by the since parameter. Use the Link header to get the URL for the next page of users.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/users

Response schema (Status: 200):

Array of Simple User:

Get a user

GET /users/{username}

Provides publicly available information about someone with a GitHub account.
If the specified user has a private profile, the followers and following values are 0 unless the request is authenticated as that user. A request authenticated as the specified user returns the actual values even if the token has no OAuth scopes.
The events_url value is a URI template. Replace {/privacy} with /public to retrieve only public events. Omit it to retrieve public events and, when authenticated as the user, private events. For more information, see "List events for the authenticated user."
If you are requesting information about an Enterprise Managed User, or a GitHub App bot that is installed in an organization that uses Enterprise Managed Users, your requests must be authenticated as a user or GitHub App that has access to the organization to view that account's information. If you are not authorized, the request will return a 404 Not Found status.
The email key in the following response is the publicly visible email address from your GitHub profile page. When setting up your profile, you can select a primary email address to be public which provides an email entry for this endpoint. If you do not set a public email address for email, then it will have a value of null. You only see publicly visible email addresses when authenticated with GitHub. For more information, see Authentication.
The Emails API enables you to list all of your email addresses, and toggle a primary email to be visible publicly. For more information, see Emails API.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example 1: Status Code 200

Request:

curl -L \
  -X GET \
  https://api.github.com/users/USERNAME

Response schema (Status: 200):

Same response schema as Get the authenticated user.

Example 2: Status Code 200

Request:

curl -L \
  -X GET \
  https://api.github.com/users/USERNAME

Response schema (Status: 200):

Same response schema as Get the authenticated user.

Get contextual information for a user

GET /users/{username}/hovercard

Provides hovercard information. You can find out more about someone in relation to their pull requests, issues, repositories, and organizations.
The subject_type and subject_id parameters provide context for the person's hovercard, which returns more information than without the parameters. For example, if you wanted to find out more about octocat who owns the Spoon-Knife repository, you would use a subject_type value of repository and a subject_id value of 1300192 (the ID of the Spoon-Knife repository).
OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/users/USERNAME/hovercard

Response schema (Status: 200):