← All tags

Copilot API Reference

Endpoints to manage Copilot using the REST API.

29 endpoints tagged copilot, each listing its parameters and possible responses. Search or scroll the index below to jump to a specific endpoint.

No endpoints match your search.

Get Copilot enterprise usage metrics for a specific day

GET /enterprises/{enterprise}/copilot/metrics/reports/enterprise-1-day

Use this endpoint to retrieve download links for the Copilot enterprise usage metrics report for a specific day. The report provides comprehensive usage data for Copilot features across the enterprise.

Parameters

NameInRequiredDescription
enterprisepathyesThe slug version of the enterprise name.
dayqueryyesThe day to request data for, in YYYY-MM-DD format.

Responses

StatusDescriptionHas JSON body
200Responseyes
500Internal Erroryes
403Forbiddenyes
404Resource not foundyes

Get Copilot enterprise usage metrics

GET /enterprises/{enterprise}/copilot/metrics/reports/enterprise-28-day/latest

Use this endpoint to retrieve download links for the latest 28-day enterprise Copilot usage metrics report. The report provides comprehensive usage data for Copilot features across the enterprise.

Parameters

NameInRequiredDescription
enterprisepathyesThe slug version of the enterprise name.

Responses

StatusDescriptionHas JSON body
200Responseyes
500Internal Erroryes
403Forbiddenyes
404Resource not foundyes

Get Copilot enterprise user-teams report for a specific day

GET /enterprises/{enterprise}/copilot/metrics/reports/user-teams-1-day

Use this endpoint to retrieve download links for the Copilot enterprise user-teams report for a specific day. The report provides user-team join data for Copilot across the enterprise, with one entry per user-team pair.

Parameters

NameInRequiredDescription
enterprisepathyesThe slug version of the enterprise name.
dayqueryyesThe day to request data for, in YYYY-MM-DD format.

Responses

StatusDescriptionHas JSON body
200Responseyes
500Internal Erroryes
403Forbiddenyes
404Resource not foundyes

Get Copilot users usage metrics for a specific day

GET /enterprises/{enterprise}/copilot/metrics/reports/users-1-day

Use this endpoint to retrieve download links for the Copilot user usage metrics report for a specific day. The report provides detailed user-level usage data and engagement metrics for Copilot features across the enterprise.

Parameters

NameInRequiredDescription
enterprisepathyesThe slug version of the enterprise name.
dayqueryyesThe day to request data for, in YYYY-MM-DD format.

Responses

StatusDescriptionHas JSON body
200Responseyes
500Internal Erroryes
403Forbiddenyes
404Resource not foundyes

Get Copilot users usage metrics

GET /enterprises/{enterprise}/copilot/metrics/reports/users-28-day/latest

Use this endpoint to retrieve download links for the latest 28-day enterprise users Copilot usage metrics report. The report provides detailed user-level usage data and engagement metrics for Copilot features across the enterprise.

Parameters

NameInRequiredDescription
enterprisepathyesThe slug version of the enterprise name.

Responses

StatusDescriptionHas JSON body
200Responseyes
500Internal Erroryes
403Forbiddenyes
404Resource not foundyes

Set the coding agent policy for an enterprise

PUT /enterprises/{enterprise}/copilot/policies/coding_agent

Sets the policy for Copilot cloud agent usage across an enterprise.

Parameters

NameInRequiredDescription
enterprisepathyesThe slug version of the enterprise name.

Responses

StatusDescriptionHas JSON body
204A header with no content is returned.no
400Bad Requestyes

Add organizations to the enterprise coding agent policy

POST /enterprises/{enterprise}/copilot/policies/coding_agent/organizations

Enables Copilot cloud agent for the specified organizations within the enterprise.

Parameters

NameInRequiredDescription
enterprisepathyesThe slug version of the enterprise name.

Responses

StatusDescriptionHas JSON body
204A header with no content is returned.no
400Bad Requestyes

Remove organizations from the enterprise coding agent policy

DELETE /enterprises/{enterprise}/copilot/policies/coding_agent/organizations

Disables Copilot cloud agent for the specified organizations within the enterprise.

Parameters

NameInRequiredDescription
enterprisepathyesThe slug version of the enterprise name.

Responses

StatusDescriptionHas JSON body
204A header with no content is returned.no
400Bad Requestyes

Get Copilot seat information and settings for an organization

GET /orgs/{org}/copilot/billing

Gets information about an organization's Copilot subscription, including seat breakdown

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.

Responses

StatusDescriptionHas JSON body
200OKyes
500Internal Erroryes
401Requires authenticationyes
403Forbiddenyes
404Resource not foundyes
422There is a problem with your account's associated payment method.no

List all Copilot seat assignments for an organization

GET /orgs/{org}/copilot/billing/seats

