Skip to main content
Skip to content

REST API endpoints for Copilot code review

Use the REST API to manage Copilot code review.

Get the Copilot code review policy for an enterprise

Gets the configured Copilot code review policy for an enterprise. This does not return a user's effective access, preview approval controls, or automatic-review rulesets.

Enterprise owners and users with the read_enterprise_ai_controls permission can use this endpoint. OAuth app tokens and personal access tokens (classic) need the read:enterprise scope. GitHub App tokens and fine-grained personal access tokens are not supported.

Jetons d'accès granulaires pour «Get the Copilot code review policy for an enterprise»

Ce point de terminaison ne fonctionne pas avec des jetons d’accès utilisateur de l'application GitHub, les jetons d’accès d’installation de l'application GitHub, ou des jetons d’accès personnels affinés.

Paramètres pour «Get the Copilot code review policy for an enterprise »

En-têtes
Nom, Type, Description
accept string

Setting to application/vnd.github+json is recommended.

Paramètres de chemin d’accès
Nom, Type, Description
enterprise string Requis

The slug version of the enterprise name.

Codes d’état de réponse HTTP pour «Get the Copilot code review policy for an enterprise »

Code de statutDescription
200

The configured enterprise policy.

401

Requires authentication

403

Forbidden

404

Resource not found

Exemples de code pour «Get the Copilot code review policy for an enterprise »

Si vous accédez à GitHub à GHE.com, remplacez api.github.com par le sous-domaine dédié de votre entreprise à api.SUBDOMAIN.ghe.com.

Exemple de requête

get/enterprises/{enterprise}/copilot/policies/code-review
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ https://api.github.com/enterprises/ENTERPRISE/copilot/policies/code-review

The configured enterprise policy.

Status: 200
{ "policy_state": "enabled_for_all_organizations" }

Set the Copilot code review policy for an enterprise

Sets the configured Copilot code review policy for an enterprise, using the same asynchronous propagation and notifications as enterprise settings. Policies that depend on Copilot code review keep their values.

Enterprise owners and users with the write_enterprise_ai_controls permission can use this endpoint. OAuth app tokens and personal access tokens (classic) need the admin:enterprise scope. GitHub App tokens and fine-grained personal access tokens are not supported.

Standalone enterprises support enabled and disabled policies, but cannot delegate policy to organization administrators. Invalid or unsupported input does not change any policy.

Jetons d'accès granulaires pour «Set the Copilot code review policy for an enterprise»

Ce point de terminaison ne fonctionne pas avec des jetons d’accès utilisateur de l'application GitHub, les jetons d’accès d’installation de l'application GitHub, ou des jetons d’accès personnels affinés.

Paramètres pour «Set the Copilot code review policy for an enterprise »

En-têtes
Nom, Type, Description
accept string

Setting to application/vnd.github+json is recommended.

Paramètres de chemin d’accès
Nom, Type, Description
enterprise string Requis

The slug version of the enterprise name.

Paramètres du corps
Nom, Type, Description
policy_state string Requis

The enterprise's Copilot code review policy.

Peut être l'un des: enabled_for_all_organizations, disabled_for_all_organizations, configured_by_organization_admins

Codes d’état de réponse HTTP pour «Set the Copilot code review policy for an enterprise »

Code de statutDescription
204

A header with no content is returned.

400

Bad Request

401

Requires authentication

403

Forbidden

404

Resource not found

422

Validation failed, or the endpoint has been spammed.

Exemples de code pour «Set the Copilot code review policy for an enterprise »

Si vous accédez à GitHub à GHE.com, remplacez api.github.com par le sous-domaine dédié de votre entreprise à api.SUBDOMAIN.ghe.com.

Exemple de requête

put/enterprises/{enterprise}/copilot/policies/code-review
curl -L \ -X PUT \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ https://api.github.com/enterprises/ENTERPRISE/copilot/policies/code-review \ -d '{"policy_state":"enabled_for_all_organizations"}'

A header with no content is returned.

Status: 204

Get the Copilot code review runner configuration for an organization

Gets the runner configuration that Copilot code review uses for an organization. Until the organization saves a Copilot code review runner configuration, the response reports the values inherited from the organization's Copilot coding agent runner configuration, with configured_by set to coding_agent.

