apicheats.dev github/llms.txt Raw .md
GET

GET /users/{username}/copilot-spaces — GitHub API

GitHub token (required); https://api.github.com

GitHub API

List Copilot Spaces for a user

Base URL
https://api.github.com
Auth
Authorization: Bearer <GITHUB_API_KEY>
Last verified
2026-10-20 · upstream hash matched
Actions Try in browser→
Agents: curl -H "Accept: text/markdown" this URL
→ 233 tokens · Vary: Accept

Critical gotchas

GitHub recommends an Accept: application/vnd.github+json header and an explicit X-GitHub-Api-Version header.

Fine-grained tokens only authorize repositories and permissions selected when the token is created.

cURL

curl -X GET 'https://api.github.com/users/example-username/copilot-spaces?per_page=30&before=example-before&after=example-after' \  -H "Authorization: Bearer $GITHUB_TOKEN" \  -H 'Accept: application/vnd.github+json' \  -H 'X-GitHub-Api-Version: 2026-03-10'

Parameters

Name In Type Required Description
username path string Yes The handle for the GitHub user account.
per_page query integer No The number of results per page (max 100).
before query string No A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor.
after query string No A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor.

Response 200 OK

{
  "spaces": [
    {
      "id": 42,
      "number": 1,
      "name": "My Development Space",
      "description": "A space for discussing React development patterns",
      "general_instructions": "Help with React development patterns and best practices",
      "base_role": "no_access",
      "owner": {
        "name": "string",
        "email": "string",
        "login": "octocat",
        "id": 1,
        "node_id": "MDQ6VXNlcjE=",
        "avatar_url": "https://github.com/images/error/octocat_happy.gif",
        "gravatar_id": "41d064eb2195891e12d0413f63227ea7",
        "url": "https://api.github.com/users/octocat",
        "html_url": "https://github.com/octocat",
        "followers_url": "https://api.github.com/users/octocat/followers",
        "following_url": "https://api.github.com/users/octocat/following{/other_user}",
        "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
        "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
        "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
        "organizations_url": "https://api.github.com/users/octocat/orgs",
        "repos_url": "https://api.github.com/users/octocat/repos",
        "events_url": "https://api.github.com/users/octocat/events{/privacy}",
        "received_events_url": "https://api.github.com/users/octocat/received_events",
        "type": "User",
        "site_admin": true,
        "starred_at": "\"2020-07-09T00:17:55Z\"",
        "user_view_type": "public"
      },
      "creator": {
        "name": "string",
        "email": "string",
        "login": "octocat",
        "id": 1,
        "node_id": "MDQ6VXNlcjE=",
        "avatar_url": "https://github.com/images/error/octocat_happy.gif",
        "gravatar_id": "41d064eb2195891e12d0413f63227ea7",
        "url": "https://api.github.com/users/octocat",
        "html_url": "https://github.com/octocat",
        "followers_url": "https://api.github.com/users/octocat/followers",
        "following_url": "https://api.github.com/users/octocat/following{/other_user}",
        "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
        "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
        "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
        "organizations_url": "https://api.github.com/users/octocat/orgs",
        "repos_url": "https://api.github.com/users/octocat/repos",
        "events_url": "https://api.github.com/users/octocat/events{/privacy}",
        "received_events_url": "https://api.github.com/users/octocat/received_events",
        "type": "User",
        "site_admin": true,
        "starred_at": "\"2020-07-09T00:17:55Z\"",
        "user_view_type": "public"
      },
      "created_at": "2023-01-01T00:00:00Z",
      "updated_at": "2023-01-01T12:00:00Z",
      "html_url": "https://github.com/copilot/spaces/octo-org/5",
      "api_url": "https://api.github.com/organizations/1/copilot-spaces/5",
      "resources_attributes": [
        {
          "id": 0,
          "resource_type": "repository",
          "copilot_chat_attachment_id": 0,
          "created_at": "2026-09-03T00:00:00Z",
          "updated_at": "2026-09-03T00:00:00Z",
          "metadata": {
            "repository_id": "[recursive or deeply nested schema]",
            "file_path": "[recursive or deeply nested schema]",
            "text": "[recursive or deeply nested schema]",
            "name": "[recursive or deeply nested schema]",
            "number": "[recursive or deeply nested schema]",
            "copilot_chat_attachment_id": "[recursive or deeply nested schema]",
            "media_type": "[recursive or deeply nested schema]",
            "url": "[recursive or deeply nested schema]",
            "height": "[recursive or deeply nested schema]",
            "width": "[recursive or deeply nested schema]"
          }
        }
      ]
    }
  ]
}
Get a free GitHub API key → sponsored

Affiliate link - we may earn a commission, at no extra cost to you.