Lists all Copilot seats for which an organization with a Copilot Business or Copilot Enterprise subscription is currently being billed.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
pagequerynoThe page number of the results to fetch. For more information, see "Using pagination in the REST API."
per_pagequerynoThe number of results per page (max 100). For more information, see "Using pagination in the REST API."

Responses

StatusDescriptionHas JSON body
200Responseyes
500Internal Erroryes
401Requires authenticationyes
403Forbiddenyes
404Resource not foundyes

Add teams to the Copilot subscription for an organization

POST /orgs/{org}/copilot/billing/selected_teams

Purchases a GitHub Copilot seat for all users within each specified team.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.

Responses

StatusDescriptionHas JSON body
201OKyes
500Internal Erroryes
401Requires authenticationyes
403Forbiddenyes
404Resource not foundyes
422Copilot Business or Enterprise is not enabled for this organization, billing has not been set up for this organization, a public code suggestions policy has not been set for this organization, or the organization's Copilot access setting is set to enable Copilot for all users or is unconfigured.no

Remove teams from the Copilot subscription for an organization

DELETE /orgs/{org}/copilot/billing/selected_teams

Sets seats for all members of each team specified to "pending cancellation".

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.

Responses

StatusDescriptionHas JSON body
200OKyes
500Internal Erroryes
401Requires authenticationyes
403Forbiddenyes
404Resource not foundyes
422Copilot Business or Enterprise is not enabled for this organization, billing has not been set up for this organization, a public code suggestions policy has not been set for this organization, or the organization's Copilot access setting is set to enable Copilot for all users or is unconfigured.no

Add users to the Copilot subscription for an organization

POST /orgs/{org}/copilot/billing/selected_users

Purchases a GitHub Copilot seat for each user specified.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.

Responses

StatusDescriptionHas JSON body
201OKyes
500Internal Erroryes
401Requires authenticationyes
403Forbiddenyes
404Resource not foundyes
422Copilot Business or Enterprise is not enabled for this organization, billing has not been set up for this organization, a public code suggestions policy has not been set for this organization, or the organization's Copilot access setting is set to enable Copilot for all users or is unconfigured.no

Remove users from the Copilot subscription for an organization

DELETE /orgs/{org}/copilot/billing/selected_users

Sets seats for all users specified to "pending cancellation".

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.

Responses

StatusDescriptionHas JSON body
200OKyes
500Internal Erroryes
401Requires authenticationyes
403Forbiddenyes
404Resource not foundyes
422Copilot Business or Enterprise is not enabled for this organization, billing has not been set up for this organization, a public code suggestions policy has not been set for this organization, the seat management setting is set to enable Copilot for all users or is unconfigured, or a user's seat cannot be cancelled because it was assigned to them via a team.no

Get Copilot cloud agent permissions for an organization

GET /orgs/{org}/copilot/coding-agent/permissions

Gets information about which repositories in an organization have been enabled

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.

Responses

StatusDescriptionHas JSON body
200Responseyes
500Internal Erroryes
401Requires authenticationyes
403Forbiddenyes
404Resource not foundyes

Set Copilot cloud agent permissions for an organization

PUT /orgs/{org}/copilot/coding-agent/permissions

Sets the policy for which repositories in an organization can use Copilot cloud agent.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.

Responses

StatusDescriptionHas JSON body
204No Contentno
500Internal Erroryes
401Requires authenticationyes
403Forbiddenyes
404Resource not foundyes
422Validation failed, or the endpoint has been spammed.yes

List repositories enabled for Copilot cloud agent in an organization

GET /orgs/{org}/copilot/coding-agent/permissions/repositories

Lists the selected repositories that are enabled for Copilot cloud agent in an organization.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
per_pagequerynoThe number of results per page (max 100). For more information, see "Using pagination in the REST API."
pagequerynoThe page number of the results to fetch. For more information, see "Using pagination in the REST API."

Responses

StatusDescriptionHas JSON body
200Responseyes
500Internal Erroryes
401Requires authenticationyes
403Forbiddenyes
404Resource not foundyes
409Conflictyes

Set selected repositories for Copilot cloud agent in an organization

PUT /orgs/{org}/copilot/coding-agent/permissions/repositories

Replaces the list of selected repositories that are enabled for Copilot cloud

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.

Responses

StatusDescriptionHas JSON body
204No Contentno
500Internal Erroryes
401Requires authenticationyes
403Forbiddenyes
404Resource not foundyes
409Conflictyes
422Validation failed, or the endpoint has been spammed.yes

Enable a repository for Copilot cloud agent in an organization

PUT /orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}

Adds a repository to the list of selected repositories enabled for Copilot

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
repository_idpathyesThe unique identifier of the repository.

Responses