Organization owners can use this endpoint. OAuth app tokens and personal access tokens (classic) need either the manage_billing:copilot or read:org scope. GitHub App tokens and fine-grained personal access tokens are not supported.

Jetons d'accès granulaires pour «Get the Copilot code review runner configuration for an organization»

Ce point de terminaison ne fonctionne pas avec des jetons d’accès utilisateur de l'application GitHub, les jetons d’accès d’installation de l'application GitHub, ou des jetons d’accès personnels affinés.

Paramètres pour «Get the Copilot code review runner configuration for an organization »

En-têtes
Nom, Type, Description
accept string

Setting to application/vnd.github+json is recommended.

Paramètres de chemin d’accès
Nom, Type, Description
org string Requis

The organization name. The name is not case sensitive.

Codes d’état de réponse HTTP pour «Get the Copilot code review runner configuration for an organization »

Code de statutDescription
200

The organization runner configuration.

401

Requires authentication

403

Forbidden

404

Resource not found

503

Service unavailable

Exemples de code pour «Get the Copilot code review runner configuration for an organization »

Si vous accédez à GitHub à GHE.com, remplacez api.github.com par le sous-domaine dédié de votre entreprise à api.SUBDOMAIN.ghe.com.

Exemple de requête

get/orgs/{org}/copilot/code-review/runner
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ https://api.github.com/orgs/ORG/copilot/code-review/runner

The organization runner configuration.

Status: 200
{ "runner_type": "standard", "runner_labels": [], "runner_group_name": null, "allow_repository_customization": true, "configured_by": "coding_agent" }

Set the Copilot code review runner configuration for an organization

Sets the runner configuration that Copilot code review uses for an organization. After a successful update, Copilot code review uses its own runner configuration and configured_by is code_review.

A labeled runner requires at least one label in runner_labels or a runner_group_name. A standard runner does not accept labels or a runner group. When allow_repository_customization is omitted, the current effective value is kept. The whole request is validated before any change is made, so invalid input does not change the configuration.

Organization owners can use this endpoint. OAuth app tokens and personal access tokens (classic) need either the manage_billing:copilot or admin:org scope. GitHub App tokens and fine-grained personal access tokens are not supported.

Jetons d'accès granulaires pour «Set the Copilot code review runner configuration for an organization»

Ce point de terminaison ne fonctionne pas avec des jetons d’accès utilisateur de l'application GitHub, les jetons d’accès d’installation de l'application GitHub, ou des jetons d’accès personnels affinés.

Paramètres pour «Set the Copilot code review runner configuration for an organization »

En-têtes
Nom, Type, Description
accept string

Setting to application/vnd.github+json is recommended.

Paramètres de chemin d’accès
Nom, Type, Description
org string Requis

The organization name. The name is not case sensitive.

Paramètres du corps
Nom, Type, Description
runner_type string Requis

The type of runner. standard uses GitHub-hosted runners. labeled uses runners that match the labels or runner group.

Peut être l'un des: standard, labeled

runner_labels array of strings or null

The runner labels for a labeled runner.

runner_group_name string or null

The runner group for a labeled runner.

allow_repository_customization boolean

Whether repositories can use their own runner configuration.

Codes d’état de réponse HTTP pour «Set the Copilot code review runner configuration for an organization »

Code de statutDescription
200

The updated organization runner configuration.

400

Bad Request

401

Requires authentication

403

Forbidden

404

Resource not found

422

Validation failed, or the endpoint has been spammed.

503

Service unavailable

Exemples de code pour «Set the Copilot code review runner configuration for an organization »

Si vous accédez à GitHub à GHE.com, remplacez api.github.com par le sous-domaine dédié de votre entreprise à api.SUBDOMAIN.ghe.com.

Exemple de requête

put/orgs/{org}/copilot/code-review/runner
curl -L \ -X PUT \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ https://api.github.com/orgs/ORG/copilot/code-review/runner \ -d '{"runner_type":"labeled","runner_labels":["copilot-review"],"runner_group_name":"copilot-runners","allow_repository_customization":false}'

The updated organization runner configuration.

Status: 200
{ "runner_type": "labeled", "runner_labels": [ "copilot-review" ], "runner_group_name": "copilot-runners", "allow_repository_customization": false, "configured_by": "code_review" }

Get Copilot code review settings for an organization

