> 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.

# Update a monitor

PUT https://api.getpostman.com/monitors/{monitorId}
Content-Type: application/json

Updates a monitor's [configurations](https://learning.postman.com/docs/monitoring-your-api/setting-up-monitor/#configure-a-monitor).

Reference: https://learning.postman.com/api-docs/api-reference/monitors/update-monitor

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: Postman API
  version: 1.0.0
paths:
  /monitors/{monitorId}:
    put:
      operationId: updateMonitor
      summary: Update a monitor
      description: >-
        Updates a monitor's
        [configurations](https://learning.postman.com/docs/monitoring-your-api/setting-up-monitor/#configure-a-monitor).
      tags:
        - monitors
      parameters:
        - name: monitorId
          in: path
          description: The monitor's ID.
          required: true
          schema:
            $ref: '#/components/schemas/monitorId'
        - name: x-api-key
          in: header
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/createUpdateMonitorResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateMonitorRequestBadRequestError'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateMonitorRequestUnauthorizedError'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateMonitorRequestForbiddenError'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/commonErrorNameMessage'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateMonitorRequestInternalServerError'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/updateMonitor'
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:
    monitorId:
      type: string
      title: monitorId
    monitorRetry:
      type: object
      properties:
        attempts:
          type: number
          format: double
          description: >-
            The number of times to reattempt a monitor run if it fails or
            errors. This may impact your [monitor
            usage](https://learning.postman.com/docs/monitoring-your-api/monitor-usage/#view-monitor-usage).
      description: Information about the monitor's retry settings.
      title: monitorRetry
    monitorOptions:
      type: object
      properties:
        followRedirects:
          type: boolean
          description: If true, follow redirects enabled.
        requestDelay:
          type: number
          format: double
          description: The monitor's request delay value, in milliseconds.
        requestTimeout:
          type: number
          format: double
          description: The monitor's request timeout value, in milliseconds.
        strictSSL:
          type: boolean
          description: If true, strict SSL enabled.
      description: Information about the monitor's option settings.
      title: monitorOptions
    monitorSchedule:
      type: object
      properties:
        cron:
          type: string
          description: >
            The monitor's run frequency, based on the given POSIX cron pattern.
            For example:

            - Every 5 minutes — `*/5 * * * *`

            - Every 30 minutes — `*/30 * * * *`

            - Every hour — `0 */1 * * *`

            - Every 6 hours — `0 */6 * * *`

            - Every day at 5 pm — `0 17 * * *`

            - Every Monday at 12 pm — `0 12 * * MON`

            - Every weekday (Mon — Fri) at 6 am — `0 6 * * MON-FRI`
        timezone:
          type: string
          description: >-
            The monitor's
            [timezone](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).
      description: Information about the monitor's schedule.
      title: monitorSchedule
    MonitorDistributionItemsRegion:
      type: string
      enum:
        - us-east
        - us-west
        - ap-southeast
        - ca-central
        - eu-central
        - sa-east
        - uk
        - us-east-staticip
        - us-west-staticip
      description: The assigned distribution region.
      title: MonitorDistributionItemsRegion
    MonitorDistributionItems:
      type: object
      properties:
        region:
          $ref: '#/components/schemas/MonitorDistributionItemsRegion'
          description: The assigned distribution region.
      title: MonitorDistributionItems
    monitorDistribution:
      type: array
      items:
        $ref: '#/components/schemas/MonitorDistributionItems'
      description: >-
        A list of the monitor's [geographic
        regions](https://learning.postman.com/docs/monitoring-your-api/setting-up-monitor/#add-regions).
      title: monitorDistribution
    MonitorNotificationsOnErrorItems:
      type: object
      properties:
        email:
          type: string
          format: email
          description: The email address of the user to notify on monitor error.
      title: MonitorNotificationsOnErrorItems
    MonitorNotificationsOnFailureItems:
      type: object
      properties:
        email:
          type: string
          format: email
          description: The email address of the user to notify on monitor failure.
      title: MonitorNotificationsOnFailureItems
    monitorNotifications:
      type: object
      properties:
        onError:
          type: array
          items:
            $ref: '#/components/schemas/MonitorNotificationsOnErrorItems'
        onFailure:
          type: array
          items:
            $ref: '#/components/schemas/MonitorNotificationsOnFailureItems'
      description: Information about the monitor's notification settings.
      title: monitorNotifications
    UpdateMonitorMonitor:
      type: object
      properties:
        name:
          type: string
          description: The monitor's name.
        active:
          type: boolean
          default: true
          description: If true, the monitor is active and makes calls to the specified URL.
        notificationLimit:
          type: number
          format: double
          description: >-
            Stop email notifications after the given number consecutive
            failures.
        retry:
          $ref: '#/components/schemas/monitorRetry'
        options:
          $ref: '#/components/schemas/monitorOptions'
        schedule:
          $ref: '#/components/schemas/monitorSchedule'
        distribution:
          $ref: '#/components/schemas/monitorDistribution'
        notifications:
          $ref: '#/components/schemas/monitorNotifications'
      description: Information about the monitor.
      title: UpdateMonitorMonitor
    updateMonitor:
      type: object
      properties:
        monitor:
          $ref: '#/components/schemas/UpdateMonitorMonitor'
          description: Information about the monitor.
      title: updateMonitor
    CreateUpdateMonitorResponseMonitor:
      type: object
      properties:
        id:
          type: string
          description: The monitor's ID.
        name:
          type: string
          description: The monitor's name.
        active:
          type: boolean
          default: true
          description: If true, the monitor is active and makes calls to the specified URL.
        uid:
          type: string
          format: uid
          description: The monitor's unique ID.
      description: Information about the monitor.
      title: CreateUpdateMonitorResponseMonitor
    createUpdateMonitorResponse:
      type: object
      properties:
        monitor:
          $ref: '#/components/schemas/CreateUpdateMonitorResponseMonitor'
          description: Information about the monitor.
      title: createUpdateMonitorResponse
    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
    CommonErrorNameMessageDetailsErrorDetails:
      oneOf:
        - type: object
          additionalProperties:
            description: Any type
        - type: array
          items:
            type: string
      description: Information about the error.
      title: CommonErrorNameMessageDetailsErrorDetails
    CommonErrorNameMessageDetailsError:
      type: object
      properties:
        name:
          type: string
          description: The error name.
        message:
          type: string
          description: The error message.
        details:
          $ref: '#/components/schemas/CommonErrorNameMessageDetailsErrorDetails'
          description: Information about the error.
      title: CommonErrorNameMessageDetailsError
    commonErrorNameMessageDetails:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/CommonErrorNameMessageDetailsError'
      title: commonErrorNameMessageDetails
    UpdateMonitorRequestBadRequestError:
      oneOf:
        - $ref: '#/components/schemas/commonErrorNameMessage'
        - $ref: '#/components/schemas/commonErrorNameMessageDetails'
      title: UpdateMonitorRequestBadRequestError
    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
    UpdateMonitorRequestUnauthorizedError:
      oneOf:
        - $ref: '#/components/schemas/commonErrorTypeTitleDetailStatus'
        - $ref: '#/components/schemas/commonErrorNameMessage'
      title: UpdateMonitorRequestUnauthorizedError
    UpdateMonitorRequestForbiddenError:
      oneOf:
        - $ref: '#/components/schemas/commonErrorTypeTitleDetailStatus'
        - $ref: '#/components/schemas/commonErrorNameMessage'
      title: UpdateMonitorRequestForbiddenError
    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
    UpdateMonitorRequestInternalServerError:
      oneOf:
        - $ref: '#/components/schemas/commonErrorTypeTitleDetail'
        - $ref: '#/components/schemas/commonErrorTypeTitleDetailStatus'
        - $ref: '#/components/schemas/commonErrorNameMessage'
      title: UpdateMonitorRequestInternalServerError
  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

### Monitor Updated



**Request**

```json
undefined
```

**Response**

```json
{
  "monitor": {
    "id": "1e6b6cc1-c760-48e0-968f-4bfaeeae9af1",
    "name": "Test Monitor",
    "active": true,
    "uid": "12345678-1e6b6cc1-c760-48e0-968f-4bfaeeae9af1"
  }
}
```

**SDK Code**

```python Monitor Updated
import requests

url = "https://api.getpostman.com/monitors/1e6b6cc1-c760-48e0-968f-4bfaeeae9af1"

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

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

print(response.json())
```

```javascript Monitor Updated
const url = 'https://api.getpostman.com/monitors/1e6b6cc1-c760-48e0-968f-4bfaeeae9af1';
const options = {
  method: 'PUT',
  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 Monitor Updated
package main

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

func main() {

	url := "https://api.getpostman.com/monitors/1e6b6cc1-c760-48e0-968f-4bfaeeae9af1"

	req, _ := http.NewRequest("PUT", 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 Monitor Updated
require 'uri'
require 'net/http'

url = URI("https://api.getpostman.com/monitors/1e6b6cc1-c760-48e0-968f-4bfaeeae9af1")

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

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

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

```java Monitor Updated
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.put("https://api.getpostman.com/monitors/1e6b6cc1-c760-48e0-968f-4bfaeeae9af1")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://api.getpostman.com/monitors/1e6b6cc1-c760-48e0-968f-4bfaeeae9af1', [
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Monitor Updated
using RestSharp;

var client = new RestClient("https://api.getpostman.com/monitors/1e6b6cc1-c760-48e0-968f-4bfaeeae9af1");
var request = new RestRequest(Method.PUT);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
IRestResponse response = client.Execute(request);
```

```swift Monitor Updated
import Foundation

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.getpostman.com/monitors/1e6b6cc1-c760-48e0-968f-4bfaeeae9af1")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
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()
```

### Update Monitor



**Request**

```json
{
  "monitor": {
    "name": "Test Monitor",
    "notificationLimit": 1,
    "retry": {
      "attempts": 2
    },
    "options": {
      "followRedirects": true,
      "requestDelay": 1,
      "requestTimeout": 5000,
      "strictSSL": false
    },
    "schedule": {
      "cron": "*/5 * * * *",
      "timezone": "America/Chicago"
    },
    "distribution": [
      {
        "region": "ca-central"
      }
    ],
    "notifications": {
      "onError": [
        {
          "email": "taylor.lee@example.com"
        }
      ],
      "onFailure": [
        {
          "email": "taylor.lee@example.com"
        }
      ]
    }
  }
}
```

**Response**

```json
{
  "monitor": {
    "id": "1e6b6cc1-c760-48e0-968f-4bfaeeae9af1",
    "name": "Test Monitor",
    "active": true,
    "uid": "12345678-1e6b6cc1-c760-48e0-968f-4bfaeeae9af1"
  }
}
```

**SDK Code**

```python Update Monitor
import requests

url = "https://api.getpostman.com/monitors/1e6b6cc1-c760-48e0-968f-4bfaeeae9af1"

payload = { "monitor": {
        "name": "Test Monitor",
        "notificationLimit": 1,
        "retry": { "attempts": 2 },
        "options": {
            "followRedirects": True,
            "requestDelay": 1,
            "requestTimeout": 5000,
            "strictSSL": False
        },
        "schedule": {
            "cron": "*/5 * * * *",
            "timezone": "America/Chicago"
        },
        "distribution": [{ "region": "ca-central" }],
        "notifications": {
            "onError": [{ "email": "taylor.lee@example.com" }],
            "onFailure": [{ "email": "taylor.lee@example.com" }]
        }
    } }
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Update Monitor
const url = 'https://api.getpostman.com/monitors/1e6b6cc1-c760-48e0-968f-4bfaeeae9af1';
const options = {
  method: 'PUT',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"monitor":{"name":"Test Monitor","notificationLimit":1,"retry":{"attempts":2},"options":{"followRedirects":true,"requestDelay":1,"requestTimeout":5000,"strictSSL":false},"schedule":{"cron":"*/5 * * * *","timezone":"America/Chicago"},"distribution":[{"region":"ca-central"}],"notifications":{"onError":[{"email":"taylor.lee@example.com"}],"onFailure":[{"email":"taylor.lee@example.com"}]}}}'
};

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

```go Update Monitor
package main

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

func main() {

	url := "https://api.getpostman.com/monitors/1e6b6cc1-c760-48e0-968f-4bfaeeae9af1"

	payload := strings.NewReader("{\n  \"monitor\": {\n    \"name\": \"Test Monitor\",\n    \"notificationLimit\": 1,\n    \"retry\": {\n      \"attempts\": 2\n    },\n    \"options\": {\n      \"followRedirects\": true,\n      \"requestDelay\": 1,\n      \"requestTimeout\": 5000,\n      \"strictSSL\": false\n    },\n    \"schedule\": {\n      \"cron\": \"*/5 * * * *\",\n      \"timezone\": \"America/Chicago\"\n    },\n    \"distribution\": [\n      {\n        \"region\": \"ca-central\"\n      }\n    ],\n    \"notifications\": {\n      \"onError\": [\n        {\n          \"email\": \"taylor.lee@example.com\"\n        }\n      ],\n      \"onFailure\": [\n        {\n          \"email\": \"taylor.lee@example.com\"\n        }\n      ]\n    }\n  }\n}")

	req, _ := http.NewRequest("PUT", 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 Update Monitor
require 'uri'
require 'net/http'

url = URI("https://api.getpostman.com/monitors/1e6b6cc1-c760-48e0-968f-4bfaeeae9af1")

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

request = Net::HTTP::Put.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"monitor\": {\n    \"name\": \"Test Monitor\",\n    \"notificationLimit\": 1,\n    \"retry\": {\n      \"attempts\": 2\n    },\n    \"options\": {\n      \"followRedirects\": true,\n      \"requestDelay\": 1,\n      \"requestTimeout\": 5000,\n      \"strictSSL\": false\n    },\n    \"schedule\": {\n      \"cron\": \"*/5 * * * *\",\n      \"timezone\": \"America/Chicago\"\n    },\n    \"distribution\": [\n      {\n        \"region\": \"ca-central\"\n      }\n    ],\n    \"notifications\": {\n      \"onError\": [\n        {\n          \"email\": \"taylor.lee@example.com\"\n        }\n      ],\n      \"onFailure\": [\n        {\n          \"email\": \"taylor.lee@example.com\"\n        }\n      ]\n    }\n  }\n}"

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

```java Update Monitor
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.put("https://api.getpostman.com/monitors/1e6b6cc1-c760-48e0-968f-4bfaeeae9af1")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"monitor\": {\n    \"name\": \"Test Monitor\",\n    \"notificationLimit\": 1,\n    \"retry\": {\n      \"attempts\": 2\n    },\n    \"options\": {\n      \"followRedirects\": true,\n      \"requestDelay\": 1,\n      \"requestTimeout\": 5000,\n      \"strictSSL\": false\n    },\n    \"schedule\": {\n      \"cron\": \"*/5 * * * *\",\n      \"timezone\": \"America/Chicago\"\n    },\n    \"distribution\": [\n      {\n        \"region\": \"ca-central\"\n      }\n    ],\n    \"notifications\": {\n      \"onError\": [\n        {\n          \"email\": \"taylor.lee@example.com\"\n        }\n      ],\n      \"onFailure\": [\n        {\n          \"email\": \"taylor.lee@example.com\"\n        }\n      ]\n    }\n  }\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://api.getpostman.com/monitors/1e6b6cc1-c760-48e0-968f-4bfaeeae9af1', [
  'body' => '{
  "monitor": {
    "name": "Test Monitor",
    "notificationLimit": 1,
    "retry": {
      "attempts": 2
    },
    "options": {
      "followRedirects": true,
      "requestDelay": 1,
      "requestTimeout": 5000,
      "strictSSL": false
    },
    "schedule": {
      "cron": "*/5 * * * *",
      "timezone": "America/Chicago"
    },
    "distribution": [
      {
        "region": "ca-central"
      }
    ],
    "notifications": {
      "onError": [
        {
          "email": "taylor.lee@example.com"
        }
      ],
      "onFailure": [
        {
          "email": "taylor.lee@example.com"
        }
      ]
    }
  }
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Update Monitor
using RestSharp;

var client = new RestClient("https://api.getpostman.com/monitors/1e6b6cc1-c760-48e0-968f-4bfaeeae9af1");
var request = new RestRequest(Method.PUT);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"monitor\": {\n    \"name\": \"Test Monitor\",\n    \"notificationLimit\": 1,\n    \"retry\": {\n      \"attempts\": 2\n    },\n    \"options\": {\n      \"followRedirects\": true,\n      \"requestDelay\": 1,\n      \"requestTimeout\": 5000,\n      \"strictSSL\": false\n    },\n    \"schedule\": {\n      \"cron\": \"*/5 * * * *\",\n      \"timezone\": \"America/Chicago\"\n    },\n    \"distribution\": [\n      {\n        \"region\": \"ca-central\"\n      }\n    ],\n    \"notifications\": {\n      \"onError\": [\n        {\n          \"email\": \"taylor.lee@example.com\"\n        }\n      ],\n      \"onFailure\": [\n        {\n          \"email\": \"taylor.lee@example.com\"\n        }\n      ]\n    }\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Update Monitor
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = ["monitor": [
    "name": "Test Monitor",
    "notificationLimit": 1,
    "retry": ["attempts": 2],
    "options": [
      "followRedirects": true,
      "requestDelay": 1,
      "requestTimeout": 5000,
      "strictSSL": false
    ],
    "schedule": [
      "cron": "*/5 * * * *",
      "timezone": "America/Chicago"
    ],
    "distribution": [["region": "ca-central"]],
    "notifications": [
      "onError": [["email": "taylor.lee@example.com"]],
      "onFailure": [["email": "taylor.lee@example.com"]]
    ]
  ]] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.getpostman.com/monitors/1e6b6cc1-c760-48e0-968f-4bfaeeae9af1")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
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()
```

### Pause Monitor



**Request**

```json
{
  "monitor": {
    "active": false
  }
}
```

**Response**

```json
{
  "monitor": {
    "id": "1e6b6cc1-c760-48e0-968f-4bfaeeae9af1",
    "name": "Test Monitor",
    "active": true,
    "uid": "12345678-1e6b6cc1-c760-48e0-968f-4bfaeeae9af1"
  }
}
```

**SDK Code**

```python Pause Monitor
import requests

url = "https://api.getpostman.com/monitors/1e6b6cc1-c760-48e0-968f-4bfaeeae9af1"

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

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

print(response.json())
```

```javascript Pause Monitor
const url = 'https://api.getpostman.com/monitors/1e6b6cc1-c760-48e0-968f-4bfaeeae9af1';
const options = {
  method: 'PUT',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"monitor":{"active":false}}'
};

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

