Get the authenticated user
GET
/user https://api.github.com
OAuth app tokens and personal access tokens (classic) need the user scope in order for the response to include private profile information.
Responses
200 application/json
Response
interface PrivateUser {
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;
}
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;
}
Redirects
304
Not modified
unknown
Client Errors
401 application/json
Requires authentication
interface BasicError {
message?: string;
documentation_url?: string;
url?: string;
status?: string;
}
message?: string;
documentation_url?: string;
url?: string;
status?: string;
}
403 application/json
Forbidden
interface BasicError {
message?: string;
documentation_url?: string;
url?: string;
status?: string;
}
message?: string;
documentation_url?: string;
url?: string;
status?: string;
}