REST API endpoints for Copilot Spaces

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.

List organization Copilot Spaces

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.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/orgs/ORG/copilot-spaces

Response schema (Status: 200):

Create an organization Copilot Space

POST /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.

Parameters

Headers

Path and query parameters

Body parameters

HTTP response status codes

Code examples

Example

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):

Get an organization Copilot Space

GET /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.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

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.

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.

Parameters

Headers

Path and query parameters

Body parameters

HTTP response status codes

Code examples

Example

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

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X DELETE \
  https://api.github.com/orgs/ORG/copilot-spaces/SPACE_NUMBER

Response schema (Status: 204):

List Copilot Spaces for a user

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.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

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.

Create a Copilot Space for a user

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.

Parameters

Headers

Path and query parameters

Body parameters

HTTP response status codes

Code examples

Example

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 a Copilot Space for a user

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.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

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.

Set a Copilot Space for a user

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.

Parameters

Headers

Path and query parameters

Body parameters

HTTP response status codes

Code examples

Example

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 a Copilot Space for a user

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.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X DELETE \
  https://api.github.com/users/USERNAME/copilot-spaces/SPACE_NUMBER

Response schema (Status: 204):