```go Pause Monitor
package main

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

func main() {

	url := "https://api.getpostman.com/monitors/1e6b6cc1-c760-48e0-968f-4bfaeeae9af1"

	payload := strings.NewReader("{\n  \"monitor\": {\n    \"active\": false\n  }\n}")

	req, _ := http.NewRequest("PUT", 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 Pause Monitor
require 'uri'
require 'net/http'

url = URI("https://api.getpostman.com/monitors/1e6b6cc1-c760-48e0-968f-4bfaeeae9af1")

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

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

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

```java Pause Monitor
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.put("https://api.getpostman.com/monitors/1e6b6cc1-c760-48e0-968f-4bfaeeae9af1")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"monitor\": {\n    \"active\": false\n  }\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://api.getpostman.com/monitors/1e6b6cc1-c760-48e0-968f-4bfaeeae9af1', [
  'body' => '{
  "monitor": {
    "active": false
  }
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Pause Monitor
using RestSharp;

var client = new RestClient("https://api.getpostman.com/monitors/1e6b6cc1-c760-48e0-968f-4bfaeeae9af1");
var request = new RestRequest(Method.PUT);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"monitor\": {\n    \"active\": false\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Pause Monitor
import Foundation

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

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.getpostman.com/monitors/1e6b6cc1-c760-48e0-968f-4bfaeeae9af1")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
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()
```

### Resume Monitor



**Request**

```json
{
  "monitor": {
    "active": true
  }
}
```

**Response**

```json
{
  "monitor": {
    "id": "1e6b6cc1-c760-48e0-968f-4bfaeeae9af1",
    "name": "Test Monitor",
    "active": true,
    "uid": "12345678-1e6b6cc1-c760-48e0-968f-4bfaeeae9af1"
  }
}
```

**SDK Code**

```python Resume Monitor
import requests

