GET/user

Get the authenticated 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.

  • RetriesRetries up to 2×, 500ms backoff, 30s timeout.

4 status codes
200Response
loginstringrequired
idintegerrequired
user_view_typestringoptional
node_idstringrequired
avatar_urlstringrequired
gravatar_idstringrequired
urlstringrequired
html_urlstringrequired
followers_urlstringrequired
following_urlstringrequired
gists_urlstringrequired
starred_urlstringrequired
subscriptions_urlstringrequired
organizations_urlstringrequired
repos_urlstringrequired
events_urlstringrequired
received_events_urlstringrequired
typestringrequired
site_adminbooleanrequired
namestringrequired
companystringrequired
blogstringrequired
locationstringrequired
emailstringrequired
notification_emailstringoptional
hireablebooleanrequired
biostringrequired
twitter_usernamestringoptional
public_reposintegerrequired
public_gistsintegerrequired
followersintegerrequired
followingintegerrequired
created_atstringrequired
updated_atstringrequired
private_gistsintegerrequired
total_private_reposintegerrequired
owned_private_reposintegerrequired
disk_usageintegerrequired
collaboratorsintegerrequired
two_factor_authenticationbooleanrequired
planobjectoptional
business_plusbooleanoptional
ldap_dnstringoptional
304Not modified
401Requires authentication
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional
403Forbidden
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional

Error handling

A 401 is returned: Requires authentication. A 403 is returned: Forbidden.

Was this helpful?