Gets the Copilot code review settings for an organization. Currently this is the default review effort that repositories in the organization use when they do not choose their own. For each setting, the response includes the configured value, the effective value, the default inherited when nothing is configured, whether organization administrators can edit it, and whether the enterprise or the organization manages it.

Organization owners can use this endpoint. OAuth app tokens and personal access tokens (classic) need either the manage_billing:copilot or read:org scope. GitHub App tokens and fine-grained personal access tokens are not supported.

Jetons d'accès granulaires pour «Get Copilot code review settings for an organization»

Ce point de terminaison ne fonctionne pas avec des jetons d’accès utilisateur de l'application GitHub, les jetons d’accès d’installation de l'application GitHub, ou des jetons d’accès personnels affinés.

Paramètres pour «Get Copilot code review settings for an organization »

En-têtes
Nom, Type, Description
accept string

Setting to application/vnd.github+json is recommended.

Paramètres de chemin d’accès
Nom, Type, Description
org string Requis

The organization name. The name is not case sensitive.

Codes d’état de réponse HTTP pour «Get Copilot code review settings for an organization »

Code de statutDescription
200

The organization settings.

401

Requires authentication

403

Forbidden

404

Resource not found

503

Service unavailable

Exemples de code pour «Get Copilot code review settings for an organization »

Si vous accédez à GitHub à GHE.com, remplacez api.github.com par le sous-domaine dédié de votre entreprise à api.SUBDOMAIN.ghe.com.

Exemple de requête

get/orgs/{org}/copilot/code-review/settings
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ https://api.github.com/orgs/ORG/copilot/code-review/settings

The organization settings.

Status: 200
{ "default_review_effort": { "configured": null, "effective": "balanced", "github_default": "balanced", "editable": true, "managed_by": "organization" }, "available_review_efforts": [ "lite", "balanced" ] }

Update Copilot code review settings for an organization

Updates the Copilot code review settings for an organization. Omitted settings are not changed. Set default_review_effort to inherit to clear the organization's value so repositories use the inherited default again. Changes use the same audit logging and telemetry as organization settings.

Organization owners can use this endpoint. OAuth app tokens and personal access tokens (classic) need either the manage_billing:copilot or admin:org scope. GitHub App tokens and fine-grained personal access tokens are not supported.

When a submitted setting cannot be changed by the organization, the request fails with 409 and the code SETTING_NOT_EDITABLE. The whole request is validated before any change is made, so invalid input and conflicts do not change any setting.

Jetons d'accès granulaires pour «Update Copilot code review settings for an organization»

Ce point de terminaison ne fonctionne pas avec des jetons d’accès utilisateur de l'application GitHub, les jetons d’accès d’installation de l'application GitHub, ou des jetons d’accès personnels affinés.

Paramètres pour «Update Copilot code review settings for an organization »

En-têtes
Nom, Type, Description
accept string

Setting to application/vnd.github+json is recommended.

Paramètres de chemin d’accès
Nom, Type, Description
org string Requis

The organization name. The name is not case sensitive.

Paramètres du corps
Nom, Type, Description
default_review_effort string

The default review effort for repositories that do not choose their own. Use inherit to clear the organization's value. Only efforts listed in the settings' available_review_efforts are accepted, and a rejected effort's error message lists them. For more information, see Review effort level.

Codes d’état de réponse HTTP pour «Update Copilot code review settings for an organization »

Code de statutDescription
200

The updated organization settings.

400

Bad Request

401

Requires authentication

403

Forbidden

404

Resource not found

409

The organization cannot change a submitted setting.

422

Validation failed, or the endpoint has been spammed.

503

Service unavailable

Exemples de code pour «Update Copilot code review settings for an organization »

Si vous accédez à GitHub à GHE.com, remplacez api.github.com par le sous-domaine dédié de votre entreprise à api.SUBDOMAIN.ghe.com.

Exemple de requête

patch/orgs/{org}/copilot/code-review/settings
curl -L \ -X PATCH \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ https://api.github.com/orgs/ORG/copilot/code-review/settings \ -d '{"default_review_effort":"balanced"}'

The updated organization settings.

Status: 200
{ "default_review_effort": { "configured": "balanced", "effective": "balanced", "github_default": "balanced", "editable": true, "managed_by": "organization" }, "available_review_efforts": [ "lite", "balanced" ] }

