{"meta":{"title":"Puntos de conexión de la API REST para Copilot Spaces","intro":"Use la API REST para administrar espacios Copilot y recursos relacionados.","product":"REST API","breadcrumbs":[{"href":"/es/rest","title":"REST API"},{"href":"/es/rest/copilot-spaces","title":"espacios de Copilot"},{"href":"/es/rest/copilot-spaces/copilot-spaces","title":"espacios de Copilot"}],"documentType":"article"},"body":"# Puntos de conexión de la API REST para Copilot Spaces\n\nUse la API REST para administrar espacios Copilot y recursos relacionados.\n\n> [!NOTE]\n> 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.\n\n## List organization Copilot Spaces\n\n```\nGET /orgs/{org}/copilot-spaces\n```\n\nLists Copilot Spaces owned by an organization. The authenticated user must have read access to the organization's Copilot Spaces.\nOnly 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.\nOAuth app tokens and personal access tokens (classic) need the read:org scope to use this endpoint.\nFine-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.\n\n### Parameters\n\n#### Headers\n\n- **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n- **`org`** (string) (required)\n  The organization name. The name is not case sensitive.\n\n- **`per_page`** (integer)\n  The number of results per page (max 100).\n  Default: `30`\n\n- **`before`** (string)\n  A cursor, as given in the Link header. If specified, the query only searches for results before this cursor.\n\n- **`after`** (string)\n  A cursor, as given in the Link header. If specified, the query only searches for results after this cursor.\n\n### HTTP response status codes\n\n- **200** - OK\n\n- **403** - Forbidden\n\n- **404** - Resource not found\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  https://api.github.com/orgs/ORG/copilot-spaces\n```\n\n**Response schema (Status: 200):**\n\n* `spaces`: required, array of `Space`:\n  * `id`: required, integer, format: int64\n  * `number`: required, integer\n  * `name`: required, string\n  * `description`: string or null\n  * `general_instructions`: string or null, maxLength: 4000\n  * `base_role`: required, string, enum: `reader`, `writer`, `admin`, `no_access`\n  * `owner`: required, any of:\n    * **Simple User**\n      * `name`: string or null\n      * `email`: string or null\n      * `login`: required, string\n      * `id`: required, integer, format: int64\n      * `node_id`: required, string\n      * `avatar_url`: required, string, format: uri\n      * `gravatar_id`: required, string or null\n      * `url`: required, string, format: uri\n      * `html_url`: required, string, format: uri\n      * `followers_url`: required, string, format: uri\n      * `following_url`: required, string\n      * `gists_url`: required, string\n      * `starred_url`: required, string\n      * `subscriptions_url`: required, string, format: uri\n      * `organizations_url`: required, string, format: uri\n      * `repos_url`: required, string, format: uri\n      * `events_url`: required, string\n      * `received_events_url`: required, string, format: uri\n      * `type`: required, string\n      * `site_admin`: required, boolean\n      * `starred_at`: string\n      * `user_view_type`: string\n    * **Organization Simple**\n      * `login`: required, string\n      * `id`: required, integer\n      * `node_id`: required, string\n      * `url`: required, string, format: uri\n      * `repos_url`: required, string, format: uri\n      * `events_url`: required, string, format: uri\n      * `hooks_url`: required, string\n      * `issues_url`: required, string\n      * `members_url`: required, string\n      * `public_members_url`: required, string\n      * `avatar_url`: required, string\n      * `description`: required, string or null\n  * `creator`: required, `Simple User` (see above)\n  * `created_at`: required, string, format: date-time\n  * `updated_at`: required, string, format: date-time\n  * `html_url`: required, string, format: uri\n  * `api_url`: required, string, format: uri\n  * `resources_attributes`: array of objects:\n    * `id`: integer, format: int64\n    * `resource_type`: string, enum: `repository`, `github_file`, `free_text`, `github_issue`, `github_pull_request`, `media_content`, `uploaded_text_file`\n    * `copilot_chat_attachment_id`: integer or null, format: int64\n    * `created_at`: string, format: date-time\n    * `updated_at`: string, format: date-time\n    * `metadata`: object:\n      * `repository_id`: integer\n      * `file_path`: string\n      * `text`: string\n      * `name`: string\n      * `number`: integer\n      * `copilot_chat_attachment_id`: integer\n      * `media_type`: string\n      * `url`: string\n      * `height`: integer\n      * `width`: integer\n\n## Create an organization Copilot Space\n\n```\nPOST /orgs/{org}/copilot-spaces\n```\n\nCreates a new Copilot Space owned by an organization. The authenticated user must have permissions to create spaces in the organization.\nOrganization members with appropriate permissions can create Copilot Spaces to be shared within their organization.\nOAuth app tokens and personal access tokens (classic) need the read:org scope to use this endpoint.\nFine-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.\n\n### Parameters\n\n#### Headers\n\n- **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n- **`org`** (string) (required)\n  The organization name. The name is not case sensitive.\n\n#### Body parameters\n\n- **`name`** (string) (required)\n  The name of the Copilot Space.\n\n- **`description`** (string)\n  A description of the Copilot Space.\n\n- **`general_instructions`** (string)\n  General instructions for the Copilot Space.\n\n- **`base_role`** (string)\n  The base role that determines default permissions for organization members.\n\nno_access: No default access (default)\nreader: Organization members can read the space\nwriter: Organization members can read and edit the space\nadmin: Organization members have full admin access to the space\n  Default: `no_access`\n  Can be one of: `reader`, `writer`, `admin`, `no_access`\n\n- **`resources_attributes`** (array of objects)\n  Resources to attach to the space.\n  - **`resource_type`** (string)\n    The type of resource.\n    Can be one of: `repository`, `github_file`, `free_text`, `github_issue`, `github_pull_request`, `media_content`, `uploaded_text_file`\n  - **`metadata`** (object)\n    Metadata specific to the resource type.\n    - **`repository_id`** (integer)\n      Repository ID for repository or file resources.\n    - **`file_path`** (string)\n      File path for file resources.\n    - **`text`** (string)\n      Text content for free text resources.\n    - **`name`** (string)\n      Name for the resource.\n    - **`number`** (integer)\n      Issue or PR number.\n\n### HTTP response status codes\n\n- **201** - Created\n\n- **403** - Forbidden\n\n- **404** - Resource not found\n\n- **422** - Validation failed, or the endpoint has been spammed.\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X POST \\\n  https://api.github.com/orgs/ORG/copilot-spaces \\\n  -d '{\n  \"name\": \"Team Planning Space\",\n  \"description\": \"Organization space for team planning and coordination\",\n  \"general_instructions\": \"Help the team with planning and coordination tasks\",\n  \"resources_attributes\": [\n    {\n      \"resource_type\": \"github_file\",\n      \"metadata\": {\n        \"repository_id\": 123456,\n        \"file_path\": \"docs/planning.md\"\n      }\n    },\n    {\n      \"resource_type\": \"free_text\",\n      \"metadata\": {\n        \"name\": \"Team Guidelines\",\n        \"text\": \"Our team follows agile methodology and holds daily standups\"\n      }\n    }\n  ]\n}'\n```\n\n**Response schema (Status: 201):**\n\n* `id`: required, integer, format: int64\n* `number`: required, integer\n* `name`: required, string\n* `description`: string or null\n* `general_instructions`: string or null, maxLength: 4000\n* `base_role`: required, string, enum: `reader`, `writer`, `admin`, `no_access`\n* `owner`: required, any of:\n  * **Simple User**\n    * `name`: string or null\n    * `email`: string or null\n    * `login`: required, string\n    * `id`: required, integer, format: int64\n    * `node_id`: required, string\n    * `avatar_url`: required, string, format: uri\n    * `gravatar_id`: required, string or null\n    * `url`: required, string, format: uri\n    * `html_url`: required, string, format: uri\n    * `followers_url`: required, string, format: uri\n    * `following_url`: required, string\n    * `gists_url`: required, string\n    * `starred_url`: required, string\n    * `subscriptions_url`: required, string, format: uri\n    * `organizations_url`: required, string, format: uri\n    * `repos_url`: required, string, format: uri\n    * `events_url`: required, string\n    * `received_events_url`: required, string, format: uri\n    * `type`: required, string\n    * `site_admin`: required, boolean\n    * `starred_at`: string\n    * `user_view_type`: string\n  * **Organization Simple**\n    * `login`: required, string\n    * `id`: required, integer\n    * `node_id`: required, string\n    * `url`: required, string, format: uri\n    * `repos_url`: required, string, format: uri\n    * `events_url`: required, string, format: uri\n    * `hooks_url`: required, string\n    * `issues_url`: required, string\n    * `members_url`: required, string\n    * `public_members_url`: required, string\n    * `avatar_url`: required, string\n    * `description`: required, string or null\n* `creator`: required, `Simple User` (see above)\n* `created_at`: required, string, format: date-time\n* `updated_at`: required, string, format: date-time\n* `html_url`: required, string, format: uri\n* `api_url`: required, string, format: uri\n* `resources_attributes`: array of objects:\n  * `id`: integer, format: int64\n  * `resource_type`: string, enum: `repository`, `github_file`, `free_text`, `github_issue`, `github_pull_request`, `media_content`, `uploaded_text_file`\n  * `copilot_chat_attachment_id`: integer or null, format: int64\n  * `created_at`: string, format: date-time\n  * `updated_at`: string, format: date-time\n  * `metadata`: object:\n    * `repository_id`: integer\n    * `file_path`: string\n    * `text`: string\n    * `name`: string\n    * `number`: integer\n    * `copilot_chat_attachment_id`: integer\n    * `media_type`: string\n    * `url`: string\n    * `height`: integer\n    * `width`: integer\n\n## Get an organization Copilot Space\n\n```\nGET /orgs/{org}/copilot-spaces/{space_number}\n```\n\nGets details about a specific Copilot Space owned by an organization. The authenticated user must have read access to the Space.\nInternal Spaces require the authenticated user to be a member of the organization or have been granted read permissions.\nOAuth app tokens and personal access tokens (classic) need the read:org scope to use this endpoint.\nFine-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.\n\n### Parameters\n\n#### Headers\n\n- **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n- **`org`** (string) (required)\n  The organization name. The name is not case sensitive.\n\n- **`space_number`** (integer) (required)\n  The unique identifier of the Copilot Space.\n\n### HTTP response status codes\n\n- **200** - OK\n\n- **403** - Forbidden\n\n- **404** - Resource not found\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  https://api.github.com/orgs/ORG/copilot-spaces/SPACE_NUMBER\n```\n\n**Response schema (Status: 200):**\n\nSame response schema as [Create an organization Copilot Space](#create-an-organization-copilot-space).\n\n## Set an organization Copilot Space\n\n```\nPUT /orgs/{org}/copilot-spaces/{space_number}\n```\n\nUpdates a Copilot Space owned by an organization. The authenticated user must have permissions to update spaces in the organization.\nOrganization members with appropriate permissions can update Copilot Spaces owned by their organization.\nOAuth app tokens and personal access tokens (classic) need the read:org scope to use this endpoint.\nFine-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.\n\n### Parameters\n\n#### Headers\n\n- **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n- **`org`** (string) (required)\n  The organization name. The name is not case sensitive.\n\n- **`space_number`** (integer) (required)\n  The unique identifier of the Copilot Space.\n\n#### Body parameters\n\n- **`name`** (string)\n  The name of the Copilot Space.\n\n- **`description`** (string)\n  A description of the Copilot Space.\n\n- **`general_instructions`** (string)\n  General instructions for the Copilot Space.\n\n- **`base_role`** (string)\n  The base role that determines default permissions for organization members. Changing this field requires admin permissions.\n\nno_access: No default access (default)\nreader: Organization members can read the space\nwriter: Organization members can read and edit the space\nadmin: Organization members have full admin access to the space\n  Can be one of: `reader`, `writer`, `admin`, `no_access`\n\n- **`resources_attributes`** (array of objects)\n  Resources to attach to the space.\n  - **`resource_type`** (string)\n    The type of resource.\n    Can be one of: `repository`, `github_file`, `free_text`, `github_issue`, `github_pull_request`, `media_content`, `uploaded_text_file`\n  - **`metadata`** (object)\n    Metadata specific to the resource type.\n    - **`repository_id`** (integer)\n      Repository ID for repository or file resources.\n    - **`file_path`** (string)\n      File path for file resources.\n    - **`text`** (string)\n      Text content for free text resources.\n    - **`name`** (string)\n      Name for the resource.\n    - **`number`** (integer)\n      Issue or PR number.\n\n### HTTP response status codes\n\n- **200** - OK\n\n- **403** - Forbidden\n\n- **404** - Resource not found\n\n- **422** - Validation failed, or the endpoint has been spammed.\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X PUT \\\n  https://api.github.com/orgs/ORG/copilot-spaces/SPACE_NUMBER \\\n  -d '{\n  \"name\": \"Updated Team Planning Space\",\n  \"description\": \"Updated organization space for team planning and coordination\",\n  \"general_instructions\": \"Updated instructions to help the team with planning and coordination tasks\",\n  \"resources_attributes\": [\n    {\n      \"resource_type\": \"github_file\",\n      \"metadata\": {\n        \"repository_id\": 123456,\n        \"file_path\": \"docs/updated-planning.md\"\n      }\n    },\n    {\n      \"id\": 789,\n      \"_destroy\": true\n    },\n    {\n      \"id\": 456,\n      \"resource_type\": \"free_text\",\n      \"metadata\": {\n        \"name\": \"Updated Team Guidelines\",\n        \"text\": \"Our updated team follows agile methodology and holds daily standups\"\n      }\n    }\n  ]\n}'\n```\n\n**Response schema (Status: 200):**\n\nSame response schema as [Create an organization Copilot Space](#create-an-organization-copilot-space).\n\n## Delete an organization Copilot Space\n\n```\nDELETE /orgs/{org}/copilot-spaces/{space_number}\n```\n\nDeletes a Copilot Space owned by an organization. The authenticated user must have permissions to delete spaces in the organization.\nWarning: This action is permanent and cannot be undone. Deleting a Copilot Space will remove all associated resources and configurations.\nOrganization members with appropriate permissions can delete Copilot Spaces owned by their organization.\nOAuth app tokens and personal access tokens (classic) need both the read:org and repo scopes to use this endpoint.\nFine-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.\n\n### Parameters\n\n#### Headers\n\n- **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n- **`org`** (string) (required)\n  The organization name. The name is not case sensitive.\n\n- **`space_number`** (integer) (required)\n  The unique identifier of the Copilot Space.\n\n### HTTP response status codes\n\n- **204** - The Copilot Space has been successfully deleted.\n\n- **404** - Resource not found\n\n- **422** - Validation failed, or the endpoint has been spammed.\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X DELETE \\\n  https://api.github.com/orgs/ORG/copilot-spaces/SPACE_NUMBER\n```\n\n**Response schema (Status: 204):**\n\n## List Copilot Spaces for a user\n\n```\nGET /users/{username}/copilot-spaces\n```\n\nLists Copilot Spaces owned by a user. The authenticated user must have read access to the user's Copilot Spaces.\nOnly 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.\nOAuth app tokens and personal access tokens (classic) need the read:user scope to use this endpoint.\n\n### Parameters\n\n#### Headers\n\n- **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n- **`username`** (string) (required)\n  The handle for the GitHub user account.\n\n- **`per_page`** (integer)\n  The number of results per page (max 100).\n  Default: `30`\n\n- **`before`** (string)\n  A cursor, as given in the Link header. If specified, the query only searches for results before this cursor.\n\n- **`after`** (string)\n  A cursor, as given in the Link header. If specified, the query only searches for results after this cursor.\n\n### HTTP response status codes\n\n- **200** - OK\n\n- **403** - Forbidden\n\n- **404** - Resource not found\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  https://api.github.com/users/USERNAME/copilot-spaces\n```\n\n**Response schema (Status: 200):**\n\nSame response schema as [List organization Copilot Spaces](#list-organization-copilot-spaces).\n\n## Create a Copilot Space for a user\n\n```\nPOST /users/{username}/copilot-spaces\n```\n\nCreates a new Copilot Space owned by a user. Only the authenticated user can create spaces for their own account.\nUsers can create personal Copilot Spaces for their individual use.\nOAuth app tokens and personal access tokens (classic) need the read:user scope to use this endpoint.\n\n### Parameters\n\n#### Headers\n\n- **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n- **`username`** (string) (required)\n  The handle for the GitHub user account.\n\n#### Body parameters\n\n- **`name`** (string) (required)\n  The name of the Copilot Space.\n\n- **`description`** (string)\n  A description of the Copilot Space.\n\n- **`general_instructions`** (string)\n  General instructions for the Copilot Space.\n\n- **`base_role`** (string)\n  The base role that determines default permissions for the space.\n\nno_access: No default access (default)\nreader: Makes the space publicly readable\nNote: User spaces do not support writer or admin base roles.\n  Default: `no_access`\n  Can be one of: `reader`, `no_access`\n\n- **`resources_attributes`** (array of objects)\n  Resources to attach to the space.\n  - **`resource_type`** (string)\n    The type of resource.\n    Can be one of: `repository`, `github_file`, `free_text`, `github_issue`, `github_pull_request`, `media_content`, `uploaded_text_file`\n  - **`metadata`** (object)\n    Metadata specific to the resource type.\n    - **`repository_id`** (integer)\n      Repository ID for repository or file resources.\n    - **`file_path`** (string)\n      File path for file resources.\n    - **`text`** (string)\n      Text content for free text resources.\n    - **`name`** (string)\n      Name for the resource.\n    - **`number`** (integer)\n      Issue or PR number.\n\n### HTTP response status codes\n\n- **201** - Created\n\n- **403** - Forbidden\n\n- **404** - Resource not found\n\n- **422** - Validation failed, or the endpoint has been spammed.\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X POST \\\n  https://api.github.com/users/USERNAME/copilot-spaces \\\n  -d '{\n  \"name\": \"My Development Space\",\n  \"description\": \"Personal space for development assistance\",\n  \"general_instructions\": \"Help me with React development patterns and best practices\",\n  \"resources_attributes\": [\n    {\n      \"resource_type\": \"github_file\",\n      \"metadata\": {\n        \"repository_id\": 789012,\n        \"file_path\": \"src/components/App.js\"\n      }\n    },\n    {\n      \"resource_type\": \"free_text\",\n      \"metadata\": {\n        \"name\": \"Development Notes\",\n        \"text\": \"Focus on clean code principles and modern React patterns\"\n      }\n    }\n  ]\n}'\n```\n\n**Response schema (Status: 201):**\n\nSame response schema as [Create an organization Copilot Space](#create-an-organization-copilot-space).\n\n## Get a Copilot Space for a user\n\n```\nGET /users/{username}/copilot-spaces/{space_number}\n```\n\nGets details about a specific Copilot Space owned by a user. The authenticated user must have read access to the Space.\nPrivate user spaces require the authenticated user to be the owner of the space.\nPublic user spaces are accessible to any authenticated user.\nOAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.\n\n### Parameters\n\n#### Headers\n\n- **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n- **`username`** (string) (required)\n  The handle for the GitHub user account.\n\n- **`space_number`** (integer) (required)\n  The unique identifier of the Copilot Space.\n\n### HTTP response status codes\n\n- **200** - OK\n\n- **403** - Forbidden\n\n- **404** - Resource not found\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  https://api.github.com/users/USERNAME/copilot-spaces/SPACE_NUMBER\n```\n\n**Response schema (Status: 200):**\n\nSame response schema as [Create an organization Copilot Space](#create-an-organization-copilot-space).\n\n## Set a Copilot Space for a user\n\n```\nPUT /users/{username}/copilot-spaces/{space_number}\n```\n\nUpdates a Copilot Space owned by a user. Only the authenticated user can update spaces for their own account.\nUsers can update their personal Copilot Spaces.\nOAuth app tokens and personal access tokens (classic) need the read:user scope to use this endpoint.\n\n### Parameters\n\n#### Headers\n\n- **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n- **`username`** (string) (required)\n  The handle for the GitHub user account.\n\n- **`space_number`** (integer) (required)\n  The unique identifier of the Copilot Space.\n\n#### Body parameters\n\n- **`name`** (string)\n  The name of the Copilot Space.\n\n- **`description`** (string)\n  A description of the Copilot Space.\n\n- **`general_instructions`** (string)\n  General instructions for the Copilot Space.\n\n- **`base_role`** (string)\n  The base role that determines default permissions for the space. Changing this field requires admin permissions.\n\nno_access: No default access (default)\nreader: Makes the space publicly readable\nNote: User spaces do not support writer or admin base roles.\n  Can be one of: `reader`, `no_access`\n\n- **`resources_attributes`** (array of objects)\n  Resources to attach to the space.\n  - **`resource_type`** (string)\n    The type of resource.\n    Can be one of: `repository`, `github_file`, `free_text`, `github_issue`, `github_pull_request`, `media_content`, `uploaded_text_file`\n  - **`metadata`** (object)\n    Metadata specific to the resource type.\n    - **`repository_id`** (integer)\n      Repository ID for repository or file resources.\n    - **`file_path`** (string)\n      File path for file resources.\n    - **`text`** (string)\n      Text content for free text resources.\n    - **`name`** (string)\n      Name for the resource.\n    - **`number`** (integer)\n      Issue or PR number.\n\n### HTTP response status codes\n\n- **200** - OK\n\n- **403** - Forbidden\n\n- **404** - Resource not found\n\n- **422** - Validation failed, or the endpoint has been spammed.\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X PUT \\\n  https://api.github.com/users/USERNAME/copilot-spaces/SPACE_NUMBER \\\n  -d '{\n  \"name\": \"Updated Development Space\",\n  \"description\": \"Updated personal space for development assistance\",\n  \"general_instructions\": \"Updated instructions to help me with React development patterns and best practices\",\n  \"resources_attributes\": [\n    {\n      \"resource_type\": \"github_file\",\n      \"metadata\": {\n        \"repository_id\": 789012,\n        \"file_path\": \"src/components/UpdatedApp.js\"\n      }\n    },\n    {\n      \"id\": 123,\n      \"_destroy\": true\n    },\n    {\n      \"id\": 456,\n      \"resource_type\": \"free_text\",\n      \"metadata\": {\n        \"name\": \"Updated Development Notes\",\n        \"text\": \"Updated focus on clean code principles and modern React patterns\"\n      }\n    }\n  ]\n}'\n```\n\n**Response schema (Status: 200):**\n\nSame response schema as [Create an organization Copilot Space](#create-an-organization-copilot-space).\n\n## Delete a Copilot Space for a user\n\n```\nDELETE /users/{username}/copilot-spaces/{space_number}\n```\n\nDeletes a Copilot Space owned by a user. The authenticated user must be the owner of the space.\nWarning: This action is permanent and cannot be undone. Deleting a space will remove all associated resources and configurations.\nOAuth app tokens and personal access tokens (classic) need the user scope to use this endpoint.\n\n### Parameters\n\n#### Headers\n\n- **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n- **`username`** (string) (required)\n  The handle for the GitHub user account.\n\n- **`space_number`** (integer) (required)\n  The unique identifier of the Copilot Space.\n\n### HTTP response status codes\n\n- **204** - The Copilot Space has been successfully deleted.\n\n- **404** - Resource not found\n\n- **422** - Validation failed, or the endpoint has been spammed.\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X DELETE \\\n  https://api.github.com/users/USERNAME/copilot-spaces/SPACE_NUMBER\n```\n\n**Response schema (Status: 204):**"}