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.
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.
accept (string)application/vnd.github+json is recommended.enterprise (string) (required)policy_state (string) (required)enabled_for_all_orgs, disabled_for_all_orgs, enabled_for_selected_orgs, configured_by_org_admins204 - A header with no content is returned.
400 - Bad Request
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):
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.
accept (string)application/vnd.github+json is recommended.enterprise (string) (required)organizations (array of strings)
List of organization logins within the enterprise to enable Copilot cloud agent for.
custom_properties (array of objects)
List of custom property filters to match organizations. Organizations matching any of the specified property name/value pairs will be included. This is a one-time operation, setting the property on an organization in the future will not automatically update its coding agent policy.
property_name (string) (required)values (array of strings) (required)204 - A header with no content is returned.
400 - Bad Request
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):
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.
accept (string)application/vnd.github+json is recommended.enterprise (string) (required)organizations (array of strings)
List of organization logins within the enterprise to disable Copilot cloud agent for.
custom_properties (array of objects)
List of custom property filters to match organizations. Organizations matching any of the specified property name/value pairs will be included. This is a one-time operation, setting the property on an organization in the future will not automatically update its coding agent policy.
property_name (string) (required)values (array of strings) (required)204 - A header with no content is returned.
400 - Bad Request
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 /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.
accept (string)application/vnd.github+json is recommended.org (string) (required)200 - OK
401 - Requires authentication
403 - Forbidden
404 - Resource not found
500 - Internal Error
Request:
curl -L \
-X GET \
https://api.github.com/orgs/ORG/copilot/coding-agent/permissions
Response schema (Status: 200):
enabled_repositories: required, string, enum: all, selected, noneselected_repositories_url: stringRequest:
curl -L \
-X GET \
https://api.github.com/orgs/ORG/copilot/coding-agent/permissions
Response schema (Status: 200):
enabled_repositories: required, string, enum: all, selected, noneselected_repositories_url: stringRequest:
curl -L \
-X GET \
https://api.github.com/orgs/ORG/copilot/coding-agent/permissions
Response schema (Status: 200):
enabled_repositories: required, string, enum: all, selected, noneselected_repositories_url: stringPUT /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.
accept (string)application/vnd.github+json is recommended.org (string) (required)enabled_repositories (string) (required)all, selected, none204 - No Content
401 - Requires authentication
403 - Forbidden
404 - Resource not found
422 - Validation failed, or the endpoint has been spammed.
500 - Internal Error
Request:
curl -L \
-X PUT \
https://api.github.com/orgs/ORG/copilot/coding-agent/permissions \
-d '{
"enabled_repositories": "selected"
}'
Response schema (Status: 204):
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.
accept (string)application/vnd.github+json is recommended.org (string) (required)
The organization name. The name is not case sensitive.
per_page (integer)
The number of results per page (max 100). For more information, see "Using pagination in the REST API."
Default: 30
page (integer)
The page number of the results to fetch. For more information, see "Using pagination in the REST API."
Default: 1
200 - OK
401 - Requires authentication
403 - Forbidden
404 - Resource not found
409 - Conflict
500 - Internal Error
Request:
curl -L \
-X GET \
https://api.github.com/orgs/ORG/copilot/coding-agent/permissions/repositories
Response schema (Status: 200):
total_count: required, integerrepositories: required, array of Minimal Repository:
id: required, integer, format: int64node_id: required, stringname: required, stringfull_name: required, stringowner: required, Simple User:
name: string or nullemail: string or nulllogin: required, stringid: required, integer, format: int64node_id: required, stringavatar_url: required, string, format: urigravatar_id: required, string or nullurl: required, string, format: urihtml_url: required, string, format: urifollowers_url: required, string, format: urifollowing_url: required, stringgists_url: required, stringstarred_url: required, stringsubscriptions_url: required, string, format: uriorganizations_url: required, string, format: urirepos_url: required, string, format: urievents_url: required, stringreceived_events_url: required, string, format: uritype: required, stringsite_admin: required, booleanstarred_at: stringuser_view_type: stringprivate: required, booleanhtml_url: required, string, format: uridescription: required, string or nullfork: required, booleanurl: required, string, format: uriarchive_url: required, stringassignees_url: required, stringblobs_url: required, stringbranches_url: required, stringcollaborators_url: required, stringcomments_url: required, stringcommits_url: required, stringcompare_url: required, stringcontents_url: required, stringcontributors_url: required, string, format: urideployments_url: required, string, format: uridownloads_url: required, string, format: urievents_url: required, string, format: uriforks_url: required, string, format: urigit_commits_url: required, stringgit_refs_url: required, stringgit_tags_url: required, stringgit_url: stringissue_comment_url: required, stringissue_events_url: required, stringissues_url: required, stringkeys_url: required, stringlabels_url: required, stringlanguages_url: required, string, format: urimerges_url: required, string, format: urimilestones_url: required, stringnotifications_url: required, stringpulls_url: required, stringreleases_url: required, stringssh_url: stringstargazers_url: required, string, format: uristatuses_url: required, stringsubscribers_url: required, string, format: urisubscription_url: required, string, format: uritags_url: required, string, format: uriteams_url: required, string, format: uritrees_url: required, stringclone_url: stringmirror_url: string or nullhooks_url: required, string, format: urisvn_url: stringhomepage: string or nulllanguage: string or nullforks_count: integerstargazers_count: integerwatchers_count: integersize: integerdefault_branch: stringopen_issues_count: integeris_template: booleantopics: array of stringhas_issues: booleanhas_projects: booleanhas_wiki: booleanhas_pages: booleanhas_discussions: booleanhas_pull_requests: booleanpull_request_creation_policy: string, enum: all, collaborators_onlyarchived: booleandisabled: booleanvisibility: stringpushed_at: string or null, format: date-timecreated_at: string or null, format: date-timeupdated_at: string or null, format: date-timepermissions: object:
admin: booleanmaintain: booleanpush: booleantriage: booleanpull: booleanrole_name: stringtemp_clone_token: stringdelete_branch_on_merge: booleansubscribers_count: integernetwork_count: integercode_of_conduct: Code Of Conduct:
key: required, stringname: required, stringurl: required, string, format: uribody: stringhtml_url: required, string or null, format: urilicense: object or null:
key: stringname: stringspdx_id: stringurl: string or nullnode_id: stringforks: integeropen_issues: integerwatchers: integerallow_forking: booleanweb_commit_signoff_required: booleansecurity_and_analysis: object or null:
advanced_security: object:
status: string, enum: enabled, disabledcode_security: object:
status: string, enum: enabled, disableddependabot_security_updates: object:
status: string, enum: enabled, disabledsecret_scanning: object:
status: string, enum: enabled, disabledsecret_scanning_push_protection: object:
status: string, enum: enabled, disabledsecret_scanning_non_provider_patterns: object:
status: string, enum: enabled, disabledsecret_scanning_ai_detection: object:
status: string, enum: enabled, disabledsecret_scanning_delegated_alert_dismissal: object:
status: string, enum: enabled, disabledsecret_scanning_delegated_bypass: object:
status: string, enum: enabled, disabledsecret_scanning_delegated_bypass_options: object:
reviewers: array of objects:
reviewer_id: required, integerreviewer_type: required, string, enum: TEAM, ROLEmode: string, enum: ALWAYS, EXEMPT, default: "ALWAYS"custom_properties: object, additional properties allowedPUT /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.
accept (string)application/vnd.github+json is recommended.org (string) (required)selected_repository_ids (array of integers) (required)204 - No Content
401 - Requires authentication
403 - Forbidden
404 - Resource not found
409 - Conflict
422 - Validation failed, or the endpoint has been spammed.
500 - Internal Error
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):
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.
accept (string)application/vnd.github+json is recommended.org (string) (required)
The organization name. The name is not case sensitive.
repository_id (integer) (required)
The unique identifier of the repository.
204 - No Content
401 - Requires authentication
403 - Forbidden
404 - Resource not found
409 - Conflict
422 - Validation failed, or the endpoint has been spammed.
500 - Internal Error
Request:
curl -L \
-X PUT \
https://api.github.com/orgs/ORG/copilot/coding-agent/permissions/repositories/REPOSITORY_ID
Response schema (Status: 204):
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.
accept (string)application/vnd.github+json is recommended.org (string) (required)
The organization name. The name is not case sensitive.
repository_id (integer) (required)
The unique identifier of the repository.
204 - No Content
401 - Requires authentication
403 - Forbidden
404 - Resource not found
409 - Conflict
500 - Internal Error
Request:
curl -L \
-X DELETE \
https://api.github.com/orgs/ORG/copilot/coding-agent/permissions/repositories/REPOSITORY_ID
Response schema (Status: 204):