v1

latestOpenAPI 3.0.02026-07-141,4077,1665.2 MB
Monitors

Get all monitor notification rules

Returns a list of all monitor notification rules.

get/api/v2/monitor/notification_rule

Query parameters

pageinteger

The page to start paginating from. If page is not specified, the argument defaults to the first page.

per_pageinteger

The number of rules to return per page. If per_page is not specified, the argument defaults to 100.

sortstring

String for sort order, composed of field and sort order separated by a colon, for example name:asc. Supported sort directions: asc, desc. Supported fields: name, created_at.

filtersstring

JSON-encoded filter object. Supported keys:

  • text: Free-text query matched against rule name, tags, and recipients.
  • tags: Array of strings. Return rules that have any of these tags.
  • recipients: Array of strings. Return rules that have any of these recipients.
includestring
Example:created_by

Comma-separated list of resource paths for related resources to include in the response. Supported resource path is created_by.

Response

OK

Example response

{
  "data": [
    {
      "attributes": {
        "conditional_recipients": {
          "conditions": [
            {
              "recipients": [
                "slack-test-channel",
                "jira-test"
              ],
              "scope": "transition_type:is_alert"
            }
          ],
          "fallback_recipients": [
            "slack-test-channel",
            "jira-test"
          ]
        },
        "created": "2020-01-02 03:04:00+00:00",
        "filter": {
          "tags": [
            "team:product",
            "host:abc"
          ]
        },
        "modified": "2020-01-02 03:04:00+00:00",
        "name": "A notification rule name",
        "recipients": [
          "slack-test-channel",
          "jira-test"
        ]
      },
      "id": "00000000-0000-1234-0000-000000000000",
      "relationships": {
        "created_by": {
          "data": {
            "id": "00000000-0000-1234-0000-000000000000",
            "type": "users"
          }
        }
      },
      "type": "monitor-notification-rule"
    }
  ],
  "included": [
    {
      "relationships": {
        "org": {
          "data": {
            "id": "00000000-0000-beef-0000-000000000000",
            "type": "orgs"
          }
        },
        "other_orgs": {
          "data": []
        },
        "other_users": {
          "data": []
        },
        "roles": {
          "data": [
            {
              "id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d",
              "type": "roles"
            }
          ]
        }
      },
      "type": "users"
    }
  ]
}