spaces
Creates, updates, deletes, gets or lists a spaces resource.
Overview
| Name | spaces |
| Type | Resource |
| Id | github.copilot_spaces.spaces |
Fields
The following fields are returned by SELECT queries:
- get_for_org
- get_for_user
- list_for_org
- list_for_user
Response
| Name | Datatype | Description |
|---|---|---|
id | integer (int64) | The unique identifier of the space. |
name | string | The display name of the space. (example: My Development Space) |
api_url | string (uri) | The API URL of the space. (example: https://api.github.com/organizations/1/copilot-spaces/5) |
base_role | string | The base role that determines default permissions. - no_access: No default access - reader: Default read permissions - writer: Default write permissions (organization spaces only) - admin: Default admin permissions (organization spaces only) (reader, writer, admin, no_access) (example: no_access) |
created_at | string (date-time) | The date and time the space was created. (example: 2023-01-01T00:00:00Z) |
creator | object | A GitHub user. (title: Simple User) |
description | string | A description of the space. (example: A space for discussing React development patterns) |
general_instructions | string | General instructions for the Copilot Space. (example: Help with React development patterns and best practices) |
html_url | string (uri) | The HTML URL of the space. (example: https://github.com/copilot/spaces/octo-org/5) |
number | integer | The number that identifies the space within its owner. |
owner | object | The user or organization that owns this space. (title: Simple User) |
resources_attributes | array | Resources attached to the space. |
updated_at | string (date-time) | The date and time the space was last updated. (example: 2023-01-01T12:00:00Z) |
Response
| Name | Datatype | Description |
|---|---|---|
id | integer (int64) | The unique identifier of the space. |
name | string | The display name of the space. (example: My Development Space) |
api_url | string (uri) | The API URL of the space. (example: https://api.github.com/organizations/1/copilot-spaces/5) |
base_role | string | The base role that determines default permissions. - no_access: No default access - reader: Default read permissions - writer: Default write permissions (organization spaces only) - admin: Default admin permissions (organization spaces only) (reader, writer, admin, no_access) (example: no_access) |
created_at | string (date-time) | The date and time the space was created. (example: 2023-01-01T00:00:00Z) |
creator | object | A GitHub user. (title: Simple User) |
description | string | A description of the space. (example: A space for discussing React development patterns) |
general_instructions | string | General instructions for the Copilot Space. (example: Help with React development patterns and best practices) |
html_url | string (uri) | The HTML URL of the space. (example: https://github.com/copilot/spaces/octo-org/5) |
number | integer | The number that identifies the space within its owner. |
owner | object | The user or organization that owns this space. (title: Simple User) |
resources_attributes | array | Resources attached to the space. |
updated_at | string (date-time) | The date and time the space was last updated. (example: 2023-01-01T12:00:00Z) |
Response
| Name | Datatype | Description |
|---|---|---|
id | integer (int64) | The unique identifier of the space. |
name | string | The display name of the space. (example: My Development Space) |
api_url | string (uri) | The API URL of the space. (example: https://api.github.com/organizations/1/copilot-spaces/5) |
base_role | string | The base role that determines default permissions. - no_access: No default access - reader: Default read permissions - writer: Default write permissions (organization spaces only) - admin: Default admin permissions (organization spaces only) (reader, writer, admin, no_access) (example: no_access) |
created_at | string (date-time) | The date and time the space was created. (example: 2023-01-01T00:00:00Z) |
creator | object | A GitHub user. (title: Simple User) |
description | string | A description of the space. (example: A space for discussing React development patterns) |
general_instructions | string | General instructions for the Copilot Space. (example: Help with React development patterns and best practices) |
html_url | string (uri) | The HTML URL of the space. (example: https://github.com/copilot/spaces/octo-org/5) |
number | integer | The number that identifies the space within its owner. |
owner | object | The user or organization that owns this space. (title: Simple User) |
resources_attributes | array | Resources attached to the space. |
updated_at | string (date-time) | The date and time the space was last updated. (example: 2023-01-01T12:00:00Z) |
Response
| Name | Datatype | Description |
|---|---|---|
id | integer (int64) | The unique identifier of the space. |
name | string | The display name of the space. (example: My Development Space) |
api_url | string (uri) | The API URL of the space. (example: https://api.github.com/organizations/1/copilot-spaces/5) |
base_role | string | The base role that determines default permissions. - no_access: No default access - reader: Default read permissions - writer: Default write permissions (organization spaces only) - admin: Default admin permissions (organization spaces only) (reader, writer, admin, no_access) (example: no_access) |
created_at | string (date-time) | The date and time the space was created. (example: 2023-01-01T00:00:00Z) |
creator | object | A GitHub user. (title: Simple User) |
description | string | A description of the space. (example: A space for discussing React development patterns) |
general_instructions | string | General instructions for the Copilot Space. (example: Help with React development patterns and best practices) |
html_url | string (uri) | The HTML URL of the space. (example: https://github.com/copilot/spaces/octo-org/5) |
number | integer | The number that identifies the space within its owner. |
owner | object | The user or organization that owns this space. (title: Simple User) |
resources_attributes | array | Resources attached to the space. |
updated_at | string (date-time) | The date and time the space was last updated. (example: 2023-01-01T12:00:00Z) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_for_org | select | org, space_number | Gets details about a specific Copilot Space owned by an organization. The authenticated user must have read access to the Space. Internal Spaces require the authenticated user to be a member of the organization or have been granted read permissions. 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. | |
get_for_user | select | username, space_number | Gets details about a specific Copilot Space owned by a user. The authenticated user must have read access to the Space. Private user spaces require the authenticated user to be the owner of the space. Public user spaces are accessible to any authenticated user. OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint. | |
list_for_org | select | org | per_page, before, after | Lists Copilot Spaces owned by an organization. The authenticated user must have read access to the organization's Copilot Spaces. Only Spaces that are readable by the authenticated user are returned. This includes public Spaces and internal Spaces if the user is a member of 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 a space; spaces with inaccessible resources are omitted from the response. |
list_for_user | select | username | per_page, before, after | Lists Copilot Spaces owned by a user. The authenticated user must have read access to the user's Copilot Spaces. Only Spaces that are readable by the authenticated user are returned. This includes the user's own spaces, and public user spaces when accessing another user's spaces. OAuth app tokens and personal access tokens (classic) need the read:user scope to use this endpoint. |
create_for_org | insert | org, name | Creates a new Copilot Space owned by an organization. The authenticated user must have permissions to create spaces in the organization. Organization members with appropriate permissions can create Copilot Spaces to be shared within their 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 the submitted resources. | |
create_for_user | insert | username, name | Creates a new Copilot Space owned by a user. Only the authenticated user can create spaces for their own account. Users can create personal Copilot Spaces for their individual use. OAuth app tokens and personal access tokens (classic) need the read:user scope to use this endpoint. | |
update_for_org | replace | org, space_number | Updates a Copilot Space owned by an organization. The authenticated user must have permissions to update spaces in the organization. Organization members with appropriate permissions can update Copilot Spaces owned by their 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, including any being added or updated. | |
update_for_user | replace | username, space_number | Updates a Copilot Space owned by a user. Only the authenticated user can update spaces for their own account. Users can update their personal Copilot Spaces. OAuth app tokens and personal access tokens (classic) need the read:user scope to use this endpoint. | |
delete_for_org | delete | org, space_number | Deletes a Copilot Space owned by an organization. The authenticated user must have permissions to delete spaces in the organization. Warning: This action is permanent and cannot be undone. Deleting a Copilot Space will remove all associated resources and configurations. Organization members with appropriate permissions can delete Copilot Spaces owned by their organization. OAuth app tokens and personal access tokens (classic) need both the read:org and repo scopes 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_for_user | delete | username, space_number | Deletes a Copilot Space owned by a user. The authenticated user must be the owner of the space. Warning: This action is permanent and cannot be undone. Deleting a space will remove all associated resources and configurations. 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 |
|---|---|---|
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. |
after | string | A cursor, as given in the Link header. If specified, the query only searches for results after this cursor. |
before | string | A cursor, as given in the Link header. If specified, the query only searches for results before this cursor. |
per_page | integer | The number of results per page (max 100). |
SELECT examples
- get_for_org
- get_for_user
- list_for_org
- list_for_user
Gets details about a specific Copilot Space owned by an organization. The authenticated user must have read access to the Space.
Internal Spaces require the authenticated user to be a member of the organization or have been granted read permissions.
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,
api_url,
base_role,
created_at,
creator,
description,
general_instructions,
html_url,
number,
owner,
resources_attributes,
updated_at
FROM github.copilot_spaces.spaces
WHERE org = '{{ org }}' -- required
AND space_number = '{{ space_number }}' -- required
;
Gets details about a specific Copilot Space owned by a user. The authenticated user must have read access to the Space.
Private user spaces require the authenticated user to be the owner of the space.
Public user spaces are accessible to any authenticated user.
OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.
SELECT
id,
name,
api_url,
base_role,
created_at,
creator,
description,
general_instructions,
html_url,
number,
owner,
resources_attributes,
updated_at
FROM github.copilot_spaces.spaces
WHERE username = '{{ username }}' -- required
AND space_number = '{{ space_number }}' -- required
;
Lists Copilot Spaces owned by an organization. The authenticated user must have read access to the organization's Copilot Spaces.
Only Spaces that are readable by the authenticated user are returned. This includes public Spaces and internal Spaces if the user is a member of 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 a space; spaces with inaccessible resources are omitted from the response.
SELECT
id,
name,
api_url,
base_role,
created_at,
creator,
description,
general_instructions,
html_url,
number,
owner,
resources_attributes,
updated_at
FROM github.copilot_spaces.spaces
WHERE org = '{{ org }}' -- required
AND per_page = '{{ per_page }}'
AND before = '{{ before }}'
AND after = '{{ after }}'
;
Lists Copilot Spaces owned by a user. The authenticated user must have read access to the user's Copilot Spaces.
Only Spaces that are readable by the authenticated user are returned. This includes the user's own spaces, and public user spaces when accessing another user's spaces.
OAuth app tokens and personal access tokens (classic) need the read:user scope to use this endpoint.
SELECT
id,
name,
api_url,
base_role,
created_at,
creator,
description,
general_instructions,
html_url,
number,
owner,
resources_attributes,
updated_at
FROM github.copilot_spaces.spaces
WHERE username = '{{ username }}' -- required
AND per_page = '{{ per_page }}'
AND before = '{{ before }}'
AND after = '{{ after }}'
;
INSERT examples
- create_for_org
- create_for_user
- Manifest
Creates a new Copilot Space owned by an organization. The authenticated user must have permissions to create spaces in the organization.
Organization members with appropriate permissions can create Copilot Spaces to be shared within their 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 the submitted resources.
INSERT INTO github.copilot_spaces.spaces (
name,
description,
general_instructions,
base_role,
resources_attributes,
org
)
SELECT
'{{ name }}' /* required */,
'{{ description }}',
'{{ general_instructions }}',
'{{ base_role }}',
'{{ resources_attributes }}',
'{{ org }}'
RETURNING
id,
name,
api_url,
base_role,
created_at,
creator,
description,
general_instructions,
html_url,
number,
owner,
resources_attributes,
updated_at
;
Creates a new Copilot Space owned by a user. Only the authenticated user can create spaces for their own account.
Users can create personal Copilot Spaces for their individual use.
OAuth app tokens and personal access tokens (classic) need the read:user scope to use this endpoint.
INSERT INTO github.copilot_spaces.spaces (
name,
description,
general_instructions,
base_role,
resources_attributes,
username
)
SELECT
'{{ name }}' /* required */,
'{{ description }}',
'{{ general_instructions }}',
'{{ base_role }}',
'{{ resources_attributes }}',
'{{ username }}'
RETURNING
id,
name,
api_url,
base_role,
created_at,
creator,
description,
general_instructions,
html_url,
number,
owner,
resources_attributes,
updated_at
;
# Description fields are for documentation purposes
- name: spaces
props:
- name: org
value: "{{ org }}"
description: Required parameter for the spaces resource.
- name: username
value: "{{ username }}"
description: Required parameter for the spaces resource.
- name: name
value: "{{ name }}"
description: |
The name of the Copilot Space.
- name: description
value: "{{ description }}"
description: |
A description of the Copilot Space.
- name: general_instructions
value: "{{ general_instructions }}"
description: |
General instructions for the Copilot Space.
- name: base_role
value: "{{ base_role }}"
description: |
The base role that determines default permissions for the space.
- `no_access`: No default access (default)
- `reader`: Makes the space publicly readable
Note: User spaces do not support writer or admin base roles.
valid_values: ['reader', 'no_access']
default: no_access
- name: resources_attributes
description: |
Resources to attach to the space.
value:
- resource_type: "{{ resource_type }}"
metadata:
repository_id: {{ repository_id }}
file_path: "{{ file_path }}"
text: "{{ text }}"
name: "{{ name }}"
number: {{ number }}
REPLACE examples
- update_for_org
- update_for_user
Updates a Copilot Space owned by an organization. The authenticated user must have permissions to update spaces in the organization.
Organization members with appropriate permissions can update Copilot Spaces owned by their 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, including any being added or updated.
REPLACE github.copilot_spaces.spaces
SET
name = '{{ name }}',
description = '{{ description }}',
general_instructions = '{{ general_instructions }}',
base_role = '{{ base_role }}',
resources_attributes = '{{ resources_attributes }}'
WHERE
org = '{{ org }}' --required
AND space_number = '{{ space_number }}' --required
RETURNING
id,
name,
api_url,
base_role,
created_at,
creator,
description,
general_instructions,
html_url,
number,
owner,
resources_attributes,
updated_at;
Updates a Copilot Space owned by a user. Only the authenticated user can update spaces for their own account.
Users can update their personal Copilot Spaces.
OAuth app tokens and personal access tokens (classic) need the read:user scope to use this endpoint.
REPLACE github.copilot_spaces.spaces
SET
name = '{{ name }}',
description = '{{ description }}',
general_instructions = '{{ general_instructions }}',
base_role = '{{ base_role }}',
resources_attributes = '{{ resources_attributes }}'
WHERE
username = '{{ username }}' --required
AND space_number = '{{ space_number }}' --required
RETURNING
id,
name,
api_url,
base_role,
created_at,
creator,
description,
general_instructions,
html_url,
number,
owner,
resources_attributes,
updated_at;
DELETE examples
- delete_for_org
- delete_for_user
Deletes a Copilot Space owned by an organization. The authenticated user must have permissions to delete spaces in the organization.
Warning: This action is permanent and cannot be undone. Deleting a Copilot Space will remove all associated resources and configurations.
Organization members with appropriate permissions can delete Copilot Spaces owned by their organization.
OAuth app tokens and personal access tokens (classic) need both the read:org and repo scopes 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.spaces
WHERE org = '{{ org }}' --required
AND space_number = '{{ space_number }}' --required
;
Deletes a Copilot Space owned by a user. The authenticated user must be the owner of the space.
Warning: This action is permanent and cannot be undone. Deleting a space will remove all associated resources and configurations.
OAuth app tokens and personal access tokens (classic) need the user scope to use this endpoint.
DELETE FROM github.copilot_spaces.spaces
WHERE username = '{{ username }}' --required
AND space_number = '{{ space_number }}' --required
;