Skip to main content

users

Creates, updates, deletes, gets or lists a users resource.

Overview​

Nameusers
TypeResource
Idgithub.users.users

Fields​

The following fields are returned by SELECT queries:

Response

NameDatatypeDescription
idinteger (int64)
namestring (example: monalisa octocat)
gravatar_idstring (example: 41d064eb2195891e12d0413f63227ea7)
node_idstring (example: MDQ6VXNlcjE=)
avatar_urlstring (uri) (example: https://github.com/images/error/octocat_happy.gif)
biostring (example: There once was...)
blogstring (example: https://github.com/blog)
business_plusboolean
collaboratorsinteger
companystring (example: GitHub)
created_atstring (date-time) (example: 2008-01-14T04:33:35Z)
disk_usageinteger
emailstring (email) (example: octocat@github.com)
events_urlstring (example: https://api.github.com/users/octocat/events{/privacy})
followersinteger
followers_urlstring (uri) (example: https://api.github.com/users/octocat/followers)
followinginteger
following_urlstring (example: https://api.github.com/users/octocat/following{/other_user})
gists_urlstring (example: https://api.github.com/users/octocat/gists{/gist_id})
hireableboolean
html_urlstring (uri) (example: https://github.com/octocat)
ldap_dnstring
locationstring (example: San Francisco)
loginstring (example: octocat)
notification_emailstring (email) (example: octocat@github.com)
organizations_urlstring (uri) (example: https://api.github.com/users/octocat/orgs)
owned_private_reposinteger
planobject
private_gistsinteger
public_gistsinteger
public_reposinteger
received_events_urlstring (uri) (example: https://api.github.com/users/octocat/received_events)
repos_urlstring (uri) (example: https://api.github.com/users/octocat/repos)
site_adminboolean
starred_urlstring (example: https://api.github.com/users/octocat/starred{/owner}{/repo})
subscriptions_urlstring (uri) (example: https://api.github.com/users/octocat/subscriptions)
total_private_reposinteger
twitter_usernamestring (example: monalisa)
two_factor_authenticationboolean
typestring (example: User)
updated_atstring (date-time) (example: 2008-01-14T04:33:35Z)
urlstring (uri) (example: https://api.github.com/users/octocat)
user_view_typestring

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_by_idselectaccount_idProvides 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.
get_by_usernameselectusernameProvides publicly available information about someone with a GitHub account.

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.
get_authenticatedselectOAuth app tokens and personal access tokens (classic) need the user scope in order for the response to include private profile information.
update_authenticatedupdateNote: 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​

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
account_idintegeraccount_id parameter
usernamestringThe handle for the GitHub user account.

SELECT examples​

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.

SELECT
id,
name,
gravatar_id,
node_id,
avatar_url,
bio,
blog,
business_plus,
collaborators,
company,
created_at,
disk_usage,
email,
events_url,
followers,
followers_url,
following,
following_url,
gists_url,
hireable,
html_url,
ldap_dn,
location,
login,
notification_email,
organizations_url,
owned_private_repos,
plan,
private_gists,
public_gists,
public_repos,
received_events_url,
repos_url,
site_admin,
starred_url,
subscriptions_url,
total_private_repos,
twitter_username,
two_factor_authentication,
type,
updated_at,
url,
user_view_type
FROM github.users.users
WHERE account_id = '{{ account_id }}' -- required
;

UPDATE examples​

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.

UPDATE github.users.users
SET
name = '{{ name }}',
email = '{{ email }}',
blog = '{{ blog }}',
twitter_username = '{{ twitter_username }}',
company = '{{ company }}',
location = '{{ location }}',
hireable = {{ hireable }},
bio = '{{ bio }}'
RETURNING
id,
name,
gravatar_id,
node_id,
avatar_url,
bio,
blog,
business_plus,
collaborators,
company,
created_at,
disk_usage,
email,
events_url,
followers,
followers_url,
following,
following_url,
gists_url,
hireable,
html_url,
ldap_dn,
location,
login,
notification_email,
organizations_url,
owned_private_repos,
plan,
private_gists,
public_gists,
public_repos,
received_events_url,
repos_url,
site_admin,
starred_url,
subscriptions_url,
total_private_repos,
twitter_username,
two_factor_authentication,
type,
updated_at,
url,
user_view_type;