Use the REST API to manage Copilot Spaces and related resources.
Note
Most endpoints use Authorization: Bearer <YOUR-TOKEN> and Accept: application/vnd.github+json headers, plus X-GitHub-Api-Version: 2026-03-10. Curl examples below omit these standard headers for brevity.
GET /orgs/{org}/copilot-spaces
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.
accept (string)application/vnd.github+json is recommended.org (string) (required)
The organization name. The name is not case sensitive.
per_page (integer)
The number of results per page (max 100).
Default: 30
before (string)
A cursor, as given in the Link header. If specified, the query only searches for results before this cursor.
after (string)
A cursor, as given in the Link header. If specified, the query only searches for results after this cursor.
200 - OK
403 - Forbidden
404 - Resource not found
Request:
curl -L \
-X GET \
https://api.github.com/orgs/ORG/copilot-spaces
Response schema (Status: 200):
spaces: required, array of Space:
id: required, integer, format: int64number: required, integername: required, stringdescription: string or nullgeneral_instructions: string or null, maxLength: 4000base_role: required, string, enum: reader, writer, admin, no_accessowner: required, any of:
name: string or nullemail: string or nulllogin: required, stringid: required, integer, format: int64node_id: required, stringavatar_url: required, string, format: urigravatar_id: required, string or nullurl: required, string, format: urihtml_url: required, string, format: urifollowers_url: required, string, format: urifollowing_url: required, stringgists_url: required, stringstarred_url: required, stringsubscriptions_url: required, string, format: uriorganizations_url: required, string, format: urirepos_url: required, string, format: urievents_url: required, stringreceived_events_url: required, string, format: uritype: required, stringsite_admin: required, booleanstarred_at: stringuser_view_type: stringlogin: required, stringid: required, integernode_id: required, stringurl: required, string, format: urirepos_url: required, string, format: urievents_url: required, string, format: urihooks_url: required, stringissues_url: required, stringmembers_url: required, stringpublic_members_url: required, stringavatar_url: required, stringdescription: required, string or nullcreator: required, Simple User (see above)created_at: required, string, format: date-timeupdated_at: required, string, format: date-timehtml_url: required, string, format: uriapi_url: required, string, format: uriresources_attributes: array of objects:
id: integer, format: int64resource_type: string, enum: repository, github_file, free_text, github_issue, github_pull_request, media_content, uploaded_text_filecopilot_chat_attachment_id: integer or null, format: int64created_at: string, format: date-timeupdated_at: string, format: date-timemetadata: object:
repository_id: integerfile_path: stringtext: stringname: stringnumber: integercopilot_chat_attachment_id: integermedia_type: stringurl: stringheight: integerwidth: integerPOST /orgs/{org}/copilot-spaces
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.
accept (string)application/vnd.github+json is recommended.org (string) (required)name (string) (required)
The name of the Copilot Space.
description (string)
A description of the Copilot Space.
general_instructions (string)
General instructions for the Copilot Space.
base_role (string)
The base role that determines default permissions for organization members.
no_access: No default access (default)
reader: Organization members can read the space
writer: Organization members can read and edit the space
admin: Organization members have full admin access to the space
Default: no_access
Can be one of: reader, writer, admin, no_access
resources_attributes (array of objects)
Resources to attach to the space.
resource_type (string)repository, github_file, free_text, github_issue, github_pull_request, media_content, uploaded_text_filemetadata (object)repository_id (integer)file_path (string)text (string)name (string)number (integer)201 - Created
403 - Forbidden
404 - Resource not found
422 - Validation failed, or the endpoint has been spammed.
Request:
curl -L \
-X POST \
https://api.github.com/orgs/ORG/copilot-spaces \
-d '{
"name": "Team Planning Space",
"description": "Organization space for team planning and coordination",
"general_instructions": "Help the team with planning and coordination tasks",
"resources_attributes": [
{
"resource_type": "github_file",
"metadata": {
"repository_id": 123456,
"file_path": "docs/planning.md"
}
},
{
"resource_type": "free_text",
"metadata": {
"name": "Team Guidelines",
"text": "Our team follows agile methodology and holds daily standups"
}
}
]
}'
Response schema (Status: 201):
id: required, integer, format: int64number: required, integername: required, stringdescription: string or nullgeneral_instructions: string or null, maxLength: 4000base_role: required, string, enum: reader, writer, admin, no_accessowner: required, any of:
name: string or nullemail: string or nulllogin: required, stringid: required, integer, format: int64node_id: required, stringavatar_url: required, string, format: urigravatar_id: required, string or nullurl: required, string, format: urihtml_url: required, string, format: urifollowers_url: required, string, format: urifollowing_url: required, stringgists_url: required, stringstarred_url: required, stringsubscriptions_url: required, string, format: uriorganizations_url: required, string, format: urirepos_url: required, string, format: urievents_url: required, stringreceived_events_url: required, string, format: uritype: required, stringsite_admin: required, booleanstarred_at: stringuser_view_type: stringlogin: required, stringid: required, integernode_id: required, stringurl: required, string, format: urirepos_url: required, string, format: urievents_url: required, string, format: urihooks_url: required, stringissues_url: required, stringmembers_url: required, stringpublic_members_url: required, stringavatar_url: required, stringdescription: required, string or nullcreator: required, Simple User (see above)created_at: required, string, format: date-timeupdated_at: required, string, format: date-timehtml_url: required, string, format: uriapi_url: required, string, format: uriresources_attributes: array of objects:
id: integer, format: int64resource_type: string, enum: repository, github_file, free_text, github_issue, github_pull_request, media_content, uploaded_text_filecopilot_chat_attachment_id: integer or null, format: int64created_at: string, format: date-timeupdated_at: string, format: date-timemetadata: object:
repository_id: integerfile_path: stringtext: stringname: stringnumber: integercopilot_chat_attachment_id: integermedia_type: stringurl: stringheight: integerwidth: integerGET /orgs/{org}/copilot-spaces/{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.
accept (string)application/vnd.github+json is recommended.org (string) (required)
The organization name. The name is not case sensitive.
space_number (integer) (required)
The unique identifier of the Copilot Space.
200 - OK
403 - Forbidden
404 - Resource not found
Request:
curl -L \
-X GET \
https://api.github.com/orgs/ORG/copilot-spaces/SPACE_NUMBER
Response schema (Status: 200):
Same response schema as Create an organization Copilot Space.
PUT /orgs/{org}/copilot-spaces/{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.
accept (string)application/vnd.github+json is recommended.org (string) (required)
The organization name. The name is not case sensitive.
space_number (integer) (required)
The unique identifier of the Copilot Space.
name (string)
The name of the Copilot Space.
description (string)
A description of the Copilot Space.
general_instructions (string)
General instructions for the Copilot Space.
base_role (string)
The base role that determines default permissions for organization members. Changing this field requires admin permissions.
no_access: No default access (default)
reader: Organization members can read the space
writer: Organization members can read and edit the space
admin: Organization members have full admin access to the space
Can be one of: reader, writer, admin, no_access
resources_attributes (array of objects)
Resources to attach to the space.
resource_type (string)repository, github_file, free_text, github_issue, github_pull_request, media_content, uploaded_text_filemetadata (object)repository_id (integer)file_path (string)text (string)name (string)number (integer)200 - OK
403 - Forbidden
404 - Resource not found
422 - Validation failed, or the endpoint has been spammed.
Request:
curl -L \
-X PUT \
https://api.github.com/orgs/ORG/copilot-spaces/SPACE_NUMBER \
-d '{
"name": "Updated Team Planning Space",
"description": "Updated organization space for team planning and coordination",
"general_instructions": "Updated instructions to help the team with planning and coordination tasks",
"resources_attributes": [
{
"resource_type": "github_file",
"metadata": {
"repository_id": 123456,
"file_path": "docs/updated-planning.md"
}
},
{
"id": 789,
"_destroy": true
},
{
"id": 456,
"resource_type": "free_text",
"metadata": {
"name": "Updated Team Guidelines",
"text": "Our updated team follows agile methodology and holds daily standups"
}
}
]
}'
Response schema (Status: 200):
Same response schema as Create an organization Copilot Space.
DELETE /orgs/{org}/copilot-spaces/{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.
accept (string)application/vnd.github+json is recommended.org (string) (required)
The organization name. The name is not case sensitive.
space_number (integer) (required)
The unique identifier of the Copilot Space.
204 - The Copilot Space has been successfully deleted.
404 - Resource not found
422 - Validation failed, or the endpoint has been spammed.
Request:
curl -L \
-X DELETE \
https://api.github.com/orgs/ORG/copilot-spaces/SPACE_NUMBER
Response schema (Status: 204):
GET /users/{username}/copilot-spaces
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.
accept (string)application/vnd.github+json is recommended.username (string) (required)
The handle for the GitHub user account.
per_page (integer)
The number of results per page (max 100).
Default: 30
before (string)
A cursor, as given in the Link header. If specified, the query only searches for results before this cursor.
after (string)
A cursor, as given in the Link header. If specified, the query only searches for results after this cursor.
200 - OK
403 - Forbidden
404 - Resource not found
Request:
curl -L \
-X GET \
https://api.github.com/users/USERNAME/copilot-spaces
Response schema (Status: 200):
Same response schema as List organization Copilot Spaces.
POST /users/{username}/copilot-spaces
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.
accept (string)application/vnd.github+json is recommended.username (string) (required)name (string) (required)
The name of the Copilot Space.
description (string)
A description of the Copilot Space.
general_instructions (string)
General instructions for the Copilot Space.
base_role (string)
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.
Default: no_access
Can be one of: reader, no_access
resources_attributes (array of objects)
Resources to attach to the space.
resource_type (string)repository, github_file, free_text, github_issue, github_pull_request, media_content, uploaded_text_filemetadata (object)repository_id (integer)file_path (string)text (string)name (string)number (integer)201 - Created
403 - Forbidden
404 - Resource not found
422 - Validation failed, or the endpoint has been spammed.
Request:
curl -L \
-X POST \
https://api.github.com/users/USERNAME/copilot-spaces \
-d '{
"name": "My Development Space",
"description": "Personal space for development assistance",
"general_instructions": "Help me with React development patterns and best practices",
"resources_attributes": [
{
"resource_type": "github_file",
"metadata": {
"repository_id": 789012,
"file_path": "src/components/App.js"
}
},
{
"resource_type": "free_text",
"metadata": {
"name": "Development Notes",
"text": "Focus on clean code principles and modern React patterns"
}
}
]
}'
Response schema (Status: 201):
Same response schema as Create an organization Copilot Space.
GET /users/{username}/copilot-spaces/{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.
accept (string)application/vnd.github+json is recommended.username (string) (required)
The handle for the GitHub user account.
space_number (integer) (required)
The unique identifier of the Copilot Space.
200 - OK
403 - Forbidden
404 - Resource not found
Request:
curl -L \
-X GET \
https://api.github.com/users/USERNAME/copilot-spaces/SPACE_NUMBER
Response schema (Status: 200):
Same response schema as Create an organization Copilot Space.
PUT /users/{username}/copilot-spaces/{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.
accept (string)application/vnd.github+json is recommended.username (string) (required)
The handle for the GitHub user account.
space_number (integer) (required)
The unique identifier of the Copilot Space.
name (string)
The name of the Copilot Space.
description (string)
A description of the Copilot Space.
general_instructions (string)
General instructions for the Copilot Space.
base_role (string)
The base role that determines default permissions for the space. Changing this field requires admin permissions.
no_access: No default access (default)
reader: Makes the space publicly readable
Note: User spaces do not support writer or admin base roles.
Can be one of: reader, no_access
resources_attributes (array of objects)
Resources to attach to the space.
resource_type (string)repository, github_file, free_text, github_issue, github_pull_request, media_content, uploaded_text_filemetadata (object)repository_id (integer)file_path (string)text (string)name (string)number (integer)200 - OK
403 - Forbidden
404 - Resource not found
422 - Validation failed, or the endpoint has been spammed.
Request:
curl -L \
-X PUT \
https://api.github.com/users/USERNAME/copilot-spaces/SPACE_NUMBER \
-d '{
"name": "Updated Development Space",
"description": "Updated personal space for development assistance",
"general_instructions": "Updated instructions to help me with React development patterns and best practices",
"resources_attributes": [
{
"resource_type": "github_file",
"metadata": {
"repository_id": 789012,
"file_path": "src/components/UpdatedApp.js"
}
},
{
"id": 123,
"_destroy": true
},
{
"id": 456,
"resource_type": "free_text",
"metadata": {
"name": "Updated Development Notes",
"text": "Updated focus on clean code principles and modern React patterns"
}
}
]
}'
Response schema (Status: 200):
Same response schema as Create an organization Copilot Space.
DELETE /users/{username}/copilot-spaces/{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.
accept (string)application/vnd.github+json is recommended.username (string) (required)
The handle for the GitHub user account.
space_number (integer) (required)
The unique identifier of the Copilot Space.
204 - The Copilot Space has been successfully deleted.
404 - Resource not found
422 - Validation failed, or the endpoint has been spammed.
Request:
curl -L \
-X DELETE \
https://api.github.com/users/USERNAME/copilot-spaces/SPACE_NUMBER
Response schema (Status: 204):