New-GitHubPullRequestRequestCopilotCodeReview
SYNOPSIS
Request a Copilot code review for a pull request
SYNTAX
__AllParameterSets
New-GitHubPullRequestRequestCopilotCodeReview [-Owner] <string> [-Repo] <string>
[-PullNumber] <long> [-ReviewEffort <string>] [-Body <Object>] [-Accept <string>] [-WhatIf]
[-Confirm]
ALIASES
This cmdlet has the following aliases,
- Get-GHNewPullRequestRequestCopilotCodeReview
DESCRIPTION
The New-GitHubPullRequestRequestCopilotCodeReview cmdlet invokes the POST method of the /repos/{owner}/{repo}/pulls/{pull_number}/copilot-code-review endpoint (Request a Copilot code review for a pull request)
Requests a Copilot code review for a pull request. Every call expresses intent to start a new review: if no Copilot review has been requested yet, an initial request is created; if the most recent Copilot review has already completed (including if it was later dismissed or superseded), a new request is created automatically to continue the review lifecycle. If a Copilot code review request is already pending for the pull request, no new request is created and the response is ‘409’.
If the actor or repository is not eligible for Copilot code review, the actor has no quota remaining, or the licensing organization is unavailable, no request is created and the response is ‘422’ with a stable ‘failure_reason’. A ‘review_effort’ is accepted only when that effort level is available for the repository and actor; an unrecognized or unavailable ‘review_effort’ returns ‘422’ with ‘failure_reason’ ‘INVALID_REVIEW_EFFORT’. If the actor, repository owner, or requesting application owner has been flagged, the response is ‘403’ with ‘failure_reason’ ‘ACTOR_FLAGGED’. If the per-actor or per-owner request rate limit is exceeded, the response is ‘429’ with ‘failure_reason’ ‘RATE_LIMITED’. If Copilot code review cannot be serviced right now, the response is ‘503’.
Existing human and team review requests on the pull request are left unchanged.
Endpoint: POST /repos/{owner}/{repo}/pulls/{pull_number}/copilot-code-review API version: 2026-03-10
EXAMPLES
EXAMPLE 1
New-GitHubPullRequestRequestCopilotCodeReview -Owner 'octocat' -Repo 'Hello-World' -PullNumber 1
Invokes POST /repos/{owner}/{repo}/pulls/{pull_number}/copilot-code-review
EXAMPLE 2
New-GitHubPullRequestRequestCopilotCodeReview -Owner 'octocat' -Repo 'Hello-World' -PullNumber 1 -Body @{ review_effort = 'balanced' }
Sends the request body from a hashtable, parameters override the keys of -Body
PARAMETERS
-Accept
The Accept header (media type) of the request Default value: application/vnd.github+json
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-Body
The whole request body as a hashtable or object. Keys that are also available as parameters are overwritten by the parameter values
Type: System.Object
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-Confirm
Prompts you for confirmation before running the cmdlet.
Type: System.Management.Automation.SwitchParameter
DefaultValue: ''
SupportsWildcards: false
Aliases:
- cf
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-Owner
The account owner of the repository. The name is not case sensitive.
Path parameter [ owner ]
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 0
IsRequired: true
ValueFromPipeline: false
ValueFromPipelineByPropertyName: true
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-PullNumber
The number that identifies the pull request.
Path parameter [ pull_number ]
Type: System.Int64
DefaultValue: 0
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 2
IsRequired: true
ValueFromPipeline: false
ValueFromPipelineByPropertyName: true
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-Repo
The name of the repository without the ‘.git’ extension. The name is not case sensitive.
Path parameter [ repo ]
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 1
IsRequired: true
ValueFromPipeline: false
ValueFromPipelineByPropertyName: true
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-ReviewEffort
The effort level to use for the Copilot code review. Omit to use the default effort level. Only effort levels available for the repository and actor are accepted. For more information, see Review effort level (https://docs.github.com/copilot/concepts/agent-capabilities/agent-powered-workflows-and-operations/code-review#review-effort-level).
Body property [ review_effort ]
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-WhatIf
Runs the command in a mode that only reports what would happen without performing the actions.
Type: System.Management.Automation.SwitchParameter
DefaultValue: ''
SupportsWildcards: false
Aliases:
- wi
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
INPUTS
Objects with properties named like the path parameters can be piped to this function
{{ Fill in the Description }}
System.String
{{ Fill in the Description }}
System.Int64
{{ Fill in the Description }}
OUTPUTS
The response of the GitHub API (objects
{{ Fill in the Description }}
NOTES
OperationId: pulls/request-copilot-code-review Category: pulls / copilot-code-review