- [HTTP request](https://docs.cloud.google.com/secure-source-manager/docs/reference/rest/v1/projects.locations.repositories.pullRequests.pullRequestComments/batchCreate#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/secure-source-manager/docs/reference/rest/v1/projects.locations.repositories.pullRequests.pullRequestComments/batchCreate#body.PATH_PARAMETERS)
- [Request body](https://docs.cloud.google.com/secure-source-manager/docs/reference/rest/v1/projects.locations.repositories.pullRequests.pullRequestComments/batchCreate#body.request_body)
  - [JSON representation](https://docs.cloud.google.com/secure-source-manager/docs/reference/rest/v1/projects.locations.repositories.pullRequests.pullRequestComments/batchCreate#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://docs.cloud.google.com/secure-source-manager/docs/reference/rest/v1/projects.locations.repositories.pullRequests.pullRequestComments/batchCreate#body.response_body)
- [Authorization scopes](https://docs.cloud.google.com/secure-source-manager/docs/reference/rest/v1/projects.locations.repositories.pullRequests.pullRequestComments/batchCreate#body.aspect)
- [IAM Permissions](https://docs.cloud.google.com/secure-source-manager/docs/reference/rest/v1/projects.locations.repositories.pullRequests.pullRequestComments/batchCreate#body.aspect_1)
- [CreatePullRequestCommentRequest](https://docs.cloud.google.com/secure-source-manager/docs/reference/rest/v1/projects.locations.repositories.pullRequests.pullRequestComments/batchCreate#CreatePullRequestCommentRequest)
  - [JSON representation](https://docs.cloud.google.com/secure-source-manager/docs/reference/rest/v1/projects.locations.repositories.pullRequests.pullRequestComments/batchCreate#CreatePullRequestCommentRequest.SCHEMA_REPRESENTATION)

Batch creates pull request comments. This function is used to create multiple PullRequestComments for code review. There needs to be exactly one PullRequestComment of type Review, and at most 100 PullRequestComments of type Code per request. The Position of the code comments must be unique within the request.

### HTTP request

Choose an endpoint:
asia-east1 asia-northeast1 asia-northeast3 australia-southeast1 europe-west2 europe-west4 me-central2 me-west1 northamerica-northeast1 us-central1 us-east1   
`POST https://securesourcemanager.asia-east1.rep.googleapis.com/v1/{parent=projects/*/locations/*/repositories/*/pullRequests/*}/pullRequestComments:batchCreate`

<br />

The URLs use [gRPC Transcoding](https://google.aip.dev/127) syntax.

### Path parameters

| Parameters ||
|---|---|
| `parent` | `string` Required. The pull request in which to create the pull request comments. Format: `projects/{project_number}/locations/{locationId}/repositories/{repositoryId}/pullRequests/{pull_request_id}` |

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "requests": [ { object (`https://docs.cloud.google.com/secure-source-manager/docs/reference/rest/v1/projects.locations.repositories.pullRequests.pullRequestComments/batchCreate#CreatePullRequestCommentRequest`) } ] } ``` |

| Fields ||
|---|---|
| `requests[]` | ``object (`https://docs.cloud.google.com/secure-source-manager/docs/reference/rest/v1/projects.locations.repositories.pullRequests.pullRequestComments/batchCreate#CreatePullRequestCommentRequest`)`` Required. The request message specifying the resources to create. There should be exactly one CreatePullRequestCommentRequest with CommentDetail being REVIEW in the list, and no more than 100 CreatePullRequestCommentRequests with CommentDetail being CODE in the list |

### Response body

If successful, the response body contains an instance of `https://docs.cloud.google.com/secure-source-manager/docs/reference/rest/v1/projects.locations.operations#Operation`.

### Authorization scopes

Requires one of the following OAuth scopes:

- `https://www.googleapis.com/auth/cloud-platform`
- `
  https://www.googleapis.com/auth/securesourcemanager.read-write`

For more information, see the [Authentication Overview](https://docs.cloud.google.com/docs/authentication#authorization-gcp).

### IAM Permissions

Requires the following [IAM](https://cloud.google.com/iam/docs) permission on the `parent` resource:

- `securesourcemanager.prcomments.create`

For more information, see the [IAM documentation](https://cloud.google.com/iam/docs).

## CreatePullRequestCommentRequest

The request to create a pull request comment.

| JSON representation |
|---|
| ``` { "parent": string, "pullRequestComment": { object (`https://docs.cloud.google.com/secure-source-manager/docs/reference/rest/v1/projects.locations.repositories.pullRequests.pullRequestComments#PullRequestComment`) } } ``` |

| Fields ||
|---|---|
| `parent` | `string` Required. The pull request in which to create the pull request comment. Format: `projects/{project_number}/locations/{locationId}/repositories/{repositoryId}/pullRequests/{pull_request_id}` |
| `pullRequestComment` | ``object (`https://docs.cloud.google.com/secure-source-manager/docs/reference/rest/v1/projects.locations.repositories.pullRequests.pullRequestComments#PullRequestComment`)`` Required. The pull request comment to create. |