users
Creates, updates, deletes, gets or lists a users resource.
Overview​
| Name | users |
| Type | Resource |
| Id | github.users.users |
Fields​
The following fields are returned by SELECT queries:
- get_by_id
- get_by_username
- get_authenticated
Response
| Name | Datatype | Description |
|---|---|---|
id | integer (int64) | |
name | string | (example: monalisa octocat) |
gravatar_id | string | (example: 41d064eb2195891e12d0413f63227ea7) |
node_id | string | (example: MDQ6VXNlcjE=) |
avatar_url | string (uri) | (example: https://github.com/images/error/octocat_happy.gif) |
bio | string | (example: There once was...) |
blog | string | (example: https://github.com/blog) |
business_plus | boolean | |
collaborators | integer | |
company | string | (example: GitHub) |
created_at | string (date-time) | (example: 2008-01-14T04:33:35Z) |
disk_usage | integer | |
email | string (email) | (example: octocat@github.com) |
events_url | string | (example: https://api.github.com/users/octocat/events{/privacy}) |
followers | integer | |
followers_url | string (uri) | (example: https://api.github.com/users/octocat/followers) |
following | integer | |
following_url | string | (example: https://api.github.com/users/octocat/following{/other_user}) |
gists_url | string | (example: https://api.github.com/users/octocat/gists{/gist_id}) |
hireable | boolean | |
html_url | string (uri) | (example: https://github.com/octocat) |
ldap_dn | string | |
location | string | (example: San Francisco) |
login | string | (example: octocat) |
notification_email | string (email) | (example: octocat@github.com) |
organizations_url | string (uri) | (example: https://api.github.com/users/octocat/orgs) |
owned_private_repos | integer | |
plan | object | |
private_gists | integer | |
public_gists | integer | |
public_repos | integer | |
received_events_url | string (uri) | (example: https://api.github.com/users/octocat/received_events) |
repos_url | string (uri) | (example: https://api.github.com/users/octocat/repos) |
site_admin | boolean | |
starred_url | string | (example: https://api.github.com/users/octocat/starred{/owner}{/repo}) |
subscriptions_url | string (uri) | (example: https://api.github.com/users/octocat/subscriptions) |
total_private_repos | integer | |
twitter_username | string | (example: monalisa) |
two_factor_authentication | boolean | |
type | string | (example: User) |
updated_at | string (date-time) | (example: 2008-01-14T04:33:35Z) |
url | string (uri) | (example: https://api.github.com/users/octocat) |
user_view_type | string |
Response
| Name | Datatype | Description |
|---|---|---|
id | integer (int64) | |
name | string | (example: monalisa octocat) |
gravatar_id | string | (example: 41d064eb2195891e12d0413f63227ea7) |
node_id | string | (example: MDQ6VXNlcjE=) |
avatar_url | string (uri) | (example: https://github.com/images/error/octocat_happy.gif) |
bio | string | (example: There once was...) |
blog | string | (example: https://github.com/blog) |
business_plus | boolean | |
collaborators | integer | |
company | string | (example: GitHub) |
created_at | string (date-time) | (example: 2008-01-14T04:33:35Z) |
disk_usage | integer | |
email | string (email) | (example: octocat@github.com) |
events_url | string | (example: https://api.github.com/users/octocat/events{/privacy}) |
followers | integer | |
followers_url | string (uri) | (example: https://api.github.com/users/octocat/followers) |
following | integer | |
following_url | string | (example: https://api.github.com/users/octocat/following{/other_user}) |
gists_url | string | (example: https://api.github.com/users/octocat/gists{/gist_id}) |
hireable | boolean | |
html_url | string (uri) | (example: https://github.com/octocat) |
ldap_dn | string | |
location | string | (example: San Francisco) |
login | string | (example: octocat) |
notification_email | string (email) | (example: octocat@github.com) |
organizations_url | string (uri) | (example: https://api.github.com/users/octocat/orgs) |
owned_private_repos | integer | |
plan | object | |
private_gists | integer | |
public_gists | integer | |
public_repos | integer | |
received_events_url | string (uri) | (example: https://api.github.com/users/octocat/received_events) |
repos_url | string (uri) | (example: https://api.github.com/users/octocat/repos) |
site_admin | boolean | |
starred_url | string | (example: https://api.github.com/users/octocat/starred{/owner}{/repo}) |
subscriptions_url | string (uri) | (example: https://api.github.com/users/octocat/subscriptions) |
total_private_repos | integer | |
twitter_username | string | (example: monalisa) |
two_factor_authentication | boolean | |
type | string | (example: User) |
updated_at | string (date-time) | (example: 2008-01-14T04:33:35Z) |
url | string (uri) | (example: https://api.github.com/users/octocat) |
user_view_type | string |
Response
| Name | Datatype | Description |
|---|---|---|
id | integer (int64) | |
name | string | (example: monalisa octocat) |
gravatar_id | string | (example: 41d064eb2195891e12d0413f63227ea7) |
node_id | string | (example: MDQ6VXNlcjE=) |
avatar_url | string (uri) | (example: https://github.com/images/error/octocat_happy.gif) |
bio | string | (example: There once was...) |
blog | string | (example: https://github.com/blog) |
business_plus | boolean | |
collaborators | integer | |
company | string | (example: GitHub) |
created_at | string (date-time) | (example: 2008-01-14T04:33:35Z) |
disk_usage | integer | |
email | string (email) | (example: octocat@github.com) |
events_url | string | (example: https://api.github.com/users/octocat/events{/privacy}) |
followers | integer | |
followers_url | string (uri) | (example: https://api.github.com/users/octocat/followers) |
following | integer | |
following_url | string | (example: https://api.github.com/users/octocat/following{/other_user}) |
gists_url | string | (example: https://api.github.com/users/octocat/gists{/gist_id}) |
hireable | boolean | |
html_url | string (uri) | (example: https://github.com/octocat) |
ldap_dn | string | |
location | string | (example: San Francisco) |
login | string | (example: octocat) |
notification_email | string (email) | (example: octocat@github.com) |
organizations_url | string (uri) | (example: https://api.github.com/users/octocat/orgs) |
owned_private_repos | integer | |
plan | object | |
private_gists | integer | |
public_gists | integer | |
public_repos | integer | |
received_events_url | string (uri) | (example: https://api.github.com/users/octocat/received_events) |
repos_url | string (uri) | (example: https://api.github.com/users/octocat/repos) |
site_admin | boolean | |
starred_url | string | (example: https://api.github.com/users/octocat/starred{/owner}{/repo}) |
subscriptions_url | string (uri) | (example: https://api.github.com/users/octocat/subscriptions) |
total_private_repos | integer | |
twitter_username | string | (example: monalisa) |
two_factor_authentication | boolean | |
type | string | (example: User) |
updated_at | string (date-time) | (example: 2008-01-14T04:33:35Z) |
url | string (uri) | (example: https://api.github.com/users/octocat) |
user_view_type | string |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_by_id | select | 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. | |
get_by_username | select | username | Provides 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_authenticated | select | OAuth app tokens and personal access tokens (classic) need the user scope in order for the response to include private profile information. | ||
update_authenticated | update | 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​
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.
| Name | Datatype | Description |
|---|---|---|
account_id | integer | account_id parameter |
username | string | The handle for the GitHub user account. |
SELECT examples​
- get_by_id
- get_by_username
- get_authenticated
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
;
Provides 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.
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 username = '{{ username }}' -- required
;
OAuth app tokens and personal access tokens (classic) need the user scope in order for the response to include private profile information.
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
;
UPDATE examples​
- update_authenticated
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;