ListPullRequests - AWS CodeCommit


Returns a list of pull requests for a specified repository. The return list can be refined by pull request status or pull request author ARN.

Request Syntax

{ "authorArn": "string", "maxResults": number, "nextToken": "string", "pullRequestStatus": "string", "repositoryName": "string" }

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.


Optional. The Amazon Resource Name (ARN) of the user who created the pull request. If used, this filters the results to pull requests created by that user.

Type: String

Required: No


A non-zero, non-negative integer used to limit the number of returned results.

Type: Integer

Required: No


An enumeration token that, when provided in a request, returns the next batch of the results.

Type: String

Required: No


Optional. The status of the pull request. If used, this refines the results to the pull requests that match the specified status.

Type: String

Valid Values: OPEN | CLOSED

Required: No


The name of the repository for which you want to list pull requests.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 100.

Pattern: [\w\.-]+

Required: Yes

Response Syntax

{ "nextToken": "string", "pullRequestIds": [ "string" ] }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.


An enumeration token that allows the operation to batch the next results of the operation.

Type: String


The system-generated IDs of the pull requests.

Type: Array of strings


For information about the errors that are common to all actions, see Common Errors.


The specified Amazon Resource Name (ARN) does not exist in the AWS account.

HTTP Status Code: 400


An encryption integrity check failed.

HTTP Status Code: 500


An encryption key could not be accessed.

HTTP Status Code: 400


The encryption key is disabled.

HTTP Status Code: 400


No encryption key was found.

HTTP Status Code: 400


The encryption key is not available.

HTTP Status Code: 400


The Amazon Resource Name (ARN) is not valid. Make sure that you have provided the full ARN for the author of the pull request, and then try again.

HTTP Status Code: 400


The specified continuation token is not valid.

HTTP Status Code: 400


The specified number of maximum results is not valid.

HTTP Status Code: 400


The pull request status is not valid. The only valid values are OPEN and CLOSED.

HTTP Status Code: 400


A specified repository name is not valid.


This exception occurs only when a specified repository name is not valid. Other exceptions occur when a required repository parameter is missing, or when a specified repository does not exist.

HTTP Status Code: 400


The specified repository does not exist.

HTTP Status Code: 400


A repository name is required, but was not specified.

HTTP Status Code: 400



This example illustrates one usage of ListPullRequests.

Sample Request

>POST / HTTP/1.1 Host: Accept-Encoding: identity Content-Length: 174 X-Amz-Target: CodeCommit_20150413.ListPullRequests X-Amz-Date: 20171025T132023Z User-Agent: aws-cli/1.11.187 Python/2.7.9 Windows/8 Content-Type: application/x-amz-json-1.1 Authorization: AWS4-HMAC-SHA256 Credential=AKIAI44QH8DHBEXAMPLE/20171025/us-east-1/codecommit/aws4_request, SignedHeaders=content-type;host;user-agent;x-amz-date;x-amz-target, Signature=8d9b5998EXAMPLE { "authorArn": "arn:aws:iam::123456789012:user/Li_Juan", "maxResults": 20, "nextToken": "", "pullRequestStatus": "CLOSED", "repositoryName": "MyDemoRepo" }

Sample Response

{ "nextToken": "exampleToken", "pullRequestIds": ["2","12","16","22","30","23","35","39","47"] }

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: