diff --git a/content/rest/guides/index.md b/content/rest/guides/index.md index 82284553daa9..3dc94b4e857e 100644 --- a/content/rest/guides/index.md +++ b/content/rest/guides/index.md @@ -15,6 +15,7 @@ children: - /delivering-deployments - /rendering-data-as-graphs - /working-with-comments + - /requesting-copilot-code-review-with-the-rest-api - /building-a-ci-server - /using-the-rest-api-to-interact-with-your-git-database - /using-the-rest-api-to-interact-with-checks diff --git a/content/rest/guides/requesting-copilot-code-review-with-the-rest-api.md b/content/rest/guides/requesting-copilot-code-review-with-the-rest-api.md new file mode 100644 index 000000000000..c0cda6eb1a8b --- /dev/null +++ b/content/rest/guides/requesting-copilot-code-review-with-the-rest-api.md @@ -0,0 +1,19 @@ +--- +title: Requesting Copilot code review with the REST API +shortTitle: Request Copilot code review +allowTitleToDifferFromFilename: true +intro: 'Use the REST API to request a {% data variables.copilot.copilot_code-review_short %} on a pull request and manage per-PR review preferences.' +versions: + fpt: '*' + ghec: '*' +category: + - Manage issues, pull requests, and projects +--- + +## About requesting a {% data variables.copilot.copilot_code-review_short %} + +You can use the REST API to ask {% data variables.product.prodname_copilot_short %} to review a pull request, optionally telling it how much effort to spend on the review and whether to re-review the pull request automatically on every new push. + +This endpoint is preferred over adding the `copilot-pull-request-reviewer[bot]` user as a reviewer through the `requested_reviewers` endpoint. Both flows produce the same Copilot review under the hood, but the dedicated endpoint accepts per-PR preferences and returns a structured response. + +These endpoints are only available on {% data variables.product.prodname_dotcom_the_website %} and {% data variables.product.prodname_ghe_cloud %}. They return `404` on {% data variables.product.prodname_ghe_server %}. diff --git a/content/rest/pulls/review-requests.md b/content/rest/pulls/review-requests.md index 5de90bb89b9c..07917bf75959 100644 --- a/content/rest/pulls/review-requests.md +++ b/content/rest/pulls/review-requests.md @@ -16,4 +16,10 @@ category: Pull request authors and repository owners and collaborators can request a pull request review from anyone with write access to the repository. Each requested reviewer will receive a notification asking them to review the pull request. +{% ifversion fpt or ghec %} + +To request a review specifically from {% data variables.product.prodname_copilot_short %}—and to set per-PR preferences such as the review effort level or whether to re-review on each new push—use the dedicated {% data variables.product.prodname_copilot_short %} review endpoint instead of adding the {% data variables.product.prodname_copilot_short %} bot to this endpoint. For more information, see [AUTOTITLE](/rest/guides/requesting-copilot-code-review-with-the-rest-api). + +{% endif %} +