REST API endpoints for Copilot cloud agent management

Use the REST API to manage settings for Copilot cloud agent.

Note

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.

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.
Enterprise owners can configure whether Copilot cloud agent is enabled for all
organizations, disabled for all organizations, configured by individual organization
admins, or enabled for selected organizations only.
Only enterprise owners can set the coding agent policy for their enterprise.
OAuth app tokens and personal access tokens (classic) need either the manage_billing:copilot or admin:enterprise scopes to use this endpoint.

Parameters

Headers

Path and query parameters

Body parameters

HTTP response status codes

Code examples

Enable coding agent for all organizations

Request:

curl -L \
  -X PUT \
  https://api.github.com/enterprises/ENTERPRISE/copilot/policies/coding_agent \
  -d '{
  "policy_state": "enabled_for_all_orgs"
}'

Response schema (Status: 204):

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.
The enterprise's coding agent policy must be set to enabled_for_selected_orgs before
using this endpoint. Organizations can be specified by login or matched via custom properties.
Only organizations that have Copilot enabled and belong to the enterprise will be affected.
Only enterprise owners can add organizations to the coding agent policy.
OAuth app tokens and personal access tokens (classic) need either the manage_billing:copilot or admin:enterprise scopes to use this endpoint.

Parameters

Headers

Path and query parameters

Body parameters

HTTP response status codes

Code examples

Add organizations that match a login or have a custom property

Request:

curl -L \
  -X POST \
  https://api.github.com/enterprises/ENTERPRISE/copilot/policies/coding_agent/organizations \
  -d '{
  "organizations": [
    "my-org-1",
    "my-org-2"
  ],
  "custom_properties": [
    {
      "property_name": "department",
      "values": [
        "engineering",
        "security"
      ]
    }
  ]
}'

Response schema (Status: 204):

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.
The enterprise's coding agent policy must be set to enabled_for_selected_orgs before
using this endpoint. Organizations can be specified by login or matched via custom properties.
Only organizations that have Copilot enabled and belong to the enterprise will be affected.
Only enterprise owners can remove organizations from the coding agent policy.
OAuth app tokens and personal access tokens (classic) need either the manage_billing:copilot or admin:enterprise scopes to use this endpoint.

Parameters

Headers

Path and query parameters

Body parameters

HTTP response status codes

Code examples

Remove organizations that match a login or have a custom property

Request:

curl -L \
  -X DELETE \
  https://api.github.com/enterprises/ENTERPRISE/copilot/policies/coding_agent/organizations \
  -d '{
  "organizations": [
    "my-org-1",
    "my-org-2"
  ],
  "custom_properties": [
    {
      "property_name": "department",
      "values": [
        "engineering",
        "security"
      ]
    }
  ]
}'

Response schema (Status: 204):

Get Copilot cloud agent permissions for an organization

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

Note

This endpoint is in public preview and is subject to change.

Gets information about which repositories in an organization have been enabled
or disabled for the Copilot cloud agent.
Organization owners can configure whether Copilot cloud agent is enabled for
all repositories, selected repositories, or no repositories owned by organization.
OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example 1: Status Code 200

Request:

curl -L \
  -X GET \
  https://api.github.com/orgs/ORG/copilot/coding-agent/permissions

Response schema (Status: 200):

Example 2: Status Code 200

Request:

curl -L \
  -X GET \
  https://api.github.com/orgs/ORG/copilot/coding-agent/permissions

Response schema (Status: 200):

Example 3: Status Code 200

Request:

curl -L \
  -X GET \
  https://api.github.com/orgs/ORG/copilot/coding-agent/permissions

Response schema (Status: 200):

Set Copilot cloud agent permissions for an organization

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

Note

This endpoint is in public preview and is subject to change.

Sets the policy for which repositories in an organization can use Copilot cloud agent.
Organization owners can configure whether Copilot cloud agent is enabled for
all repositories, selected repositories, or no repositories owned by the organization.
OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

Parameters

Headers

Path and query parameters

Body parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X PUT \
  https://api.github.com/orgs/ORG/copilot/coding-agent/permissions \
  -d '{
  "enabled_repositories": "selected"
}'

Response schema (Status: 204):

List repositories enabled for Copilot cloud agent in an organization

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

Note

This endpoint is in public preview and is subject to change.

Lists the selected repositories that are enabled for Copilot cloud agent in an organization.
Organization owners can use this endpoint when the coding agent repository policy
is set to selected to see which repositories have been enabled.
OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/orgs/ORG/copilot/coding-agent/permissions/repositories

Response schema (Status: 200):

Set selected repositories for Copilot cloud agent in an organization

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

Note

This endpoint is in public preview and is subject to change.

Replaces the list of selected repositories that are enabled for Copilot cloud
agent in an organization. This method can only be called when the cloud agent
repository policy is set to selected.
OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

Parameters

Headers

Path and query parameters

Body parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X PUT \
  https://api.github.com/orgs/ORG/copilot/coding-agent/permissions/repositories \
  -d '{
  "selected_repository_ids": [
    32,
    42
  ]
}'

Response schema (Status: 204):

Enable a repository for Copilot cloud agent in an organization

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

Note

This endpoint is in public preview and is subject to change.

Adds a repository to the list of selected repositories enabled for Copilot
cloud agent in an organization. This method can only be called when the
cloud agent repository policy is set to selected.
OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X PUT \
  https://api.github.com/orgs/ORG/copilot/coding-agent/permissions/repositories/REPOSITORY_ID

Response schema (Status: 204):

Disable a repository for Copilot cloud agent in an organization

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

Note

This endpoint is in public preview and is subject to change.

Removes a repository from the list of selected repositories enabled for Copilot
cloud agent in an organization. This method can only be called when the
cloud agent repository policy is set to selected.
OAuth app tokens and personal access tokens (classic) need the admin:org scopes to use this endpoint.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X DELETE \
  https://api.github.com/orgs/ORG/copilot/coding-agent/permissions/repositories/REPOSITORY_ID

Response schema (Status: 204):