{"meta":{"title":"Copilot Spaces collaborators","intro":"Use the REST API to manage collaborators for Copilot Spaces.","product":"REST API","breadcrumbs":[{"href":"/en/enterprise-cloud@latest/rest","title":"REST API"},{"href":"/en/enterprise-cloud@latest/rest/copilot-spaces","title":"Copilot Spaces"},{"href":"/en/enterprise-cloud@latest/rest/copilot-spaces/collaborators","title":"Collaborators"}],"documentType":"article"},"body":"# Copilot Spaces collaborators\n\nUse the REST API to manage collaborators for Copilot Spaces.\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 collaborators for an organization Copilot Space\n\n```\nGET /orgs/{org}/copilot-spaces/{space_number}/collaborators\n```\n\nLists all collaborators for a specific Copilot Space owned by an organization. The authenticated user must have appropriate permissions to view collaborators.\nEach collaborator entry specifies which user or team has access to the space and at what level (reader, writer, or admin). The space owner (organization) is excluded from this list.\nNote: Team collaborators listed here are teams that are defined in 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 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/collaborators\n```\n\n**Response schema (Status: 200):**\n\n* `collaborators`: required, array of object\n\n## Add a collaborator to an organization Copilot Space\n\n```\nPOST /orgs/{org}/copilot-spaces/{space_number}/collaborators\n```\n\nAdds a collaborator (user or team) to a specific Copilot Space owned by an organization. The authenticated user must have appropriate permissions to manage collaborators.\nNote: When adding users as collaborators, they must already be members of the organization.\nWhen adding teams as collaborators, they must be defined in the organization.\nOAuth app tokens and personal access tokens (classic) need the write: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#### Body parameters\n\n- **`actor_type`** (string) (required)\n  The type of actor (user or team).\n  Can be one of: `User`, `Team`\n\n- **`actor_identifier`** (string) (required)\n  The username (for users) or team slug (for teams). The numeric ID of a user or team is also accepted.\n\n- **`role`** (string) (required)\n  The role to grant to the collaborator.\n  Can be one of: `reader`, `writer`, `admin`\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 1: Status Code 201\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X POST \\\n  https://api.github.com/orgs/ORG/copilot-spaces/SPACE_NUMBER/collaborators \\\n  -d '{\n  \"actor_type\": \"User\",\n  \"actor_identifier\": \"octocat\",\n  \"role\": \"writer\"\n}'\n```\n\n**Response schema (Status: 201):**\n\n* any of:\n  * **object**\n  * **object**\n    * `actor_type`: required, string, enum: `Team`\n    * `role`: required, string, enum: `reader`, `writer`, `admin`\n    * `id`: required, integer\n    * `node_id`: required, string\n    * `name`: required, string\n    * `slug`: required, string\n    * `type`: required, string, enum: `Team`\n    * `description`: string or null\n    * `privacy`: string\n    * `notification_setting`: string\n    * `url`: string, format: uri\n    * `html_url`: string, format: uri\n    * `members_url`: string\n    * `repositories_url`: string, format: uri\n    * `organization_id`: integer\n    * `parent`: null\n\n#### Example 2: Status Code 201\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X POST \\\n  https://api.github.com/orgs/ORG/copilot-spaces/SPACE_NUMBER/collaborators \\\n  -d '{\n  \"actor_type\": \"Team\",\n  \"actor_identifier\": \"developers\",\n  \"role\": \"reader\"\n}'\n```\n\n**Response schema (Status: 201):**\n\n* any of:\n  * **object**\n  * **object**\n    * `actor_type`: required, string, enum: `Team`\n    * `role`: required, string, enum: `reader`, `writer`, `admin`\n    * `id`: required, integer\n    * `node_id`: required, string\n    * `name`: required, string\n    * `slug`: required, string\n    * `type`: required, string, enum: `Team`\n    * `description`: string or null\n    * `privacy`: string\n    * `notification_setting`: string\n    * `url`: string, format: uri\n    * `html_url`: string, format: uri\n    * `members_url`: string\n    * `repositories_url`: string, format: uri\n    * `organization_id`: integer\n    * `parent`: null\n\n## Set a collaborator role for an organization Copilot Space\n\n```\nPUT /orgs/{org}/copilot-spaces/{space_number}/collaborators/{actor_type}/{actor_identifier}\n```\n\nUpdates the role of a collaborator for a specific Copilot Space owned by an organization. The authenticated user must have appropriate permissions to manage collaborators.\nOAuth app tokens and personal access tokens (classic) need the write: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- **`actor_type`** (string) (required)\n  The type of actor (user or team).\n  Can be one of: `User`, `Team`\n\n- **`actor_identifier`** (string) (required)\n  The username (for users) or team slug (for teams). The numeric ID of a user or team is also accepted.\n\n#### Body parameters\n\n- **`role`** (string) (required)\n  The new role to grant to the collaborator. Use no_access to remove the collaborator.\n  Can be one of: `reader`, `writer`, `admin`, `no_access`\n\n### HTTP response status codes\n\n- **200** - OK\n\n- **204** - Response when role is no_access and the collaborator was removed.\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 1: Status Code 200\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X PUT \\\n  https://api.github.com/orgs/ORG/copilot-spaces/SPACE_NUMBER/collaborators/ACTOR_TYPE/ACTOR_IDENTIFIER \\\n  -d '{\n  \"role\": \"admin\"\n}'\n```\n\n**Response schema (Status: 200):**\n\nSame response schema as [Add a collaborator to an organization Copilot Space](#add-a-collaborator-to-an-organization-copilot-space).\n\n#### Example 2: Status Code 200\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X PUT \\\n  https://api.github.com/orgs/ORG/copilot-spaces/SPACE_NUMBER/collaborators/ACTOR_TYPE/ACTOR_IDENTIFIER \\\n  -d '{\n  \"role\": \"admin\"\n}'\n```\n\n**Response schema (Status: 200):**\n\nSame response schema as [Add a collaborator to an organization Copilot Space](#add-a-collaborator-to-an-organization-copilot-space).\n\n## Remove a collaborator from an organization Copilot Space\n\n```\nDELETE /orgs/{org}/copilot-spaces/{space_number}/collaborators/{actor_type}/{actor_identifier}\n```\n\nRemoves a collaborator from a specific Copilot Space owned by an organization. The authenticated user must have appropriate permissions to manage collaborators.\nOAuth app tokens and personal access tokens (classic) need the write: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- **`actor_type`** (string) (required)\n  The type of actor (user or team).\n  Can be one of: `User`, `Team`\n\n- **`actor_identifier`** (string) (required)\n  The username (for users) or team slug (for teams). The numeric ID of a user or team is also accepted.\n\n### HTTP response status codes\n\n- **204** - No Content\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 DELETE \\\n  https://api.github.com/orgs/ORG/copilot-spaces/SPACE_NUMBER/collaborators/ACTOR_TYPE/ACTOR_IDENTIFIER\n```\n\n**Response schema (Status: 204):**\n\n## List collaborators for a Copilot Space for a user\n\n```\nGET /users/{username}/copilot-spaces/{space_number}/collaborators\n```\n\nLists all collaborators for a specific Copilot Space owned by a user. The authenticated user must be the owner of the space or have admin access to the space.\nEach collaborator entry specifies which user has access to the space and at what level (reader, writer, or admin). The space owner is excluded from this list.\nTeam collaborators are not supported for user-owned Copilot Spaces.\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- **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/collaborators\n```\n\n**Response schema (Status: 200):**\n\nSame response schema as [List collaborators for an organization Copilot Space](#list-collaborators-for-an-organization-copilot-space).\n\n## Add a collaborator to a Copilot Space for a user\n\n```\nPOST /users/{username}/copilot-spaces/{space_number}/collaborators\n```\n\nAdds a collaborator to a specific Copilot Space owned by a user. The authenticated user must be the owner of the space or have admin access to the space.\nTeam collaborators are not supported for user-owned Copilot Spaces.\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#### Body parameters\n\n- **`actor_type`** (string) (required)\n  The type of actor (must be User for user-owned spaces; Team will be rejected).\n  Can be one of: `User`, `Team`\n\n- **`actor_identifier`** (string) (required)\n  The username of the collaborator. The numeric user ID is also accepted.\n\n- **`role`** (string) (required)\n  The role to grant to the collaborator.\n  Can be one of: `reader`, `writer`, `admin`\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/SPACE_NUMBER/collaborators \\\n  -d '{\n  \"actor_type\": \"User\",\n  \"actor_identifier\": \"octocat\",\n  \"role\": \"writer\"\n}'\n```\n\n**Response schema (Status: 201):**\n\nSame response schema as [Add a collaborator to an organization Copilot Space](#add-a-collaborator-to-an-organization-copilot-space).\n\n## Set a collaborator role for a Copilot Space for a user\n\n```\nPUT /users/{username}/copilot-spaces/{space_number}/collaborators/{actor_type}/{actor_identifier}\n```\n\nUpdates the role of a collaborator for a specific Copilot Space owned by a user. The authenticated user must be the owner of the space or have admin access to the space.\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- **`actor_type`** (string) (required)\n  The type of actor (must be User for user-owned spaces; Team will be rejected).\n  Can be one of: `User`, `Team`\n\n- **`actor_identifier`** (string) (required)\n  The username of the collaborator. The numeric user ID is also accepted.\n\n#### Body parameters\n\n- **`role`** (string) (required)\n  The new role to grant to the collaborator. Use no_access to remove the collaborator.\n  Can be one of: `reader`, `writer`, `admin`, `no_access`\n\n### HTTP response status codes\n\n- **200** - OK\n\n- **204** - Response when role is no_access and the collaborator was removed.\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/collaborators/ACTOR_TYPE/ACTOR_IDENTIFIER \\\n  -d '{\n  \"role\": \"admin\"\n}'\n```\n\n**Response schema (Status: 200):**\n\nSame response schema as [Add a collaborator to an organization Copilot Space](#add-a-collaborator-to-an-organization-copilot-space).\n\n## Remove a collaborator from a Copilot Space for a user\n\n```\nDELETE /users/{username}/copilot-spaces/{space_number}/collaborators/{actor_type}/{actor_identifier}\n```\n\nRemoves a collaborator from a specific Copilot Space owned by a user. The authenticated user must be the owner of the space or have admin access to the space.\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- **`actor_type`** (string) (required)\n  The type of actor (must be User for user-owned spaces; Team will be rejected).\n  Can be one of: `User`, `Team`\n\n- **`actor_identifier`** (string) (required)\n  The username of the collaborator. The numeric user ID is also accepted.\n\n### HTTP response status codes\n\n- **204** - No Content\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 DELETE \\\n  https://api.github.com/users/USERNAME/copilot-spaces/SPACE_NUMBER/collaborators/ACTOR_TYPE/ACTOR_IDENTIFIER\n```\n\n**Response schema (Status: 204):**"}