Skip to content

Set 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.

API method documentation

org
required
string

The organization name. The name is not case sensitive.

space_number
required
integer

The unique identifier of the Copilot Space.

Media type application/json
object
name

The name of the Copilot Space.

string
description

A description of the Copilot Space.

string
general_instructions

General instructions for the Copilot Space.

string
<= 4000 characters
base_role

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
string
Allowed values: reader writer admin no_access
resources_attributes

Resources to attach to the space.

Array<object>
object
resource_type

The type of resource.

string
Allowed values: repository github_file free_text github_issue github_pull_request media_content uploaded_text_file
metadata

Metadata specific to the resource type.

object
repository_id

Repository ID for repository or file resources.

integer
file_path

File path for file resources.

string
text

Text content for free text resources.

string
name

Name for the resource.

string
number

Issue or PR number.

integer
Examples
Example default
{
"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

Media type application/json
Space

A GitHub Copilot Space represents an interactive AI workspace where users can ask questions and get assistance.

object
id
required

The unique identifier of the space.

integer format: int64
number
required

The number that identifies the space within its owner.

integer
name
required

The display name of the space.

string
description

A description of the space.

string
nullable
general_instructions

General instructions for the Copilot Space.

string
nullable <= 4000 characters
base_role
required

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)
string
Allowed values: reader writer admin no_access
owner
required
Any of:
Simple User

A GitHub user.

object
name
string
nullable
email
string
nullable
login
required
string
id
required
integer format: int64
node_id
required
string
avatar_url
required
string format: uri
gravatar_id
required
string
nullable
url
required
string format: uri
html_url
required
string format: uri
followers_url
required
string format: uri
following_url
required
string
gists_url
required
string
starred_url
required
string
subscriptions_url
required
string format: uri
organizations_url
required
string format: uri
repos_url
required
string format: uri
events_url
required
string
received_events_url
required
string format: uri
type
required
string
site_admin
required
boolean
starred_at
string
user_view_type
string
creator
required
Simple User

A GitHub user.

object
name
string
nullable
email
string
nullable
login
required
string
id
required
integer format: int64
node_id
required
string
avatar_url
required
string format: uri
gravatar_id
required
string
nullable
url
required
string format: uri
html_url
required
string format: uri
followers_url
required
string format: uri
following_url
required
string
gists_url
required
string
starred_url
required
string
subscriptions_url
required
string format: uri
organizations_url
required
string format: uri
repos_url
required
string format: uri
events_url
required
string
received_events_url
required
string format: uri
type
required
string
site_admin
required
boolean
starred_at
string
user_view_type
string
created_at
required

The date and time the space was created.

string format: date-time
updated_at
required

The date and time the space was last updated.

string format: date-time
html_url
required

The HTML URL of the space.

string format: uri
api_url
required

The API URL of the space.

string format: uri
resources_attributes

Resources attached to the space.

Array<object>
object
id

The unique identifier of the resource.

integer format: int64
resource_type

The type of resource.

string
Allowed values: repository github_file free_text github_issue github_pull_request media_content uploaded_text_file
copilot_chat_attachment_id

The unique identifier of the chat attachment for uploaded files or media content.

integer format: int64
nullable
created_at

The date and time the resource was created.

string format: date-time
updated_at

The date and time the resource was last updated.

string format: date-time
metadata

Metadata specific to the resource type.

object
repository_id

Repository ID for repository or file resources.

integer
file_path

File path for file resources.

string
text

Text content for free text resources.

string
name

Name for the resource.

string
number

Issue or PR number.

integer
copilot_chat_attachment_id

Chat attachment ID for uploaded files or media.

integer
media_type

Media type for media content resources.

string
url

URL for media content resources.

string
height

Height for media content resources.

integer
width

Width for media content resources.

integer
Examples
Example default

Example response for an organization copilot space

{
"id": 84,
"number": 3,
"name": "Team Planning Space",
"description": "Organization space for team planning and coordination",
"general_instructions": "Help the team with agile planning, sprint coordination, and project management best practices",
"owner": {
"login": "octo-org",
"id": 1,
"node_id": "MDEyOk9yZ2FuaXphdGlvbjE=",
"url": "https://api.github.com/orgs/octo-org",
"repos_url": "https://api.github.com/orgs/octo-org/repos",
"events_url": "https://api.github.com/orgs/octo-org/events",
"hooks_url": "https://api.github.com/orgs/octo-org/hooks",
"issues_url": "https://api.github.com/orgs/octo-org/issues",
"members_url": "https://api.github.com/orgs/octo-org/members{/member}",
"public_members_url": "https://api.github.com/orgs/octo-org/public_members{/member}",
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"description": "A great organization",
"gravatar_id": "",
"name": "octo-org",
"company": "GitHub",
"blog": "https://github.com/blog",
"location": "San Francisco",
"email": "octocat@github.com",
"twitter_username": "octo-org",
"html_url": "https://github.com/octo-org",
"created_at": "2008-01-14T04:33:35Z",
"updated_at": "2017-08-17T12:37:15Z",
"type": "Organization"
},
"creator": {
"login": "defunkt",
"id": 2,
"node_id": "MDQ6VXNlcjI=",
"avatar_url": "https://github.com/images/error/defunkt_happy.gif",
"gravatar_id": "",
"url": "https://api.github.com/users/defunkt",
"html_url": "https://github.com/defunkt",
"followers_url": "https://api.github.com/users/defunkt/followers",
"following_url": "https://api.github.com/users/defunkt/following{/other_user}",
"gists_url": "https://api.github.com/users/defunkt/gists{/gist_id}",
"starred_url": "https://api.github.com/users/defunkt/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/defunkt/subscriptions",
"organizations_url": "https://api.github.com/users/defunkt/orgs",
"repos_url": "https://api.github.com/users/defunkt/repos",
"events_url": "https://api.github.com/users/defunkt/events{/privacy}",
"received_events_url": "https://api.github.com/users/defunkt/received_events",
"type": "User",
"site_admin": true
},
"created_at": "2023-02-15T08:30:00Z",
"updated_at": "2023-02-15T14:45:00Z",
"html_url": "https://github.com/copilot/spaces/octo-org/3",
"api_url": "https://api.github.com/organizations/1/copilot-spaces/3",
"base_role": "no_access",
"resources_attributes": [
{
"id": 123,
"resource_type": "github_file",
"metadata": {
"repository_id": 456,
"file_path": "docs/planning.md"
}
},
{
"id": 124,
"resource_type": "free_text",
"metadata": {
"name": "Team Guidelines",
"text": "Our team follows agile methodology"
}
}
]
}

Forbidden

Media type application/json
Basic Error

Basic Error

object
message
string
documentation_url
string
url
string
status
string
Example generated
{
"message": "example",
"documentation_url": "example",
"url": "example",
"status": "example"
}

Resource not found

Media type application/json
Basic Error

Basic Error

object
message
string
documentation_url
string
url
string
status
string
Example generated
{
"message": "example",
"documentation_url": "example",
"url": "example",
"status": "example"
}

Validation failed, or the endpoint has been spammed.

Media type application/json
Validation Error

Validation Error

object
message
required
string
documentation_url
required
string
errors
Array<object>
object
resource
string
field
string
message
string
code
required
string
index
integer
value
One of:
string
nullable
Example generated
{
"message": "example",
"documentation_url": "example",
"errors": [
{
"resource": "example",
"field": "example",
"message": "example",
"code": "example",
"index": 1,
"value": [
"example"
]
}
]
}