Get the Copilot code review policy for an organization

Gets the configured and effective Copilot code review policy for an organization, whether organization administrators can edit it, and whether the enterprise or the organization manages it. This does not return review effort, repository settings, preview approval controls, or automatic-review rulesets.

Organization owners can use this endpoint. OAuth app tokens and personal access tokens (classic) need either the manage_billing:copilot or read:org scope. GitHub App tokens and fine-grained personal access tokens are not supported.

Jetons d'accès granulaires pour «Get the Copilot code review policy for an organization»

Ce point de terminaison ne fonctionne pas avec des jetons d’accès utilisateur de l'application GitHub, les jetons d’accès d’installation de l'application GitHub, ou des jetons d’accès personnels affinés.

Paramètres pour «Get the Copilot code review policy for an organization »

En-têtes
Nom, Type, Description
accept string

Setting to application/vnd.github+json is recommended.

Paramètres de chemin d’accès
Nom, Type, Description
org string Requis

The organization name. The name is not case sensitive.

Codes d’état de réponse HTTP pour «Get the Copilot code review policy for an organization »

Code de statutDescription
200

The organization policy.

401

Requires authentication

403

Forbidden

404

Resource not found

Exemples de code pour «Get the Copilot code review policy for an organization »

Si vous accédez à GitHub à GHE.com, remplacez api.github.com par le sous-domaine dédié de votre entreprise à api.SUBDOMAIN.ghe.com.

Exemple de requête

get/orgs/{org}/copilot/policies/code-review
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ https://api.github.com/orgs/ORG/copilot/policies/code-review

The organization policy.

Status: 200
{ "configured_state": "enabled", "effective_state": "enabled", "editable": true, "managed_by": "organization" }

Set the Copilot code review policy for an organization

Sets the Copilot code review policy for an organization, using the same user settings propagation and notifications as organization settings. Policies that depend on Copilot code review keep their values.

Organization owners can use this endpoint. OAuth app tokens and personal access tokens (classic) need either the manage_billing:copilot or admin:org scope. GitHub App tokens and fine-grained personal access tokens are not supported.

When the enterprise manages the policy, the request fails with 409 and the code POLICY_MANAGED_BY_ENTERPRISE, even if the requested state matches the effective state. Invalid input and conflicts do not change any policy.

Jetons d'accès granulaires pour «Set the Copilot code review policy for an organization»

Ce point de terminaison ne fonctionne pas avec des jetons d’accès utilisateur de l'application GitHub, les jetons d’accès d’installation de l'application GitHub, ou des jetons d’accès personnels affinés.

Paramètres pour «Set the Copilot code review policy for an organization »

En-têtes
Nom, Type, Description
accept string

Setting to application/vnd.github+json is recommended.

Paramètres de chemin d’accès
Nom, Type, Description
org string Requis

The organization name. The name is not case sensitive.

Paramètres du corps
Nom, Type, Description
state string Requis

The organization's Copilot code review policy.

Peut être l'un des: enabled, disabled

Codes d’état de réponse HTTP pour «Set the Copilot code review policy for an organization »

Code de statutDescription
204

A header with no content is returned.

400

Bad Request

401

Requires authentication

403

Forbidden

404

Resource not found

409

The enterprise manages the policy.

422

Validation failed, or the endpoint has been spammed.

Exemples de code pour «Set the Copilot code review policy for an organization »

Si vous accédez à GitHub à GHE.com, remplacez api.github.com par le sous-domaine dédié de votre entreprise à api.SUBDOMAIN.ghe.com.

Exemple de requête

put/orgs/{org}/copilot/policies/code-review
curl -L \ -X PUT \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ https://api.github.com/orgs/ORG/copilot/policies/code-review \ -d '{"state":"enabled"}'

A header with no content is returned.

Status: 204

Get Copilot code review settings for a repository

Gets the Copilot code review settings for a repository. These settings tune how Copilot code review reviews pull requests in the repository. They do not enable Copilot code review.

review_effort.configured is null when the repository inherits its review effort from the organization, the enterprise, or GitHub's default. review_effort.effective is the review effort that reviews use when the requester and the pull request do not choose one. Only review efforts available for the repository are reported; when reviews would use an unavailable effort, review_effort.effective is the review effort they would use without it.

Repository administrators can use this endpoint. OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.

