REST API endpoints for Project (classic) collaborators
Use the REST API to manage collaborators on a project (classic).
List project collaborators
Warning
Closing down notice: Projects (classic) is being deprecated in favor of the new Projects experience. See the changelog for more information.
Fine-grained access tokens for "List project collaborators"
This endpoint works with the following fine-grained token types:
- GitHub App user access tokens
- GitHub App installation access tokens
- Fine-grained personal access tokens
The fine-grained token must have at least one of the following permission sets:
- "Projects" repository permissions (write)
- "Projects" organization permissions (admin)
Parameters for "List project collaborators"
| Name, Type, Description | 
|---|
| acceptstringSetting to  | 
| Name, Type, Description | 
|---|
| project_idinteger RequiredThe unique identifier of the project. | 
| Name, Type, Description | 
|---|
| affiliationstringFilters the collaborators by their affiliation.  Default:  Can be one of:  | 
| per_pageintegerThe number of results per page (max 100). For more information, see "Using pagination in the REST API." Default:  | 
| pageintegerThe page number of the results to fetch. For more information, see "Using pagination in the REST API." Default:  | 
HTTP response status codes for "List project collaborators"
| Status code | Description | 
|---|---|
| 200 | OK | 
| 304 | Not modified | 
| 401 | Requires authentication | 
| 403 | Forbidden | 
| 404 | Resource not found | 
| 422 | Validation failed, or the endpoint has been spammed. | 
Code samples for "List project collaborators"
Request example
curl -L \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  http(s)://HOSTNAME/api/v3/projects/PROJECT_ID/collaboratorsResponse
Status: 200[
  {
    "login": "octocat",
    "id": 1,
    "node_id": "MDQ6VXNlcjE=",
    "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    "gravatar_id": "",
    "url": "https://HOSTNAME/users/octocat",
    "html_url": "https://github.com/octocat",
    "followers_url": "https://HOSTNAME/users/octocat/followers",
    "following_url": "https://HOSTNAME/users/octocat/following{/other_user}",
    "gists_url": "https://HOSTNAME/users/octocat/gists{/gist_id}",
    "starred_url": "https://HOSTNAME/users/octocat/starred{/owner}{/repo}",
    "subscriptions_url": "https://HOSTNAME/users/octocat/subscriptions",
    "organizations_url": "https://HOSTNAME/users/octocat/orgs",
    "repos_url": "https://HOSTNAME/users/octocat/repos",
    "events_url": "https://HOSTNAME/users/octocat/events{/privacy}",
    "received_events_url": "https://HOSTNAME/users/octocat/received_events",
    "type": "User",
    "site_admin": false
  }
]Add project collaborator
Warning
Closing down notice: Projects (classic) is being deprecated in favor of the new Projects experience. See the changelog for more information.
Fine-grained access tokens for "Add project collaborator"
This endpoint works with the following fine-grained token types:
- GitHub App user access tokens
- GitHub App installation access tokens
- Fine-grained personal access tokens
The fine-grained token must have at least one of the following permission sets:
- "Projects" repository permissions (write)
- "Projects" organization permissions (admin)
Parameters for "Add project collaborator"
| Name, Type, Description | 
|---|
| acceptstringSetting to  | 
| Name, Type, Description | 
|---|
| project_idinteger RequiredThe unique identifier of the project. | 
| usernamestring RequiredThe handle for the GitHub user account. | 
| Name, Type, Description | 
|---|
| permissionstringThe permission to grant the collaborator. Default:  Can be one of:  | 
HTTP response status codes for "Add project collaborator"
| Status code | Description | 
|---|---|
| 204 | No Content | 
| 304 | Not modified | 
| 401 | Requires authentication | 
| 403 | Forbidden | 
| 404 | Resource not found | 
| 422 | Validation failed, or the endpoint has been spammed. | 
Code samples for "Add project collaborator"
Request example
curl -L \
  -X PUT \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  http(s)://HOSTNAME/api/v3/projects/PROJECT_ID/collaborators/USERNAME \
  -d '{"permission":"write"}'Response
Status: 204Remove user as a collaborator
Warning
Closing down notice: Projects (classic) is being deprecated in favor of the new Projects experience. See the changelog for more information.
Fine-grained access tokens for "Remove user as a collaborator"
This endpoint works with the following fine-grained token types:
- GitHub App user access tokens
- GitHub App installation access tokens
- Fine-grained personal access tokens
The fine-grained token must have at least one of the following permission sets:
- "Projects" repository permissions (write)
- "Projects" organization permissions (admin)
Parameters for "Remove user as a collaborator"
| Name, Type, Description | 
|---|
| acceptstringSetting to  | 
| Name, Type, Description | 
|---|
| project_idinteger RequiredThe unique identifier of the project. | 
| usernamestring RequiredThe handle for the GitHub user account. | 
HTTP response status codes for "Remove user as a collaborator"
| Status code | Description | 
|---|---|
| 204 | No Content | 
| 304 | Not modified | 
| 401 | Requires authentication | 
| 403 | Forbidden | 
| 404 | Resource not found | 
| 422 | Validation failed, or the endpoint has been spammed. | 
Code samples for "Remove user as a collaborator"
Request example
curl -L \
  -X DELETE \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  http(s)://HOSTNAME/api/v3/projects/PROJECT_ID/collaborators/USERNAMEResponse
Status: 204Get project permission for a user
Warning
Closing down notice: Projects (classic) is being deprecated in favor of the new Projects experience. See the changelog for more information.
Fine-grained access tokens for "Get project permission for a user"
This endpoint works with the following fine-grained token types:
- GitHub App user access tokens
- GitHub App installation access tokens
- Fine-grained personal access tokens
The fine-grained token must have at least one of the following permission sets:
- "Projects" repository permissions (write)
- "Projects" organization permissions (admin)
Parameters for "Get project permission for a user"
| Name, Type, Description | 
|---|
| acceptstringSetting to  | 
| Name, Type, Description | 
|---|
| project_idinteger RequiredThe unique identifier of the project. | 
| usernamestring RequiredThe handle for the GitHub user account. | 
HTTP response status codes for "Get project permission for a user"
| Status code | Description | 
|---|---|
| 200 | OK | 
| 304 | Not modified | 
| 401 | Requires authentication | 
| 403 | Forbidden | 
| 404 | Resource not found | 
| 422 | Validation failed, or the endpoint has been spammed. | 
Code samples for "Get project permission for a user"
Request example
curl -L \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  http(s)://HOSTNAME/api/v3/projects/PROJECT_ID/collaborators/USERNAME/permissionResponse
Status: 200{
  "permission": "admin",
  "user": {
    "login": "octocat",
    "id": 1,
    "node_id": "MDQ6VXNlcjE=",
    "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    "gravatar_id": "",
    "url": "https://HOSTNAME/users/octocat",
    "html_url": "https://github.com/octocat",
    "followers_url": "https://HOSTNAME/users/octocat/followers",
    "following_url": "https://HOSTNAME/users/octocat/following{/other_user}",
    "gists_url": "https://HOSTNAME/users/octocat/gists{/gist_id}",
    "starred_url": "https://HOSTNAME/users/octocat/starred{/owner}{/repo}",
    "subscriptions_url": "https://HOSTNAME/users/octocat/subscriptions",
    "organizations_url": "https://HOSTNAME/users/octocat/orgs",
    "repos_url": "https://HOSTNAME/users/octocat/repos",
    "events_url": "https://HOSTNAME/users/octocat/events{/privacy}",
    "received_events_url": "https://HOSTNAME/users/octocat/received_events",
    "type": "User",
    "site_admin": false
  }
}