> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://learning.postman.com/llms.txt. For full content including API reference and SDK examples, see https://learning.postman.com/llms-full.txt.

# Review a pull request

POST https://api.getpostman.com/pull-requests/{pullRequestId}/tasks
Content-Type: application/json

Updates the [review](https://learning.postman.com/docs/collaborating-in-postman/using-version-control/reviewing-pull-requests/) status of a pull request.

Reference: https://learning.postman.com/api-docs/api-reference/pull-requests/review-pull-request

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: Postman API
  version: 1.0.0
paths:
  /pull-requests/{pullRequestId}/tasks:
    post:
      operationId: reviewPullRequest
      summary: Review a pull request
      description: >-
        Updates the
        [review](https://learning.postman.com/docs/collaborating-in-postman/using-version-control/reviewing-pull-requests/)
        status of a pull request.
      tags:
        - pullRequests
      parameters:
        - name: pullRequestId
          in: path
          description: The pull request's ID.
          required: true
          schema:
            $ref: '#/components/schemas/pullRequestId'
        - name: x-api-key
          in: header
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/pullRequestReviewReponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/commonErrorTypeTitleDetailStatus'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/commonErrorTypeTitleDetailStatus'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/ReviewPullRequestRequestInternalServerError
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/pullRequestReview'
servers:
  - url: https://api.getpostman.com
    description: https://api.getpostman.com
  - url: https://api.eu.postman.com
    description: https://api.eu.postman.com
components:
  schemas:
    pullRequestId:
      type: string
      title: pullRequestId
    PullRequestReviewAction:
      type: string
      enum:
        - approve
        - decline
        - merge
        - unapprove
      description: >
        The action to perform on the pull request:

        - `approve` — Approve the pull request for merge.

        - `decline` — Decline the pull request.

        - `merge` — Merge the pull request into its parent element.

        - `unapprove` — Revokes a pull request's `approve` status. This action
        does not decline the pull request.
      title: PullRequestReviewAction
    pullRequestReview:
      type: object
      properties:
        action:
          $ref: '#/components/schemas/PullRequestReviewAction'
          description: >
            The action to perform on the pull request:

            - `approve` — Approve the pull request for merge.

            - `decline` — Decline the pull request.

            - `merge` — Merge the pull request into its parent element.

            - `unapprove` — Revokes a pull request's `approve` status. This
            action does not decline the pull request.
        comment:
          type: string
          description: >-
            If the pull request is a `decline` status, an optoinal comment about
            why the pull request was declined.
      required:
        - action
      title: pullRequestReview
    PullRequestReviewReponseReviewedBy:
      type: object
      properties:
        id:
          type: number
          format: double
          description: The user's ID.
        name:
          type: string
          description: The user's name.
        username:
          type: string
          description: The user's username.
      description: Information about the user who reviewed the pull request review.
      title: PullRequestReviewReponseReviewedBy
    pullRequestReviewReponse:
      type: object
      properties:
        id:
          type: string
          description: The pull request's ID.
        reviewedBy:
          $ref: '#/components/schemas/PullRequestReviewReponseReviewedBy'
          description: Information about the user who reviewed the pull request review.
        status:
          type: string
          description: |
            The pull request's current review status:
            - `open` — The pull request is still open.
            - `approved` — The pull request was approved by its reviewers.
            - `declined` — The pull request was not approved by its reviewers.
            - `merged` — The pull request was merged.
        updatedAt:
          type: string
          description: The date and time at which the pull request was updated.
      title: pullRequestReviewReponse
    CommonErrorTypeTitleDetailStatusType:
      oneOf:
        - type: string
          format: uri-reference
        - type: string
      title: CommonErrorTypeTitleDetailStatusType
    commonErrorTypeTitleDetailStatus:
      type: object
      properties:
        type:
          $ref: '#/components/schemas/CommonErrorTypeTitleDetailStatusType'
        title:
          type: string
          description: A short summary of the problem.
        detail:
          type: string
          description: Information about the error.
        status:
          type: integer
          description: The error's HTTP status code.
      title: commonErrorTypeTitleDetailStatus
    CommonErrorTypeTitleDetailDetail:
      oneOf:
        - type: string
        - type: object
          additionalProperties:
            description: Any type
      description: Information about the error.
      title: CommonErrorTypeTitleDetailDetail
    commonErrorTypeTitleDetail:
      type: object
      properties:
        type:
          type: string
          description: The type of error.
        title:
          type: string
          description: A short summary of the problem.
        detail:
          $ref: '#/components/schemas/CommonErrorTypeTitleDetailDetail'
          description: Information about the error.
      title: commonErrorTypeTitleDetail
    CommonErrorNameMessageError:
      type: object
      properties:
        name:
          type: string
          description: The error name.
        message:
          type: string
          description: The error message.
      description: Information about the error.
      title: CommonErrorNameMessageError
    commonErrorNameMessage:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/CommonErrorNameMessageError'
          description: Information about the error.
      title: commonErrorNameMessage
    ReviewPullRequestRequestInternalServerError:
      oneOf:
        - $ref: '#/components/schemas/commonErrorTypeTitleDetail'
        - $ref: '#/components/schemas/commonErrorTypeTitleDetailStatus'
        - $ref: '#/components/schemas/commonErrorNameMessage'
      title: ReviewPullRequestRequestInternalServerError
  securitySchemes:
    PostmanApiKey:
      type: apiKey
      in: header
      name: x-api-key
    scimApiKey:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        A valid [SCIM API
        key](https://learning.postman.com/docs/administration/scim-provisioning/scim-provisioning-overview/#generating-scim-api-key)
        for calls to SCIM endpoints.
    basicAuth:
      type: http
      scheme: basic

```

## Examples

### Approved



**Request**

```json
undefined
```

**Response**

```json
{
  "id": "4e1a6609-1a29-4037-a411-89ecc14c6cd8",
  "reviewedBy": {
    "id": 12345678,
    "name": "Taylor Lee",
    "username": "taylor-lee"
  },
  "status": "approved",
  "updatedAt": "2024-02-21T08:19:09.000Z"
}
```

**SDK Code**

```python Approved
import requests

url = "https://api.getpostman.com/pull-requests/4e1a6609-1a29-4037-a411-89ecc14c6cd8/tasks"

headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, headers=headers)

print(response.json())
```

```javascript Approved
const url = 'https://api.getpostman.com/pull-requests/4e1a6609-1a29-4037-a411-89ecc14c6cd8/tasks';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: undefined
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Approved
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.getpostman.com/pull-requests/4e1a6609-1a29-4037-a411-89ecc14c6cd8/tasks"

	req, _ := http.NewRequest("POST", url, nil)

	req.Header.Add("x-api-key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Approved
require 'uri'
require 'net/http'

url = URI("https://api.getpostman.com/pull-requests/4e1a6609-1a29-4037-a411-89ecc14c6cd8/tasks")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'

response = http.request(request)
puts response.read_body
```

```java Approved
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.getpostman.com/pull-requests/4e1a6609-1a29-4037-a411-89ecc14c6cd8/tasks")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .asString();
```

```php Approved
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.getpostman.com/pull-requests/4e1a6609-1a29-4037-a411-89ecc14c6cd8/tasks', [
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp Approved
using RestSharp;

var client = new RestClient("https://api.getpostman.com/pull-requests/4e1a6609-1a29-4037-a411-89ecc14c6cd8/tasks");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
IRestResponse response = client.Execute(request);
```

```swift Approved
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.getpostman.com/pull-requests/4e1a6609-1a29-4037-a411-89ecc14c6cd8/tasks")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Merged



**Request**

```json
undefined
```

**Response**

```json
{
  "id": "4e1a6609-1a29-4037-a411-89ecc14c6cd8",
  "reviewedBy": {
    "id": 12345678,
    "name": "Taylor Lee",
    "username": "taylor-lee"
  },
  "status": "merged",
  "updatedAt": "2024-02-21T08:19:09.000Z"
}
```

**SDK Code**

```python Merged
import requests

url = "https://api.getpostman.com/pull-requests/4e1a6609-1a29-4037-a411-89ecc14c6cd8/tasks"

headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, headers=headers)

print(response.json())
```

```javascript Merged
const url = 'https://api.getpostman.com/pull-requests/4e1a6609-1a29-4037-a411-89ecc14c6cd8/tasks';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: undefined
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Merged
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.getpostman.com/pull-requests/4e1a6609-1a29-4037-a411-89ecc14c6cd8/tasks"

	req, _ := http.NewRequest("POST", url, nil)

	req.Header.Add("x-api-key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Merged
require 'uri'
require 'net/http'

url = URI("https://api.getpostman.com/pull-requests/4e1a6609-1a29-4037-a411-89ecc14c6cd8/tasks")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'

response = http.request(request)
puts response.read_body
```

```java Merged
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.getpostman.com/pull-requests/4e1a6609-1a29-4037-a411-89ecc14c6cd8/tasks")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .asString();
```

```php Merged
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.getpostman.com/pull-requests/4e1a6609-1a29-4037-a411-89ecc14c6cd8/tasks', [
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp Merged
using RestSharp;

var client = new RestClient("https://api.getpostman.com/pull-requests/4e1a6609-1a29-4037-a411-89ecc14c6cd8/tasks");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
IRestResponse response = client.Execute(request);
```

```swift Merged
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.getpostman.com/pull-requests/4e1a6609-1a29-4037-a411-89ecc14c6cd8/tasks")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Declined



**Request**

```json
undefined
```

**Response**

```json
{
  "id": "4e1a6609-1a29-4037-a411-89ecc14c6cd8",
  "reviewedBy": {
    "id": 12345678,
    "name": "Taylor Lee",
    "username": "taylor-lee"
  },
  "status": "declined",
  "updatedAt": "2024-02-21T08:19:09.000Z"
}
```

**SDK Code**

```python Declined
import requests

url = "https://api.getpostman.com/pull-requests/4e1a6609-1a29-4037-a411-89ecc14c6cd8/tasks"

headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, headers=headers)

print(response.json())
```

```javascript Declined
const url = 'https://api.getpostman.com/pull-requests/4e1a6609-1a29-4037-a411-89ecc14c6cd8/tasks';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: undefined
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Declined
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.getpostman.com/pull-requests/4e1a6609-1a29-4037-a411-89ecc14c6cd8/tasks"

	req, _ := http.NewRequest("POST", url, nil)

	req.Header.Add("x-api-key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Declined
require 'uri'
require 'net/http'

url = URI("https://api.getpostman.com/pull-requests/4e1a6609-1a29-4037-a411-89ecc14c6cd8/tasks")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'

response = http.request(request)
puts response.read_body
```

```java Declined
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.getpostman.com/pull-requests/4e1a6609-1a29-4037-a411-89ecc14c6cd8/tasks")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .asString();
```

```php Declined
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.getpostman.com/pull-requests/4e1a6609-1a29-4037-a411-89ecc14c6cd8/tasks', [
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp Declined
using RestSharp;

var client = new RestClient("https://api.getpostman.com/pull-requests/4e1a6609-1a29-4037-a411-89ecc14c6cd8/tasks");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
IRestResponse response = client.Execute(request);
```

```swift Declined
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.getpostman.com/pull-requests/4e1a6609-1a29-4037-a411-89ecc14c6cd8/tasks")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Unpproved



**Request**

```json
undefined
```

**Response**

```json
{
  "id": "4e1a6609-1a29-4037-a411-89ecc14c6cd8",
  "reviewedBy": {
    "id": 12345678,
    "name": "Taylor Lee",
    "username": "taylor-lee"
  },
  "status": "open",
  "updatedAt": "2024-02-21T08:19:09.000Z"
}
```

**SDK Code**

```python Unpproved
import requests

url = "https://api.getpostman.com/pull-requests/4e1a6609-1a29-4037-a411-89ecc14c6cd8/tasks"

headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, headers=headers)

print(response.json())
```

```javascript Unpproved
const url = 'https://api.getpostman.com/pull-requests/4e1a6609-1a29-4037-a411-89ecc14c6cd8/tasks';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: undefined
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Unpproved
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.getpostman.com/pull-requests/4e1a6609-1a29-4037-a411-89ecc14c6cd8/tasks"

	req, _ := http.NewRequest("POST", url, nil)

	req.Header.Add("x-api-key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Unpproved
require 'uri'
require 'net/http'

url = URI("https://api.getpostman.com/pull-requests/4e1a6609-1a29-4037-a411-89ecc14c6cd8/tasks")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'

response = http.request(request)
puts response.read_body
```

```java Unpproved
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.getpostman.com/pull-requests/4e1a6609-1a29-4037-a411-89ecc14c6cd8/tasks")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .asString();
```

```php Unpproved
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.getpostman.com/pull-requests/4e1a6609-1a29-4037-a411-89ecc14c6cd8/tasks', [
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp Unpproved
using RestSharp;

var client = new RestClient("https://api.getpostman.com/pull-requests/4e1a6609-1a29-4037-a411-89ecc14c6cd8/tasks");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
IRestResponse response = client.Execute(request);
```

```swift Unpproved
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.getpostman.com/pull-requests/4e1a6609-1a29-4037-a411-89ecc14c6cd8/tasks")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Approve



**Request**

```json
{
  "action": "approve"
}
```

**Response**

```json
{
  "id": "4e1a6609-1a29-4037-a411-89ecc14c6cd8",
  "reviewedBy": {
    "id": 12345678,
    "name": "Taylor Lee",
    "username": "taylor-lee"
  },
  "status": "approved",
  "updatedAt": "2024-02-21T08:19:09.000Z"
}
```

**SDK Code**

```python Approve
import requests

url = "https://api.getpostman.com/pull-requests/4e1a6609-1a29-4037-a411-89ecc14c6cd8/tasks"

payload = { "action": "approve" }
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Approve
const url = 'https://api.getpostman.com/pull-requests/4e1a6609-1a29-4037-a411-89ecc14c6cd8/tasks';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"action":"approve"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Approve
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.getpostman.com/pull-requests/4e1a6609-1a29-4037-a411-89ecc14c6cd8/tasks"

	payload := strings.NewReader("{\n  \"action\": \"approve\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("x-api-key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Approve
require 'uri'
require 'net/http'

url = URI("https://api.getpostman.com/pull-requests/4e1a6609-1a29-4037-a411-89ecc14c6cd8/tasks")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"action\": \"approve\"\n}"

response = http.request(request)
puts response.read_body
```

```java Approve
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.getpostman.com/pull-requests/4e1a6609-1a29-4037-a411-89ecc14c6cd8/tasks")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"action\": \"approve\"\n}")
  .asString();
```

```php Approve
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.getpostman.com/pull-requests/4e1a6609-1a29-4037-a411-89ecc14c6cd8/tasks', [
  'body' => '{
  "action": "approve"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp Approve
using RestSharp;

var client = new RestClient("https://api.getpostman.com/pull-requests/4e1a6609-1a29-4037-a411-89ecc14c6cd8/tasks");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"action\": \"approve\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Approve
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = ["action": "approve"] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.getpostman.com/pull-requests/4e1a6609-1a29-4037-a411-89ecc14c6cd8/tasks")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Merge



**Request**

```json
{
  "action": "merge"
}
```

**Response**

```json
{
  "id": "4e1a6609-1a29-4037-a411-89ecc14c6cd8",
  "reviewedBy": {
    "id": 12345678,
    "name": "Taylor Lee",
    "username": "taylor-lee"
  },
  "status": "approved",
  "updatedAt": "2024-02-21T08:19:09.000Z"
}
```

**SDK Code**

```python Merge
import requests

url = "https://api.getpostman.com/pull-requests/4e1a6609-1a29-4037-a411-89ecc14c6cd8/tasks"

payload = { "action": "merge" }
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Merge
const url = 'https://api.getpostman.com/pull-requests/4e1a6609-1a29-4037-a411-89ecc14c6cd8/tasks';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"action":"merge"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Merge
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.getpostman.com/pull-requests/4e1a6609-1a29-4037-a411-89ecc14c6cd8/tasks"

	payload := strings.NewReader("{\n  \"action\": \"merge\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("x-api-key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Merge
require 'uri'
require 'net/http'

url = URI("https://api.getpostman.com/pull-requests/4e1a6609-1a29-4037-a411-89ecc14c6cd8/tasks")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"action\": \"merge\"\n}"

response = http.request(request)
puts response.read_body
```

```java Merge
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.getpostman.com/pull-requests/4e1a6609-1a29-4037-a411-89ecc14c6cd8/tasks")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"action\": \"merge\"\n}")
  .asString();
```

```php Merge
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.getpostman.com/pull-requests/4e1a6609-1a29-4037-a411-89ecc14c6cd8/tasks', [
  'body' => '{
  "action": "merge"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp Merge
using RestSharp;

var client = new RestClient("https://api.getpostman.com/pull-requests/4e1a6609-1a29-4037-a411-89ecc14c6cd8/tasks");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"action\": \"merge\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Merge
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = ["action": "merge"] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.getpostman.com/pull-requests/4e1a6609-1a29-4037-a411-89ecc14c6cd8/tasks")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Decline



**Request**

```json
{
  "action": "decline",
  "comment": "Missing descriptions in requests"
}
```

**Response**

```json
{
  "id": "4e1a6609-1a29-4037-a411-89ecc14c6cd8",
  "reviewedBy": {
    "id": 12345678,
    "name": "Taylor Lee",
    "username": "taylor-lee"
  },
  "status": "approved",
  "updatedAt": "2024-02-21T08:19:09.000Z"
}
```

**SDK Code**

```python Decline
import requests

url = "https://api.getpostman.com/pull-requests/4e1a6609-1a29-4037-a411-89ecc14c6cd8/tasks"

payload = {
    "action": "decline",
    "comment": "Missing descriptions in requests"
}
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Decline
const url = 'https://api.getpostman.com/pull-requests/4e1a6609-1a29-4037-a411-89ecc14c6cd8/tasks';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"action":"decline","comment":"Missing descriptions in requests"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Decline
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.getpostman.com/pull-requests/4e1a6609-1a29-4037-a411-89ecc14c6cd8/tasks"

	payload := strings.NewReader("{\n  \"action\": \"decline\",\n  \"comment\": \"Missing descriptions in requests\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("x-api-key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Decline
require 'uri'
require 'net/http'

url = URI("https://api.getpostman.com/pull-requests/4e1a6609-1a29-4037-a411-89ecc14c6cd8/tasks")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"action\": \"decline\",\n  \"comment\": \"Missing descriptions in requests\"\n}"

response = http.request(request)
puts response.read_body
```

```java Decline
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.getpostman.com/pull-requests/4e1a6609-1a29-4037-a411-89ecc14c6cd8/tasks")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"action\": \"decline\",\n  \"comment\": \"Missing descriptions in requests\"\n}")
  .asString();
```

```php Decline
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.getpostman.com/pull-requests/4e1a6609-1a29-4037-a411-89ecc14c6cd8/tasks', [
  'body' => '{
  "action": "decline",
  "comment": "Missing descriptions in requests"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp Decline
using RestSharp;

var client = new RestClient("https://api.getpostman.com/pull-requests/4e1a6609-1a29-4037-a411-89ecc14c6cd8/tasks");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"action\": \"decline\",\n  \"comment\": \"Missing descriptions in requests\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Decline
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "action": "decline",
  "comment": "Missing descriptions in requests"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.getpostman.com/pull-requests/4e1a6609-1a29-4037-a411-89ecc14c6cd8/tasks")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Unapprove



**Request**

```json
{
  "action": "unapprove"
}
```

**Response**

```json
{
  "id": "4e1a6609-1a29-4037-a411-89ecc14c6cd8",
  "reviewedBy": {
    "id": 12345678,
    "name": "Taylor Lee",
    "username": "taylor-lee"
  },
  "status": "approved",
  "updatedAt": "2024-02-21T08:19:09.000Z"
}
```

**SDK Code**

```python Unapprove
import requests

url = "https://api.getpostman.com/pull-requests/4e1a6609-1a29-4037-a411-89ecc14c6cd8/tasks"

payload = { "action": "unapprove" }
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Unapprove
const url = 'https://api.getpostman.com/pull-requests/4e1a6609-1a29-4037-a411-89ecc14c6cd8/tasks';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"action":"unapprove"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Unapprove
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.getpostman.com/pull-requests/4e1a6609-1a29-4037-a411-89ecc14c6cd8/tasks"

	payload := strings.NewReader("{\n  \"action\": \"unapprove\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("x-api-key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Unapprove
require 'uri'
require 'net/http'

url = URI("https://api.getpostman.com/pull-requests/4e1a6609-1a29-4037-a411-89ecc14c6cd8/tasks")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"action\": \"unapprove\"\n}"

response = http.request(request)
puts response.read_body
```

```java Unapprove
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.getpostman.com/pull-requests/4e1a6609-1a29-4037-a411-89ecc14c6cd8/tasks")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"action\": \"unapprove\"\n}")
  .asString();
```

```php Unapprove
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.getpostman.com/pull-requests/4e1a6609-1a29-4037-a411-89ecc14c6cd8/tasks', [
  'body' => '{
  "action": "unapprove"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp Unapprove
using RestSharp;

var client = new RestClient("https://api.getpostman.com/pull-requests/4e1a6609-1a29-4037-a411-89ecc14c6cd8/tasks");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"action\": \"unapprove\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Unapprove
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = ["action": "unapprove"] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.getpostman.com/pull-requests/4e1a6609-1a29-4037-a411-89ecc14c6cd8/tasks")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```