Skip to main content

outside_collaborators

Creates, updates, deletes, gets or lists an outside_collaborators resource.

Overview

Nameoutside_collaborators
TypeResource
Idgithub.orgs.outside_collaborators

Fields

The following fields are returned by SELECT queries:

Response

NameDatatypeDescription
idinteger (int64)
namestring
gravatar_idstring (example: 41d064eb2195891e12d0413f63227ea7)
node_idstring (example: MDQ6VXNlcjE=)
avatar_urlstring (uri) (example: https://github.com/images/error/octocat_happy.gif)
emailstring
events_urlstring (example: https://api.github.com/users/octocat/events{/privacy})
followers_urlstring (uri) (example: https://api.github.com/users/octocat/followers)
following_urlstring (example: https://api.github.com/users/octocat/following{/other_user})
gists_urlstring (example: https://api.github.com/users/octocat/gists{/gist_id})
html_urlstring (uri) (example: https://github.com/octocat)
loginstring (example: octocat)
organizations_urlstring (uri) (example: https://api.github.com/users/octocat/orgs)
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_atstring (example: "2020-07-09T00:17:55Z")
starred_urlstring (example: https://api.github.com/users/octocat/starred{/owner}{/repo})
subscriptions_urlstring (uri) (example: https://api.github.com/users/octocat/subscriptions)
typestring (example: User)
urlstring (uri) (example: https://api.github.com/users/octocat)
user_view_typestring (example: public)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_outside_collaboratorsselectorgfilter, per_page, pageList all users who are outside collaborators of an organization.
remove_outside_collaboratordeleteorg, usernameRemoving a user from this list will remove them from all the organization's repositories.
convert_member_to_outside_collaboratorexecorg, usernameWhen an organization member is converted to an outside collaborator, they'll only have access to the repositories that their current team membership allows. The user will no longer be a member of the organization. For more information, see "Converting an organization member to an outside collaborator". Converting an organization member to an outside collaborator may be restricted by enterprise administrators. For more information, see "Enforcing repository management policies in your enterprise."

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
orgstringThe organization name. The name is not case sensitive.
usernamestringThe handle for the GitHub user account.
filterstringFilter the list of outside collaborators. 2fa_disabled means that only outside collaborators without two-factor authentication enabled will be returned. 2fa_insecure means that only outside collaborators with insecure 2FA methods will be returned.
pageintegerThe page number of the results to fetch. For more information, see "Using pagination in the REST API."
per_pageintegerThe number of results per page (max 100). For more information, see "Using pagination in the REST API."

SELECT examples

List all users who are outside collaborators of an organization.

SELECT
id,
name,
gravatar_id,
node_id,
avatar_url,
email,
events_url,
followers_url,
following_url,
gists_url,
html_url,
login,
organizations_url,
received_events_url,
repos_url,
site_admin,
starred_at,
starred_url,
subscriptions_url,
type,
url,
user_view_type
FROM github.orgs.outside_collaborators
WHERE org = '{{ org }}' -- required
AND filter = '{{ filter }}'
AND per_page = '{{ per_page }}'
AND page = '{{ page }}'
;

DELETE examples

Removing a user from this list will remove them from all the organization's repositories.

DELETE FROM github.orgs.outside_collaborators
WHERE org = '{{ org }}' --required
AND username = '{{ username }}' --required
;

Lifecycle Methods

When an organization member is converted to an outside collaborator, they'll only have access to the repositories that their current team membership allows. The user will no longer be a member of the organization. For more information, see "Converting an organization member to an outside collaborator". Converting an organization member to an outside collaborator may be restricted by enterprise administrators. For more information, see "Enforcing repository management policies in your enterprise."

EXEC github.orgs.outside_collaborators.convert_member_to_outside_collaborator 
@org='{{ org }}' --required,
@username='{{ username }}' --required
@@json=
'{
"async": {{ async }}
}'
;