Skip to content

List resources for a Copilot Space for a user

GET
/users/{username}/copilot-spaces/{space_number}/resources

Lists all resources attached to a specific Copilot Space owned by a user. The authenticated user must have appropriate permissions to view the space.

OAuth app tokens and personal access tokens (classic) need the read:user scope to use this endpoint.

API method documentation

username
required
string

The handle for the GitHub user account.

space_number
required
integer

The unique identifier of the Copilot Space.

Response

Media type application/json
object
resources
required

The list of resources attached to this Copilot Space.

Array<object>
Copilot Space Resource

A resource attached to a Copilot Space.

object
id
required

The unique identifier of the resource.

integer
resource_type
required

The type of the resource.

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

The ID of the associated chat attachment, if any.

integer
nullable
metadata
required

Resource-specific metadata. The keys and values depend on the resource type.

object
key
additional properties
any
created_at
required

The date and time the resource was created.

string format: date-time
updated_at
required

The date and time the resource was last updated.

string format: date-time
Examples
Example default
{
"resources": [
{
"id": 1,
"resource_type": "free_text",
"copilot_chat_attachment_id": null,
"metadata": {
"name": "notes.txt",
"text": "Some helpful notes"
},
"created_at": "2025-01-01T00:00:00Z",
"updated_at": "2025-01-01T00:00:00Z"
}
]
}

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"
}