# REST Resource: projects.locations.repositories.pullRequests

- [Resource: PullRequest](https://docs.cloud.google.com/secure-source-manager/docs/reference/rest/v1/projects.locations.repositories.pullRequests#PullRequest)
  - [JSON representation](https://docs.cloud.google.com/secure-source-manager/docs/reference/rest/v1/projects.locations.repositories.pullRequests#PullRequest.SCHEMA_REPRESENTATION)
- [Branch](https://docs.cloud.google.com/secure-source-manager/docs/reference/rest/v1/projects.locations.repositories.pullRequests#Branch)
  - [JSON representation](https://docs.cloud.google.com/secure-source-manager/docs/reference/rest/v1/projects.locations.repositories.pullRequests#Branch.SCHEMA_REPRESENTATION)
- [State](https://docs.cloud.google.com/secure-source-manager/docs/reference/rest/v1/projects.locations.repositories.pullRequests#State)
- [Methods](https://docs.cloud.google.com/secure-source-manager/docs/reference/rest/v1/projects.locations.repositories.pullRequests#METHODS_SUMMARY)

## Resource: PullRequest

Metadata of a PullRequest. PullRequest is the request from a user to merge a branch (head) into another branch (base).

| JSON representation |
|---|
| ``` { "name": string, "title": string, "body": string, "base": { object (`https://docs.cloud.google.com/secure-source-manager/docs/reference/rest/v1/projects.locations.repositories.pullRequests#Branch`) }, "head": { object (`https://docs.cloud.google.com/secure-source-manager/docs/reference/rest/v1/projects.locations.repositories.pullRequests#Branch`) }, "state": enum (`https://docs.cloud.google.com/secure-source-manager/docs/reference/rest/v1/projects.locations.repositories.pullRequests#State`), "createTime": string, "updateTime": string, "closeTime": string } ``` |

| Fields ||
|---|---|
| `name` | `string` Output only. Identifier. A unique identifier for a PullRequest. The number appended at the end is generated by the server. Format: `projects/{project}/locations/{location}/repositories/{repository}/pullRequests/{pull_request_id}` |
| `title` | `string` Required. The pull request title. |
| `body` | `string` Optional. The pull request body. Provides a detailed description of the changes. |
| `base` | ``object (`https://docs.cloud.google.com/secure-source-manager/docs/reference/rest/v1/projects.locations.repositories.pullRequests#Branch`)`` Required. The branch to merge changes in. |
| `head` | ``object (`https://docs.cloud.google.com/secure-source-manager/docs/reference/rest/v1/projects.locations.repositories.pullRequests#Branch`)`` Immutable. The branch containing the changes to be merged. |
| `state` | ``enum (`https://docs.cloud.google.com/secure-source-manager/docs/reference/rest/v1/projects.locations.repositories.pullRequests#State`)`` Output only. State of the pull request (open, closed or merged). |
| `createTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Output only. Creation timestamp. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |
| `updateTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Output only. Last updated timestamp. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |
| `closeTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Output only. Close timestamp (if closed or merged). Cleared when pull request is re-opened. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |

## Branch

Branch represents a branch involved in a pull request.

| JSON representation |
|---|
| ``` { "ref": string, "sha": string } ``` |

| Fields ||
|---|---|
| `ref` | `string` Required. Name of the branch. |
| `sha` | `string` Output only. The commit at the tip of the branch. |

## State

State of the pull request.

| Enums ||
|---|---|
| `STATE_UNSPECIFIED` | Unspecified. |
| `OPEN` | An open pull request. |
| `CLOSED` | A closed pull request. |
| `MERGED` | A merged pull request. |

| ## Methods ||
|---|---|
| ### `https://docs.cloud.google.com/secure-source-manager/docs/reference/rest/v1/projects.locations.repositories.pullRequests/close` | Closes a pull request without merging. |
| ### `https://docs.cloud.google.com/secure-source-manager/docs/reference/rest/v1/projects.locations.repositories.pullRequests/create` | Creates a pull request. |
| ### `https://docs.cloud.google.com/secure-source-manager/docs/reference/rest/v1/projects.locations.repositories.pullRequests/get` | Gets a pull request. |
| ### `https://docs.cloud.google.com/secure-source-manager/docs/reference/rest/v1/projects.locations.repositories.pullRequests/list` | Lists pull requests in a repository. |
| ### `https://docs.cloud.google.com/secure-source-manager/docs/reference/rest/v1/projects.locations.repositories.pullRequests/listFileDiffs` | Lists a pull request's file diffs. |
| ### `https://docs.cloud.google.com/secure-source-manager/docs/reference/rest/v1/projects.locations.repositories.pullRequests/merge` | Merges a pull request. |
| ### `https://docs.cloud.google.com/secure-source-manager/docs/reference/rest/v1/projects.locations.repositories.pullRequests/open` | Opens a pull request. |
| ### `https://docs.cloud.google.com/secure-source-manager/docs/reference/rest/v1/projects.locations.repositories.pullRequests/patch` | Updates a pull request. |