---
title: Manage step monitors
source: https://docs.newrelic.com/docs/apis/nerdgraph/examples/synthetics-api/step-monitor
---

New Relic allows you use NerdGraph to create [step monitors](https://docs.newrelic.com/docs/synthetics/synthetic-monitoring/using-monitors/add-edit-monitors). Step monitors provide codeless, multi-step browser-based monitoring that allows you to configure complex user workflows without writing any code. This tutorial provides examples of how to use the NerdGraph API to automate the creation of step monitors.

## Create a step monitor [#create-step-monitor]

You can create a step monitor using the `syntheticsCreateStepMonitor` mutation. This mutation allows you to set up multi-step browser monitoring with a series of predefined actions.

### Input parameters

| Parameter                                                    | Data Type | Is it Required? | Description                                                                                                                                                                                                                                                                                  |
| ------------------------------------------------------------ | --------- | --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `accountId`                                                  | Integer   | Yes             | Your New Relic [account ID](https://docs.newrelic.com/docs/accounts/accounts-billing/account-structure/account-id) where the monitor will be created.                                                                                                                                        |
| `monitor.browsers`                                           | Array     | Yes             | Browser(s) that the monitor will use to execute jobs. Supported browsers: `CHROME`, `FIREFOX`.                                                                                                                                                                                               |
| `monitor.devices`                                            | Array     | Yes             | Devices that the monitor will use to execute jobs. Supported devices: `DESKTOP`, `MOBILE_LANDSCAPE`, `MOBILE_PORTRAIT`, `TABLET_LANDSCAPE`, `TABLET_PORTRAIT`.                                                                                                                               |
| `monitor.locations.public`                                   | Array     | Yes             | Array of [public location](https://docs.newrelic.com/docs/synthetics/synthetic-monitoring/using-monitors/add-edit-monitors/#setting-location) identifiers where the monitor will run checks (e.g., `["US_EAST_1", "US_WEST_1"]`).                                                            |
| `monitor.name`                                               | String    | Yes             | The display name for your step monitor.                                                                                                                                                                                                                                                      |
| `monitor.period`                                             | Enum      | Yes             | How often the monitor runs. Options: `EVERY_MINUTE`, `EVERY_5_MINUTES`, `EVERY_10_MINUTES`, `EVERY_15_MINUTES`, `EVERY_30_MINUTES`, `EVERY_HOUR`, `EVERY_6_HOURS`, `EVERY_12_HOURS`, `EVERY_DAY`.                                                                                            |
| `monitor.runtime.runtimeType`                                | String    | Yes             | The runtime type used by your monitor. `CHROME_BROWSER` is the only accepted value.                                                                                                                                                                                                          |
| `monitor.runtime.runtimeTypeVersion`                         | String    | Yes             | The runtime type version used by your monitor. Use `LATEST` to automatically use the most recent Chrome version (recommended). Older specific versions like `134` or `140` are also accepted but will be deprecated.                                                                         |
| `monitor.status`                                             | Enum      | Yes             | The monitor status. Options: `ENABLED` (monitor is active and performing checks), `DISABLED` (monitor is inactive).                                                                                                                                                                          |
| `monitor.steps`                                              | Array     | Yes             | The series of steps the monitor will execute. Each step object contains: `ordinal` (position of the step, 0-99), `type` (step type like `NAVIGATE`, `CLICK_ELEMENT`, `DOUBLE_CLICK_ELEMENT`, `ASSERT_TEXT`, `ASSERT_TITLE`, etc.), and `values` (array of values specific to the step type). |
| `monitor.advancedOptions.enableScreenshotOnFailureAndScript` | Boolean   | No              | Captures a screenshot during job execution when a failure occurs or a script is executed.                                                                                                                                                                                                    |
| `monitor.apdexTarget`                                        | Float     | No              | The monitor's Apdex target in seconds, used to populate SLA reports. Defaults to 7.0 seconds.                                                                                                                                                                                                |

### Sample request

```graphql
mutation {
  syntheticsCreateStepMonitor(
    accountId: ACCOUNT_ID
    monitor: {
      browsers: [BROWSERS]
      devices: [DEVICES]
      locations: { public: ["LOCATION_1", "LOCATION_2"] }
      name: "MONITOR_NAME"
      period: PERIOD
      runtime: {
        runtimeType: "RUNTIME_TYPE"
        runtimeTypeVersion: "RUNTIME_TYPE_VERSION"
      }
      status: STATUS
      steps: [
        {
          ordinal: 0,
          type: NAVIGATE,
          values: ["MONITORED_URI", "USER_AGENT"] }
        {
          ordinal: STEP_NUMBER
          type: STEP_TYPE
          values: ["CONDITIONAL_TYPE", "VALUE"]
        }
      ]
      advancedOptions: { enableScreenshotOnFailureAndScript: ENABLE_SCREENSHOT }
      apdexTarget: APDEX_TARGET
    }
  ) {
    errors {
      description
      type
    }
  }
}
```

### Sample response

A successful response returns `null` for errors:

```json
{
  "data": {
    "syntheticsCreateStepMonitor": {
      "errors": null
    }
  }
}
```

If there are any issues creating the monitor, the `errors` array will contain objects with `description` and `type` fields explaining what went wrong.

## Update a step monitor [#update-step-monitor]

You can update an existing step monitor using the `syntheticsUpdateStepMonitor` mutation. This allows you to modify the configuration of a step monitor that has already been created.

### Input parameters

| Parameter                                                    | Data Type | Is it Required? | Description                                                                                                                                                                                                                                                                                  |
| ------------------------------------------------------------ | --------- | --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `guid`                                                       | String    | Yes             | The unique entity [GUID](https://docs.newrelic.com/docs/apis/nerdgraph/examples/synthetics-api/query-synthetics-data#query-monitors) of the monitor you want to update.                                                                                                                      |
| `monitor.browsers`                                           | Array     | No              | Browser(s) that the monitor will use to execute jobs. Supported browsers: `CHROME`, `FIREFOX`.                                                                                                                                                                                               |
| `monitor.devices`                                            | Array     | No              | Devices that the monitor will use to execute jobs. Supported devices: `DESKTOP`, `MOBILE_LANDSCAPE`, `MOBILE_PORTRAIT`, `TABLET_LANDSCAPE`, `TABLET_PORTRAIT`.                                                                                                                               |
| `monitor.locations.public`                                   | Array     | No              | Array of [public location](https://docs.newrelic.com/docs/synthetics/synthetic-monitoring/using-monitors/add-edit-monitors/#setting-location) identifiers where the monitor will run checks (e.g., `["US_EAST_1", "US_WEST_1"]`).                                                            |
| `monitor.name`                                               | String    | No              | The updated display name for your step monitor.                                                                                                                                                                                                                                              |
| `monitor.period`                                             | Enum      | No              | How often the monitor runs. Options: `EVERY_MINUTE`, `EVERY_5_MINUTES`, `EVERY_10_MINUTES`, `EVERY_15_MINUTES`, `EVERY_30_MINUTES`, `EVERY_HOUR`, `EVERY_6_HOURS`, `EVERY_12_HOURS`, `EVERY_DAY`.                                                                                            |
| `monitor.runtime.runtimeType`                                | String    | No              | The runtime type used by your monitor. `CHROME_BROWSER` is the only accepted value.                                                                                                                                                                                                          |
| `monitor.runtime.runtimeTypeVersion`                         | String    | No              | The runtime type version used by your monitor. Use `LATEST` to automatically use the most recent Chrome version (recommended). Older specific versions like `134` or `140` are also accepted but will be deprecated.                                                                         |
| `monitor.status`                                             | Enum      | No              | The monitor status. Options: `ENABLED` (monitor is active and performing checks), `DISABLED` (monitor is inactive).                                                                                                                                                                          |
| `monitor.steps`                                              | Array     | No              | The series of steps the monitor will execute. Each step object contains: `ordinal` (position of the step, 0-99), `type` (step type like `NAVIGATE`, `CLICK_ELEMENT`, `DOUBLE_CLICK_ELEMENT`, `ASSERT_TEXT`, `ASSERT_TITLE`, etc.), and `values` (array of values specific to the step type). |
| `monitor.advancedOptions.enableScreenshotOnFailureAndScript` | Boolean   | No              | Captures a screenshot during job execution when a failure occurs or a script is executed.                                                                                                                                                                                                    |
| `monitor.apdexTarget`                                        | Float     | No              | The monitor's Apdex target in seconds, used to populate SLA reports. Defaults to 7.0 seconds.                                                                                                                                                                                                |

### Sample request

```graphql
mutation {
  syntheticsUpdateStepMonitor(
    guid: ENTITY_GUID
    monitor: {
      browsers: [BROWSERS]
      devices: [DEVICES]
      locations: { public: ["LOCATION_1", "LOCATION_2"] }
      name: "MONITOR_NAME"
      period: PERIOD
      runtime: {
        runtimeType: "RUNTIME_TYPE"
        runtimeTypeVersion: "RUNTIME_TYPE_VERSION"
      }
      status: STATUS
      steps: [
        {
          ordinal: 0,
          type: NAVIGATE,
          values: ["MONITORED_URI", "USER_AGENT"]
        }
        {
          ordinal: STEP_NUMBER,
          type: STEP_TYPE,
          values: ["VALUE_1", "VALUE_2"]
        }
      ]
      advancedOptions: { enableScreenshotOnFailureAndScript: ENABLE_SCREENSHOT }
      apdexTarget: APDEX_TARGET
    }
  ) {
    errors {
      description
      type
    }
  }
}
```

### Sample response

A successful response returns `null` for errors:

```json
{
  "data": {
    "syntheticsUpdateStepMonitor": {
      "errors": null
    }
  }
}
```

If there are any issues updating the monitor, the `errors` array will contain objects with `description` and `type` fields explaining what went wrong.

## Delete a step monitor [#delete-monitor]

When a step monitor is no longer needed, you can permanently remove it using the `syntheticsDeleteMonitor` mutation.

To delete a monitor, refer to the [Delete Synthetic monitor](https://docs.newrelic.com/docs/apis/nerdgraph/examples/synthetics-api/ping-monitor/#delete-monitor) section.

## Query step monitors [#query-step-monitors]

Use NerdGraph to retrieve metadata, steps configuration, map IDs, or check the status of your step monitors.

For more information, refer to:

-   [Query all monitors](https://docs.newrelic.com/docs/apis/nerdgraph/examples/synthetics-api/query-synthetics-data#query-monitors): To list all synthetic monitors and their configurations.
-   [Map monitor ID to entity GUID](https://docs.newrelic.com/docs/apis/nerdgraph/examples/synthetics-api/query-synthetics-data#query-guid-mapping): To migrate legacy monitor IDs to entity GUIDs.
-   [Runtime upgrade status](https://docs.newrelic.com/docs/apis/nerdgraph/examples/synthetics-api/query-synthetics-data#query-runtime-upgrade-all): To check if your monitors are ready for the latest runtime upgrades.
-   [Query monitor steps](https://docs.newrelic.com/docs/apis/nerdgraph/examples/synthetics-api/query-synthetics-data#query-monitor-steps) - Retrieve step configurations from step monitors.

To view complete list of query examples, refer to the [Query synthetics data](https://docs.newrelic.com/docs/apis/nerdgraph/examples/synthetics-api/query-synthetics-data) document.