url = "https://api.getpostman.com/monitors/1e6b6cc1-c760-48e0-968f-4bfaeeae9af1"

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

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

print(response.json())
```

```javascript Resume Monitor
const url = 'https://api.getpostman.com/monitors/1e6b6cc1-c760-48e0-968f-4bfaeeae9af1';
const options = {
  method: 'PUT',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"monitor":{"active":true}}'
};

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

```go Resume Monitor
package main

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

func main() {

	url := "https://api.getpostman.com/monitors/1e6b6cc1-c760-48e0-968f-4bfaeeae9af1"

	payload := strings.NewReader("{\n  \"monitor\": {\n    \"active\": true\n  }\n}")

	req, _ := http.NewRequest("PUT", 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 Resume Monitor
require 'uri'
require 'net/http'

url = URI("https://api.getpostman.com/monitors/1e6b6cc1-c760-48e0-968f-4bfaeeae9af1")

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

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

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

```java Resume Monitor
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.put("https://api.getpostman.com/monitors/1e6b6cc1-c760-48e0-968f-4bfaeeae9af1")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"monitor\": {\n    \"active\": true\n  }\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://api.getpostman.com/monitors/1e6b6cc1-c760-48e0-968f-4bfaeeae9af1', [
  'body' => '{
  "monitor": {
    "active": true
  }
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Resume Monitor
using RestSharp;

var client = new RestClient("https://api.getpostman.com/monitors/1e6b6cc1-c760-48e0-968f-4bfaeeae9af1");
var request = new RestRequest(Method.PUT);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"monitor\": {\n    \"active\": true\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Resume Monitor
import Foundation

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

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.getpostman.com/monitors/1e6b6cc1-c760-48e0-968f-4bfaeeae9af1")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
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()
```