Skip to main content

collaborators

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

Overview

Namecollaborators
TypeResource
Idgithub.copilot_spaces.collaborators

Fields

The following fields are returned by SELECT queries:

Response

NameDatatypeDescription
idinteger (int64)
namestring
gravatar_idstring (example: 41d064eb2195891e12d0413f63227ea7)
node_idstring (example: MDQ6VXNlcjE=)
organization_idinteger
actor_typestringThe collaborator actor type. (User)
avatar_urlstring (uri) (example: https://github.com/images/error/octocat_happy.gif)
descriptionstring
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)
members_urlstring
notification_settingstring
organizations_urlstring (uri) (example: https://api.github.com/users/octocat/orgs)
parent
privacystring
received_events_urlstring (uri) (example: https://api.github.com/users/octocat/received_events)
repos_urlstring (uri) (example: https://api.github.com/users/octocat/repos)
repositories_urlstring (uri)
rolestringThe role granted to the collaborator (reader, writer, admin)
site_adminboolean
slugstring
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_collaborators_for_orgselectorg, space_numberLists all collaborators for a specific Copilot Space owned by an organization. The authenticated user must have appropriate permissions to view collaborators.

Each collaborator entry specifies which user or team has access to the space and at what level (reader, writer, or admin). The space owner (organization) is excluded from this list.

Note: Team collaborators listed here are teams that are defined in the organization.

OAuth app tokens and personal access tokens (classic) need the read:org scope to use this endpoint.

Fine-grained tokens and GitHub App user access tokens must have been granted access to the organization that owns the space. They must also have been granted access to every repository referenced by resources in the space.
list_collaborators_for_userselectusername, space_numberLists all collaborators for a specific Copilot Space owned by a user. The authenticated user must be the owner of the space or have admin access to the space.

Each collaborator entry specifies which user has access to the space and at what level (reader, writer, or admin). The space owner is excluded from this list.

Team collaborators are not supported for user-owned Copilot Spaces.

OAuth app tokens and personal access tokens (classic) need the user scope to use this endpoint.
add_collaborator_for_orginsertorg, space_number, actor_type, actor_identifier, roleAdds a collaborator (user or team) to a specific Copilot Space owned by an organization. The authenticated user must have appropriate permissions to manage collaborators.

Note: When adding users as collaborators, they must already be members of the organization.
When adding teams as collaborators, they must be defined in the organization.

OAuth app tokens and personal access tokens (classic) need the write:org scope to use this endpoint.

Fine-grained tokens and GitHub App user access tokens must have been granted access to the organization that owns the space. They must also have been granted access to every repository referenced by resources in the space.
add_collaborator_for_userinsertusername, space_number, actor_type, actor_identifier, roleAdds a collaborator to a specific Copilot Space owned by a user. The authenticated user must be the owner of the space or have admin access to the space.

Team collaborators are not supported for user-owned Copilot Spaces.

OAuth app tokens and personal access tokens (classic) need the user scope to use this endpoint.
update_collaborator_for_orgreplaceorg, space_number, actor_type, actor_identifier, roleUpdates the role of a collaborator for a specific Copilot Space owned by an organization. The authenticated user must have appropriate permissions to manage collaborators.

OAuth app tokens and personal access tokens (classic) need the write:org scope to use this endpoint.

Fine-grained tokens and GitHub App user access tokens must have been granted access to the organization that owns the space. They must also have been granted access to every repository referenced by resources in the space.
update_collaborator_for_userreplaceusername, space_number, actor_type, actor_identifier, roleUpdates the role of a collaborator for a specific Copilot Space owned by a user. The authenticated user must be the owner of the space or have admin access to the space.

OAuth app tokens and personal access tokens (classic) need the user scope to use this endpoint.
remove_collaborator_for_orgdeleteorg, space_number, actor_type, actor_identifierRemoves a collaborator from a specific Copilot Space owned by an organization. The authenticated user must have appropriate permissions to manage collaborators.

OAuth app tokens and personal access tokens (classic) need the write:org scope to use this endpoint.

Fine-grained tokens and GitHub App user access tokens must have been granted access to the organization that owns the space. They must also have been granted access to every repository referenced by resources in the space.
remove_collaborator_for_userdeleteusername, space_number, actor_type, actor_identifierRemoves a collaborator from a specific Copilot Space owned by a user. The authenticated user must be the owner of the space or have admin access to the space.

OAuth app tokens and personal access tokens (classic) need the user scope to use this endpoint.

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
actor_identifierstringThe username of the collaborator. The numeric user ID is also accepted.
actor_typestringThe type of actor (must be User for user-owned spaces; Team will be rejected).
orgstringThe organization name. The name is not case sensitive.
space_numberintegerThe unique identifier of the Copilot Space.
usernamestringThe handle for the GitHub user account.

SELECT examples

Lists all collaborators for a specific Copilot Space owned by an organization. The authenticated user must have appropriate permissions to view collaborators.

Each collaborator entry specifies which user or team has access to the space and at what level (reader, writer, or admin). The space owner (organization) is excluded from this list.

Note: Team collaborators listed here are teams that are defined in the organization.

OAuth app tokens and personal access tokens (classic) need the read:org scope to use this endpoint.

Fine-grained tokens and GitHub App user access tokens must have been granted access to the organization that owns the space. They must also have been granted access to every repository referenced by resources in the space.

SELECT
id,
name,
gravatar_id,
node_id,
organization_id,
actor_type,
avatar_url,
description,
email,
events_url,
followers_url,
following_url,
gists_url,
html_url,
login,
members_url,
notification_setting,
organizations_url,
parent,
privacy,
received_events_url,
repos_url,
repositories_url,
role,
site_admin,
slug,
starred_at,
starred_url,
subscriptions_url,
type,
url,
user_view_type
FROM github.copilot_spaces.collaborators
WHERE org = '{{ org }}' -- required
AND space_number = '{{ space_number }}' -- required
;

INSERT examples

Adds a collaborator (user or team) to a specific Copilot Space owned by an organization. The authenticated user must have appropriate permissions to manage collaborators.

Note: When adding users as collaborators, they must already be members of the organization.
When adding teams as collaborators, they must be defined in the organization.

OAuth app tokens and personal access tokens (classic) need the write:org scope to use this endpoint.

Fine-grained tokens and GitHub App user access tokens must have been granted access to the organization that owns the space. They must also have been granted access to every repository referenced by resources in the space.

INSERT INTO github.copilot_spaces.collaborators (
actor_type,
actor_identifier,
role,
org,
space_number
)
SELECT
'{{ actor_type }}' /* required */,
'{{ actor_identifier }}' /* required */,
'{{ role }}' /* required */,
'{{ org }}',
'{{ space_number }}'
RETURNING
id,
name,
gravatar_id,
node_id,
organization_id,
actor_type,
avatar_url,
description,
email,
events_url,
followers_url,
following_url,
gists_url,
html_url,
login,
members_url,
notification_setting,
organizations_url,
parent,
privacy,
received_events_url,
repos_url,
repositories_url,
role,
site_admin,
slug,
starred_at,
starred_url,
subscriptions_url,
type,
url,
user_view_type
;

REPLACE examples

Updates the role of a collaborator for a specific Copilot Space owned by an organization. The authenticated user must have appropriate permissions to manage collaborators.

OAuth app tokens and personal access tokens (classic) need the write:org scope to use this endpoint.

Fine-grained tokens and GitHub App user access tokens must have been granted access to the organization that owns the space. They must also have been granted access to every repository referenced by resources in the space.

REPLACE github.copilot_spaces.collaborators
SET
role = '{{ role }}'
WHERE
org = '{{ org }}' --required
AND space_number = '{{ space_number }}' --required
AND actor_type = '{{ actor_type }}' --required
AND actor_identifier = '{{ actor_identifier }}' --required
AND role = '{{ role }}' --required
RETURNING
id,
name,
gravatar_id,
node_id,
organization_id,
actor_type,
avatar_url,
description,
email,
events_url,
followers_url,
following_url,
gists_url,
html_url,
login,
members_url,
notification_setting,
organizations_url,
parent,
privacy,
received_events_url,
repos_url,
repositories_url,
role,
site_admin,
slug,
starred_at,
starred_url,
subscriptions_url,
type,
url,
user_view_type;

DELETE examples

Removes a collaborator from a specific Copilot Space owned by an organization. The authenticated user must have appropriate permissions to manage collaborators.

OAuth app tokens and personal access tokens (classic) need the write:org scope to use this endpoint.

Fine-grained tokens and GitHub App user access tokens must have been granted access to the organization that owns the space. They must also have been granted access to every repository referenced by resources in the space.

DELETE FROM github.copilot_spaces.collaborators
WHERE org = '{{ org }}' --required
AND space_number = '{{ space_number }}' --required
AND actor_type = '{{ actor_type }}' --required
AND actor_identifier = '{{ actor_identifier }}' --required
;