Create Monitor

POST https://api.getpostman.com/monitors?workspace={{workspaceId}}

Create Monitor

Creates a Monitor within a Workspace.

Overview

Body tab

  • Monitor — An object containing new Monitor information:
    • name — A string containing the name of the Monitor.
    • schedule — An object containing cron and timezone key/values which controls the scheduling of the Monitor runs.
    • collection — A string containing the UID of the Collection to which a Monitor will be applied.
    • environment — A string containing the UID of the Environment to which the Monitor will be applied.

Some sample cron values are:

FrequencyCron Pattern
Every 5 minutes\\\\\\\\\\\\\\\\\\\\\*/5 \\\\\\\\\\\\\\\\\\\\\* \\\\\\\\\\\\\\\\\\\\\* \\\\\\\\\\\\\\\\\\\\\* \\\\\\\\\\\\\\\\\\\\\*
Every 30 minutes\\\\\\\\\\\\\\\\\\\\\*/30 \\\\\\\\\\\\\\\\\\\\\* \\\\\\\\\\\\\\\\\\\\\* \\\\\\\\\\\\\\\\\\\\\* \\\\\\\\\\\\\\\\\\\\\*
Every Hour0 \\\\\\\\\\\\\\\\\\\\\*/1 \\\\\\\\\\\\\\\\\\\\\* \\\\\\\\\\\\\\\\\\\\\* \\\\\\\\\\\\\\\\\\\\\*
Every 6 Hours0 \\\\\\\\\\\\\\\\\\\\\*/6 \\\\\\\\\\\\\\\\\\\\\* \\\\\\\\\\\\\\\\\\\\\* \\\\\\\\\\\\\\\\\\\\\*
Every day at 5pm0 17 \\\\\\\\\\\\\\\\\\\\\* \\\\\\\\\\\\\\\\\\\\\* \\\\\\\\\\\\\\\\\\\\\*
Every Monday at 12pm0 12 \\\\\\\\\\\\\\\\\\\\\* \\\\\\\\\\\\\\\\\\\\\* MON
Every weekday (Monday - Friday) at 6am0 6 \\\\\\\\\\\\\\\\\\\\\* \\\\\\\\\\\\\\\\\\\\\* MON-FRI

For more information about the format of the timezone value, check this list of time zones.

Pre-request Script tab

Sends a message to the Console that the Request is starting to create a Monitor.

Tests tab

  1. Checks for a 200 HTTP response to confirm that the new Monitor has been created.
  2. Parse the Response.
  3. Sets the new ID as the value for monitorUid Collection Variable.

Request Params

KeyDatatypeRequiredDescription
workspacestring

Request Body

{"monitor"=>{"name"=>"Scaffolded Monitor | {{today}}", "schedule"=>{"cron"=>"*/5 * * * *", "timezone"=>"America/Cancun"}, "collection"=>"{{secondCollectionUid}}", "environment"=>"{{environmentUid}}"}}

HEADERS

KeyDatatypeRequiredDescription
Content-Typestring

RESPONSES

status: OK

{"monitor":{"id":"1e6b6dfd-7ba4-4590-9ee1-5948102d7797","name":"Monitor Name","uid":"5852-1e6b6dfd-7ba4-4590-9ee1-5948102d7797"}}