Monitor downtimes let you schedule periods when your synthetic monitors stop running. This is useful during planned maintenance, deployments, or known outages when you don't want to receive alerts. You can create one-time downtimes or recurring schedules (daily, weekly, or monthly). This tutorial provides examples of how to use the NerdGraph API to programmatically manage monitor downtimes. To manage monitor downtimes using the UI, refer to Disable monitoring during scheduled maintenance times.
Tip
For timezone values, refer to the tz database of time zones. For example, use America/Los_Angeles for Pacific Time.
Create a one-time monitor downtime
You can create a one-time monitor downtime using the syntheticsCreateOnceMonitorDowntime mutation. Use this for planned maintenance or events that happen only once.
Input parameters
Parameter | Data Type | Is it Required? | Description |
|---|---|---|---|
| Integer | Yes | The New Relic account ID where the downtime will be created. |
| String | Yes | A descriptive name for the downtime period. |
| Array | No | List of monitor GUIDs to include in the downtime. Leave empty to apply to all monitors. |
| String | Yes | The timezone for the downtime schedule (e.g., |
| String | Yes | When the downtime starts in |
| String | Yes | When the downtime ends in |
Sample request
mutation { syntheticsCreateOnceMonitorDowntime( accountId: ACCOUNT_ID name: "MonitorDowntimeName" monitorGuids: ["OptionalMonitorEntityGuid", "OptionalMonitorEntityGuid"] timezone: "TIMEZONE" startTime: "yyyy-MM-ddTHH:mm:ss" endTime: "yyyy-MM-ddTHH:mm:ss" ) { guid accountId name monitorGuids timezone startTime endTime }}Create a daily recurring monitor downtime
You can create a daily recurring monitor downtime using the syntheticsCreateDailyMonitorDowntime mutation. Use this for regular maintenance windows that occur every day.
Input parameters
Parameter | Data Type | Is it Required? | Description |
|---|---|---|---|
| Integer | Yes | The New Relic account ID where the downtime will be created. |
| String | Yes | A descriptive name for the recurring downtime. |
| Array | No | List of monitor GUIDs to include in the downtime. |
| String | Yes | The timezone for the downtime schedule. |
| String | Yes | Daily start time in |
| String | Yes | Daily end time in |
| Object | No | When to stop the recurring downtime. Use |
Sample request
mutation { syntheticsCreateDailyMonitorDowntime( accountId: ACCOUNT_ID name: "MonitorDowntimeName" monitorGuids: [ "OptionalMonitorEntityGuid" "AnotherOptionalMonitorEntityGuid" ] timezone: "TIMEZONE" startTime: "yyyy-MM-ddTHH:mm:ss" endTime: "yyyy-MM-ddTHH:mm:ss" endRepeat: { onDate: "yyyy-MM-ddTHH:mm:ss", onRepeat: 10 } ) { guid accountId name monitorGuids timezone startTime endTime endRepeat { onDate onRepeat } }}Create a weekly recurring monitor downtime
You can create a weekly recurring monitor downtime using the syntheticsCreateWeeklyMonitorDowntime mutation. Use this for maintenance windows that occur on specific days of the week.
Input parameters
Parameter | Data Type | Is it Required? | Description |
|---|---|---|---|
| Integer | Yes | The New Relic account ID where the downtime will be created. |
| String | Yes | A descriptive name for the weekly downtime. |
| Array | No | List of monitor GUIDs to include in the downtime. |
| String | Yes | The timezone for the downtime schedule. |
| String | Yes | Weekly start time in |
| String | Yes | Weekly end time in |
| Array | Yes | Days of the week (e.g., |
| Object | No | When to stop the recurring downtime. |
Sample request
mutation { syntheticsCreateWeeklyMonitorDowntime( accountId: ACCOUNT_ID name: "MonitorDowntimeName" monitorGuids: [ "OptionalMonitorEntityGuid" "AnotherOptionalMonitorEntityGuid" ] timezone: "TIMEZONE" startTime: "yyyy-MM-ddTHH:mm:ss" endTime: "yyyy-MM-ddTHH:mm:ss" maintenanceDays: [MONDAY, WEDNESDAY, FRIDAY] endRepeat: { onDate: "yyyy-MM-ddTHH:mm:ss", onRepeat: 20 } ) { guid accountId name monitorGuids timezone startTime endTime maintenanceDays endRepeat { onDate onRepeat } }}Create a monthly recurring monitor downtime
You can create a monthly recurring monitor downtime using the syntheticsCreateMonthlyMonitorDowntime mutation. Use this for maintenance windows that occur on specific days each month.
Input parameters
Parameter | Data Type | Is it Required? | Description |
|---|---|---|---|
| Integer | Yes | The New Relic account ID where the downtime will be created. |
| String | Yes | A descriptive name for the monthly downtime. |
| Array | No | List of monitor GUIDs to include in the downtime. |
| String | Yes | The timezone for the downtime schedule. |
| String | Yes | Monthly start time in |
| String | Yes | Monthly end time in |
| Object | Yes | Defines when in the month the downtime occurs. Use |
| Object | No | When to stop the recurring downtime. |
Sample request
mutation { syntheticsCreateMonthlyMonitorDowntime( accountId: ACCOUNT_ID name: "MonitorDowntimeName" monitorGuids: [ "OptionalMonitorEntityGuid" "AnotherOptionalMonitorEntityGuid" ] timezone: "TIMEZONE" startTime: "yyyy-MM-ddTHH:mm:ss" endTime: "yyyy-MM-ddTHH:mm:ss" frequency: { daysOfWeek: { weekDay: MONDAY, ordinalDayOfMonth: FIRST } daysOfMonth: [15] } endRepeat: { onDate: "yyyy-MM-ddTHH:mm:ss", onRepeat: 12 } ) { guid accountId name monitorGuids timezone startTime endTime frequency { daysOfWeek { weekDay ordinalDayOfMonth } daysOfMonth } endRepeat { onDate onRepeat } }}Update a monitor downtime
You can update an existing monitor downtime using the syntheticsEditMonitorDowntime mutation. This allows you to modify any downtime type (once, daily, weekly, or monthly) using this single mutation.
Input parameters
Parameter | Data Type | Is it Required? | Description |
|---|---|---|---|
| String | Yes | The GUID of the existing monitor downtime to update. |
| String | No | Updated name for the downtime. |
| Array | No | Updated list of monitor GUIDs. |
| Object | No | Configuration for one-time downtime. |
| Object | No | Configuration for daily recurring downtime. |
| Object | No | Configuration for weekly recurring downtime. |
| Object | No | Configuration for monthly recurring downtime. |
Sample request
mutation { syntheticsEditMonitorDowntime( guid: "MonitorDowntimeEntityGuid" name: "MONITOR_DOWNTIME_NAME" monitorGuids: [ "OptionalMonitorEntityGuid" "AnotherOptionalMonitorEntityGuid" ] once: { timezone: "TIMEZONE" startTime: "yyyy-MM-ddTHH:mm:ss" endTime: "yyyy-MM-ddTHH:mm:ss" } daily: { timezone: "TIMEZONE" startTime: "yyyy-MM-ddTHH:mm:ss" endTime: "yyyy-MM-ddTHH:mm:ss" endRepeat: { onDate: "yyyy-MM-ddTHH:mm:ss", onRepeat: 30 } } weekly: { timezone: "TIMEZONE" startTime: "yyyy-MM-ddTHH:mm:ss" endTime: "yyyy-MM-ddTHH:mm:ss" endRepeat: { onDate: "yyyy-MM-ddTHH:mm:ss", onRepeat: 20 } maintenanceDays: [MONDAY, WEDNESDAY] } monthly: { timezone: "TIMEZONE" startTime: "yyyy-MM-ddTHH:mm:ss" endTime: "yyyy-MM-ddTHH:mm:ss" endRepeat: { onDate: "yyyy-MM-ddTHH:mm:ss", onRepeat: 12 } frequency: { daysOfWeek: { weekDay: MONDAY, ordinalDayOfMonth: FIRST } daysOfMonth: [15] } } ) { guid accountId name monitorGuids timezone startTime endTime endRepeat { onDate onRepeat } maintenanceDays frequency { daysOfWeek { weekDay ordinalDayOfMonth } daysOfMonth } }}Delete a monitor downtime
You can delete a monitor downtime using the syntheticsDeleteMonitorDowntime mutation. Once deleted, the scheduled downtime will be removed and monitors will resume their normal schedule.
Input parameters
Parameter | Data Type | Is it Required? | Description |
|---|---|---|---|
| String | Yes | The GUID of the monitor downtime to delete. |
Sample request
mutation { syntheticsDeleteMonitorDowntime(guid: "DOWNTIME_ENTITY_GUID") { guid }}