Get a user using their ID
/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
path Path Parameters
| Name | Type |
|---|---|
account_id
required
account_id parameter | number |
Responses
Response
login: string;
id: number;
user_view_type?: string;
node_id: string;
avatar_url: string;
gravatar_id: string | null;
url: string;
html_url: string;
followers_url: string;
following_url: string;
gists_url: string;
starred_url: string;
subscriptions_url: string;
organizations_url: string;
repos_url: string;
events_url: string;
received_events_url: string;
type: string;
site_admin: boolean;
name: string | null;
company: string | null;
blog: string | null;
location: string | null;
email: string | null;
notification_email?: string | null;
hireable: boolean | null;
bio: string | null;
twitter_username?: string | null;
public_repos: number;
public_gists: number;
followers: number;
following: number;
created_at: string;
updated_at: string;
private_gists: number;
total_private_repos: number;
owned_private_repos: number;
disk_usage: number;
collaborators: number;
two_factor_authentication: boolean;
plan?: {
collaborators: number;
name: string;
space: number;
private_repos: number;
};
business_plus?: boolean;
ldap_dn?: string;
} | interface PublicUser {
login: string;
id: number;
user_view_type?: string;
node_id: string;
avatar_url: string;
gravatar_id: string | null;
url: string;
html_url: string;
followers_url: string;
following_url: string;
gists_url: string;
starred_url: string;
subscriptions_url: string;
organizations_url: string;
repos_url: string;
events_url: string;
received_events_url: string;
type: string;
site_admin: boolean;
name: string | null;
company: string | null;
blog: string | null;
location: string | null;
email: string | null;
notification_email?: string | null;
hireable: boolean | null;
bio: string | null;
twitter_username?: string | null;
public_repos: number;
public_gists: number;
followers: number;
following: number;
created_at: string;
updated_at: string;
plan?: {
collaborators: number;
name: string;
space: number;
private_repos: number;
};
private_gists?: number;
total_private_repos?: number;
owned_private_repos?: number;
disk_usage?: number;
collaborators?: number;
}
Client Errors
Resource not found
message?: string;
documentation_url?: string;
url?: string;
status?: string;
}