collaborators
Creates, updates, deletes, gets or lists a collaborators resource.
Overview
| Name | collaborators |
| Type | Resource |
| Id | github.copilot_spaces.collaborators |
Fields
The following fields are returned by SELECT queries:
- list_collaborators_for_org
- list_collaborators_for_user
Response
| Name | Datatype | Description |
|---|---|---|
id | integer (int64) | |
name | string | |
gravatar_id | string | (example: 41d064eb2195891e12d0413f63227ea7) |
node_id | string | (example: MDQ6VXNlcjE=) |
organization_id | integer | |
actor_type | string | The collaborator actor type. (User) |
avatar_url | string (uri) | (example: https://github.com/images/error/octocat_happy.gif) |
description | string | |
email | string | |
events_url | string | (example: https://api.github.com/users/octocat/events{/privacy}) |
followers_url | string (uri) | (example: https://api.github.com/users/octocat/followers) |
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}) |
html_url | string (uri) | (example: https://github.com/octocat) |
login | string | (example: octocat) |
members_url | string | |
notification_setting | string | |
organizations_url | string (uri) | (example: https://api.github.com/users/octocat/orgs) |
parent | | |
privacy | string | |
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) |
repositories_url | string (uri) | |
role | string | The role granted to the collaborator (reader, writer, admin) |
site_admin | boolean | |
slug | string | |
starred_at | string | (example: "2020-07-09T00:17:55Z") |
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) |
type | string | (example: User) |
url | string (uri) | (example: https://api.github.com/users/octocat) |
user_view_type | string | (example: public) |
Response
| Name | Datatype | Description |
|---|---|---|
id | integer (int64) | |
name | string | |
gravatar_id | string | (example: 41d064eb2195891e12d0413f63227ea7) |
node_id | string | (example: MDQ6VXNlcjE=) |
organization_id | integer | |
actor_type | string | The collaborator actor type. (User) |
avatar_url | string (uri) | (example: https://github.com/images/error/octocat_happy.gif) |
description | string | |
email | string | |
events_url | string | (example: https://api.github.com/users/octocat/events{/privacy}) |
followers_url | string (uri) | (example: https://api.github.com/users/octocat/followers) |
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}) |
html_url | string (uri) | (example: https://github.com/octocat) |
login | string | (example: octocat) |
members_url | string | |
notification_setting | string | |
organizations_url | string (uri) | (example: https://api.github.com/users/octocat/orgs) |
parent | | |
privacy | string | |
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) |
repositories_url | string (uri) | |
role | string | The role granted to the collaborator (reader, writer, admin) |
site_admin | boolean | |
slug | string | |
starred_at | string | (example: "2020-07-09T00:17:55Z") |
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) |
type | string | (example: User) |
url | string (uri) | (example: https://api.github.com/users/octocat) |
user_view_type | string | (example: public) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list_collaborators_for_org | select | org, space_number | 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. | |
list_collaborators_for_user | select | username, space_number | Lists 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_org | insert | org, space_number, actor_type, actor_identifier, role | 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. | |
add_collaborator_for_user | insert | username, space_number, actor_type, actor_identifier, role | Adds 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_org | replace | org, space_number, actor_type, actor_identifier, role | 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. | |
update_collaborator_for_user | replace | username, space_number, actor_type, actor_identifier, role | Updates 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_org | delete | org, space_number, actor_type, actor_identifier | 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. | |
remove_collaborator_for_user | delete | username, space_number, actor_type, actor_identifier | Removes 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.
| Name | Datatype | Description |
|---|---|---|
actor_identifier | string | The username of the collaborator. The numeric user ID is also accepted. |
actor_type | string | The type of actor (must be User for user-owned spaces; Team will be rejected). |
org | string | The organization name. The name is not case sensitive. |
space_number | integer | The unique identifier of the Copilot Space. |
username | string | The handle for the GitHub user account. |
SELECT examples
- list_collaborators_for_org
- list_collaborators_for_user
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
;
Lists 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.
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 username = '{{ username }}' -- required
AND space_number = '{{ space_number }}' -- required
;
INSERT examples
- add_collaborator_for_org
- add_collaborator_for_user
- Manifest
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
;
Adds 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.
INSERT INTO github.copilot_spaces.collaborators (
actor_type,
actor_identifier,
role,
username,
space_number
)
SELECT
'{{ actor_type }}' /* required */,
'{{ actor_identifier }}' /* required */,
'{{ role }}' /* required */,
'{{ username }}',
'{{ 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
;
# Description fields are for documentation purposes
- name: collaborators
props:
- name: org
value: "{{ org }}"
description: Required parameter for the collaborators resource.
- name: space_number
value: {{ space_number }}
description: Required parameter for the collaborators resource.
- name: username
value: "{{ username }}"
description: Required parameter for the collaborators resource.
- name: actor_type
value: "{{ actor_type }}"
description: |
The type of actor (must be `User` for user-owned spaces; `Team` will be rejected).
valid_values: ['User', 'Team']
- name: actor_identifier
value: "{{ actor_identifier }}"
description: |
The username of the collaborator. The numeric user ID is also accepted.
- name: role
value: "{{ role }}"
description: |
The role to grant to the collaborator.
valid_values: ['reader', 'writer', 'admin']
REPLACE examples
- update_collaborator_for_org
- update_collaborator_for_user
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;
Updates 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.
REPLACE github.copilot_spaces.collaborators
SET
role = '{{ role }}'
WHERE
username = '{{ username }}' --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
- remove_collaborator_for_org
- remove_collaborator_for_user
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
;
Removes 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.
DELETE FROM github.copilot_spaces.collaborators
WHERE username = '{{ username }}' --required
AND space_number = '{{ space_number }}' --required
AND actor_type = '{{ actor_type }}' --required
AND actor_identifier = '{{ actor_identifier }}' --required
;