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:
Frequency | Cron Pattern |
---|---|
Every 5 minutes | \\\\\\\\\\\\\\\\\\\\\*/5 \\\\\\\\\\\\\\\\\\\\\* \\\\\\\\\\\\\\\\\\\\\* \\\\\\\\\\\\\\\\\\\\\* \\\\\\\\\\\\\\\\\\\\\* |
Every 30 minutes | \\\\\\\\\\\\\\\\\\\\\*/30 \\\\\\\\\\\\\\\\\\\\\* \\\\\\\\\\\\\\\\\\\\\* \\\\\\\\\\\\\\\\\\\\\* \\\\\\\\\\\\\\\\\\\\\* |
Every Hour | 0 \\\\\\\\\\\\\\\\\\\\\*/1 \\\\\\\\\\\\\\\\\\\\\* \\\\\\\\\\\\\\\\\\\\\* \\\\\\\\\\\\\\\\\\\\\* |
Every 6 Hours | 0 \\\\\\\\\\\\\\\\\\\\\*/6 \\\\\\\\\\\\\\\\\\\\\* \\\\\\\\\\\\\\\\\\\\\* \\\\\\\\\\\\\\\\\\\\\* |
Every day at 5pm | 0 17 \\\\\\\\\\\\\\\\\\\\\* \\\\\\\\\\\\\\\\\\\\\* \\\\\\\\\\\\\\\\\\\\\* |
Every Monday at 12pm | 0 12 \\\\\\\\\\\\\\\\\\\\\* \\\\\\\\\\\\\\\\\\\\\* MON |
Every weekday (Monday - Friday) at 6am | 0 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
- Checks for a 200 HTTP response to confirm that the new Monitor has been created.
- Parse the Response.
- Sets the new ID as the value for
monitorUid
Collection Variable.
Request Params
Key | Datatype | Required | Description |
---|---|---|---|
workspace | string |
Request Body
{"monitor"=>{"name"=>"Scaffolded Monitor | {{today}}", "schedule"=>{"cron"=>"*/5 * * * *", "timezone"=>"America/Cancun"}, "collection"=>"{{secondCollectionUid}}", "environment"=>"{{environmentUid}}"}}
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
Content-Type | string |
RESPONSES
status: OK
{"monitor":{"id":"1e6b6dfd-7ba4-4590-9ee1-5948102d7797","name":"Monitor Name","uid":"5852-1e6b6dfd-7ba4-4590-9ee1-5948102d7797"}}