Jetons d'accès granulaires pour «Get Copilot code review settings for a repository»

Ce point de terminaison fonctionne avec les types de tokens à granularité fine suivants:

Le token à granularité fine doit disposer de l’ensemble d’autorisations suivant:

  • "Administration" repository permissions (read)

Paramètres pour «Get Copilot code review settings for a repository »

En-têtes
Nom, Type, Description
accept string

Setting to application/vnd.github+json is recommended.

Paramètres de chemin d’accès
Nom, Type, Description
owner string Requis

The account owner of the repository. The name is not case sensitive.

repo string Requis

The name of the repository without the .git extension. The name is not case sensitive.

Codes d’état de réponse HTTP pour «Get Copilot code review settings for a repository »

Code de statutDescription
200

The repository settings.

401

Requires authentication

403

Forbidden

404

Resource not found

Exemples de code pour «Get Copilot code review settings for a repository »

Si vous accédez à GitHub à GHE.com, remplacez api.github.com par le sous-domaine dédié de votre entreprise à api.SUBDOMAIN.ghe.com.

Exemple de requête

get/repos/{owner}/{repo}/copilot/code-review/settings
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ https://api.github.com/repos/OWNER/REPO/copilot/code-review/settings

The repository settings.

Status: 200
{ "review_effort": { "configured": null, "effective": "balanced" }, "available_review_efforts": [ "lite", "balanced" ], "severity_filter": "no_filter", "custom_instructions_enabled": true, "mcp_enabled": true }

Update Copilot code review settings for a repository

Updates the Copilot code review settings for a repository. These settings tune how Copilot code review reviews pull requests in the repository. They do not enable Copilot code review, and they can be stored while an enterprise or organization policy disables Copilot code review.

Omitted settings are not changed. Set review_effort to inherit to clear the repository's review effort so it inherits the effort from the organization, the enterprise, or GitHub's default. The whole request is validated before any change is made, so invalid input does not change any setting. Changes use the same audit logging and telemetry as the repository settings page.

Repository administrators can use this endpoint. OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.

Jetons d'accès granulaires pour «Update Copilot code review settings for a repository»

Ce point de terminaison fonctionne avec les types de tokens à granularité fine suivants:

Le token à granularité fine doit disposer de l’ensemble d’autorisations suivant:

  • "Administration" repository permissions (write)

Paramètres pour «Update Copilot code review settings for a repository »

En-têtes
Nom, Type, Description
accept string

Setting to application/vnd.github+json is recommended.

Paramètres de chemin d’accès
Nom, Type, Description
owner string Requis

The account owner of the repository. The name is not case sensitive.

repo string Requis

The name of the repository without the .git extension. The name is not case sensitive.

Paramètres du corps
Nom, Type, Description
review_effort string

The review effort for the repository. Use inherit to clear the repository's value. Only efforts listed in the settings' available_review_efforts are accepted, and a rejected effort's error message lists them. For more information, see Review effort level.

severity_filter string

Which review comment severities Copilot code review leaves out. Can only be set when the severity filter is available for the repository.

Peut être l'un des: no_filter, low, low_and_medium

custom_instructions_enabled boolean

Whether reviews use the repository's custom instructions.

mcp_enabled boolean

Whether reviews can use MCP servers.

Codes d’état de réponse HTTP pour «Update Copilot code review settings for a repository »

Code de statutDescription
200

The updated repository settings.

400

Bad Request

401

Requires authentication

403

Forbidden

404

Resource not found

422

Validation failed, or the endpoint has been spammed.

Exemples de code pour «Update Copilot code review settings for a repository »

Si vous accédez à GitHub à GHE.com, remplacez api.github.com par le sous-domaine dédié de votre entreprise à api.SUBDOMAIN.ghe.com.

Exemple de requête

patch/repos/{owner}/{repo}/copilot/code-review/settings
curl -L \ -X PATCH \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ https://api.github.com/repos/OWNER/REPO/copilot/code-review/settings \ -d '{"review_effort":"balanced","severity_filter":"low"}'

The updated repository settings.

Status: 200
{ "review_effort": { "configured": "balanced", "effective": "balanced" }, "available_review_efforts": [ "lite", "balanced" ], "severity_filter": "low", "custom_instructions_enabled": true, "mcp_enabled": true }