StatusDescriptionHas JSON body
204No Contentno
500Internal Erroryes
401Requires authenticationyes
403Forbiddenyes
404Resource not foundyes
409Conflictyes
422Validation failed, or the endpoint has been spammed.yes

Disable a repository for Copilot cloud agent in an organization

DELETE /orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}

Removes a repository from the list of selected repositories enabled for Copilot

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
repository_idpathyesThe unique identifier of the repository.

Responses

StatusDescriptionHas JSON body
204No Contentno
500Internal Erroryes
401Requires authenticationyes
403Forbiddenyes
404Resource not foundyes
409Conflictyes

Get Copilot content exclusion rules for an organization

GET /orgs/{org}/copilot/content_exclusion

Gets information about an organization's Copilot content exclusion path rules.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.

Responses

StatusDescriptionHas JSON body
200OKyes
500Internal Erroryes
401Requires authenticationyes
403Forbiddenyes
404Resource not foundyes

Set Copilot content exclusion rules for an organization

PUT /orgs/{org}/copilot/content_exclusion

Sets Copilot content exclusion path rules for an organization.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.

Responses

StatusDescriptionHas JSON body
200Successyes
500Internal Erroryes
401Requires authenticationyes
403Forbiddenyes
404Resource not foundyes
413Payload Too Largeyes
422Validation failed, or the endpoint has been spammed.yes

Get Copilot organization usage metrics for a specific day

GET /orgs/{org}/copilot/metrics/reports/organization-1-day

Use this endpoint to retrieve download links for the Copilot organization usage metrics report for a specific day. The report provides comprehensive usage data for Copilot features across the organization.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
dayqueryyesThe day to request data for, in YYYY-MM-DD format.

Responses

StatusDescriptionHas JSON body
200Responseyes
204A header with no content is returned.no
500Internal Erroryes
403Forbiddenyes
404Resource not foundyes

Get Copilot organization usage metrics

GET /orgs/{org}/copilot/metrics/reports/organization-28-day/latest

Use this endpoint to retrieve download links for the latest 28-day organization Copilot usage metrics report. The report provides comprehensive usage data for Copilot features across the organization.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.

Responses

StatusDescriptionHas JSON body
200Responseyes
500Internal Erroryes
403Forbiddenyes
404Resource not foundyes

Get Copilot organization user-teams report for a specific day

GET /orgs/{org}/copilot/metrics/reports/user-teams-1-day

Use this endpoint to retrieve download links for the Copilot organization user-teams report for a specific day. The report provides user-team join data for Copilot across the organization, with one entry per user-team pair.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
dayqueryyesThe day to request data for, in YYYY-MM-DD format.

Responses

StatusDescriptionHas JSON body
200Responseyes
204A header with no content is returned.no
500Internal Erroryes
403Forbiddenyes
404Resource not foundyes

Get Copilot organization users usage metrics for a specific day

GET /orgs/{org}/copilot/metrics/reports/users-1-day

Use this endpoint to retrieve download links for the Copilot organization user usage metrics report for a specific day. The report provides detailed user-level usage data and engagement metrics for Copilot features across the organization.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
dayqueryyesThe day to request data for, in YYYY-MM-DD format.

Responses

StatusDescriptionHas JSON body
200Responseyes
204A header with no content is returned.no
500Internal Erroryes
403Forbiddenyes
404Resource not foundyes

Get Copilot organization users usage metrics

GET /orgs/{org}/copilot/metrics/reports/users-28-day/latest

Use this endpoint to retrieve download links for the latest 28-day organization users Copilot usage metrics report. The report provides detailed user-level usage data and engagement metrics for Copilot features across the organization.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.

Responses

StatusDescriptionHas JSON body
200Responseyes
500Internal Erroryes
403Forbiddenyes
404Resource not foundyes

Get Copilot seat assignment details for a user

GET /orgs/{org}/members/{username}/copilot

Gets the GitHub Copilot seat details for a member of an organization who currently has access to GitHub Copilot.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
usernamepathyesThe handle for the GitHub user account.

Responses

StatusDescriptionHas JSON body
200The user's GitHub Copilot seat details, including usage.yes
500Internal Erroryes
401Requires authenticationyes
403Forbiddenyes
404Resource not foundyes
422Copilot Business or Enterprise is not enabled for this organization or the user has a pending organization invitation.no

Get Copilot cloud agent configuration for a repository

GET /repos/{owner}/{repo}/copilot/cloud-agent/configuration

Gets the Copilot cloud agent configuration for a repository, including MCP server

Parameters

NameInRequiredDescription
ownerpathyesThe account owner of the repository. The name is not case sensitive.
repopathyesThe name of the repository without the .git extension. The name is not case sensitive.

Responses

StatusDescriptionHas JSON body
200Responseyes
500Internal Erroryes
401Requires authenticationyes
403Forbiddenyes
404Resource not foundyes