---
title: "Add a collaborator to a Copilot Space for a user"
method: POST
path: "/users/{username}/copilot-spaces/{space_number}/collaborators"
tags: ["copilot-spaces"]
---

# Add a collaborator to a Copilot Space for a user

`POST /users/{username}/copilot-spaces/{space_number}/collaborators`

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

Team collaborators are not supported for user-owned Copilot Spaces.

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

## Path parameters

- `username` string, required
- `space_number` integer, required

## Request body

- object
  - `actor_type` 'User' | 'Team', required — The type of actor (must be `User` for user-owned spaces; `Team` will be rejected).
  - `actor_identifier` string, required — The username of the collaborator. The numeric user ID is also accepted.
  - `role` 'reader' | 'writer' | 'admin', required — The role to grant to the collaborator.

## Response `201`

Response

- union — A collaborator (user or team) of a Copilot Space
  - object — A GitHub user.
    - `name` string, nullable
    - `email` string, nullable
    - `login` string, required
    - `id` integer, required
    - `node_id` string, required
    - `avatar_url` string, uri, required
    - `gravatar_id` string, nullable, required
    - `url` string, uri, required
    - `html_url` string, uri, required
    - `followers_url` string, uri, required
    - `following_url` string, required
    - `gists_url` string, required
    - `starred_url` string, required
    - `subscriptions_url` string, uri, required
    - `organizations_url` string, uri, required
    - `repos_url` string, uri, required
    - `events_url` string, required
    - `received_events_url` string, uri, required
    - `type` string, required
    - `site_admin` boolean, required
    - `starred_at` string
    - `user_view_type` string
    - `actor_type` 'User', required — The collaborator actor type.
    - `role` 'reader' | 'writer' | 'admin', required — The role granted to the collaborator
  - object
    - `actor_type` 'Team', required — The collaborator actor type.
    - `role` 'reader' | 'writer' | 'admin', required — The role granted to the collaborator
    - `id` integer, required
    - `node_id` string, required
    - `name` string, required
    - `slug` string, required
    - `type` 'Team', required
    - `description` string, nullable
    - `privacy` string
    - `notification_setting` string
    - `url` string, uri
    - `html_url` string, uri
    - `members_url` string
    - `repositories_url` string, uri
    - `organization_id` integer
    - `parent` unknown

## Other responses

- `403` — Forbidden
- `404` — Resource not found
- `422` — Validation failed, or the endpoint has been spammed.

---

[API](https://skmtc.net/github/apis/api-github-com.md) · [All operations](https://skmtc.net/github/apis/api-github-com/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/github/api-github-com/revisions/a367f7028301/schema)
