API ReferenceGuidesChangelog
Alerts

List all alert rules for a project

GET
/v1/alerts/rule/project/{projectId}

Authorization

api-key<token>

In: header

Path Parameters

projectId*string

Response Body

application/json

curl -X GET "https://example.com/v1/alerts/rule/project/string"
{  "rules": [    {      "alertType": "METRIC",      "channels": [        {          "customHeaders": {            "property1": "string",            "property2": "string"          },          "customWebhookUrl": "string",          "emailAddress": "string",          "id": "string",          "name": "string",          "pagerdutyConfig": {},          "projectId": "string",          "slackChannel": "string",          "slackTeam": "string",          "slackWebhookUrl": "string",          "telegramChatId": "string",          "telegramReference": "string",          "type": "UNKNOWN"        }      ],      "condition": {        "comparisonOp": "string",        "eventsQueries": [          {            "aggregation": {              "aggregateProperties": {                "propertyName": "string",                "type": "SUM"              },              "countUnique": {                "duration": {                  "unit": "string",                  "value": 0.1                }              },              "total": {},              "unique": {}            },            "alias": "string",            "color": "string",            "disabled": true,            "functions": [              {                "arguments": [                  {                    "boolValue": true,                    "doubleValue": 0.1,                    "durationValue": {                      "unit": "string",                      "value": 0.1                    },                    "intValue": 0,                    "stringValue": "string"                  }                ],                "name": "string"              }            ],            "groupBy": [              "string"            ],            "id": "string",            "limit": 0,            "resource": {              "cohortsId": "string",              "cohortsQuery": {                "groups": [                  {                    "filters": [                      {                        "aggregation": {                          "aggregateProperties": {                            "propertyName": "string",                            "type": "SUM"                          },                          "operator": "EQ",                          "total": {},                          "value": [                            {}                          ]                        },                        "name": "string",                        "selectorExpr": {                          "logicExpr": {                            "expressions": [                              null                            ],                            "operator": "AND"                          },                          "selector": {                            "key": "string",                            "operator": "EQ",                            "value": [                              null                            ]                          }                        },                        "symbol": true,                        "timeRange": {                          "end": "now",                          "start": "now-1M",                          "step": 86400,                          "timezone": "Europe/London"                        }                      }                    ],                    "joinOperator": "AND"                  }                ],                "id": "string",                "joinOperator": "AND",                "name": "string"              },              "multipleNames": [                "string"              ],              "name": "string",              "type": "EVENTS"            },            "selectorExpr": {              "logicExpr": {                "expressions": [                  {}                ],                "operator": "AND"              },              "selector": {                "key": "string",                "operator": "EQ",                "value": [                  {                    "boolValue": true,                    "dateValue": "2019-08-24T14:15:22Z",                    "doubleValue": 0.1,                    "intValue": 0,                    "listValue": {                      "values": [                        "string"                      ]                    },                    "longValue": "string",                    "stringValue": "string"                  }                ]              }            }          }        ],        "formula": {          "expression": "sum(a)+sum(b)"        },        "insightQueries": [          {            "eventsQuery": {              "aggregation": {                "aggregateProperties": {                  "propertyName": "string",                  "type": "SUM"                },                "countUnique": {                  "duration": {                    "unit": "string",                    "value": 0.1                  }                },                "total": {},                "unique": {}              },              "alias": "string",              "color": "string",              "disabled": true,              "functions": [                {                  "arguments": [                    {                      "boolValue": true,                      "doubleValue": 0.1,                      "durationValue": {                        "unit": "string",                        "value": 0.1                      },                      "intValue": 0,                      "stringValue": "string"                    }                  ],                  "name": "string"                }              ],              "groupBy": [                "string"              ],              "id": "string",              "limit": 0,              "resource": {                "cohortsId": "string",                "cohortsQuery": {                  "groups": [                    {                      "filters": [                        {                          "aggregation": {                            "aggregateProperties": {},                            "operator": "EQ",                            "total": {},                            "value": [                              null                            ]                          },                          "name": "string",                          "selectorExpr": {                            "logicExpr": {                              "expressions": []                            },                            "selector": {                              "value": []                            }                          },                          "symbol": true,                          "timeRange": {                            "end": "now",                            "start": "now-1M",                            "step": 86400,                            "timezone": "Europe/London"                          }                        }                      ],                      "joinOperator": "AND"                    }                  ],                  "id": "string",                  "joinOperator": "AND",                  "name": "string"                },                "multipleNames": [                  "string"                ],                "name": "string",                "type": "EVENTS"              },              "selectorExpr": {                "logicExpr": {                  "expressions": [                    {}                  ],                  "operator": "AND"                },                "selector": {                  "key": "string",                  "operator": "EQ",                  "value": [                    {                      "boolValue": true,                      "dateValue": "2019-08-24T14:15:22Z",                      "doubleValue": 0.1,                      "intValue": 0,                      "listValue": {                        "values": [                          "string"                        ]                      },                      "longValue": "string",                      "stringValue": "string"                    }                  ]                }              }            },            "metricsQuery": {              "aggregate": null,              "alias": "transfer (24h)",              "disabled": false,              "functions": [                {                  "arguments": [                    {                      "durationValue": {                        "unit": "d",                        "value": 1                      }                    }                  ],                  "name": "rollup_sum"                }              ],              "id": "a",              "labelSelector": {},              "query": "transfer_sum"            },            "priceQuery": {              "alias": "string",              "coinId": [                {                  "address": {                    "address": "string",                    "chain": "string"                  },                  "symbol": "string"                }              ],              "color": "string",              "disabled": true,              "id": "string"            },            "sourceName": "string"          }        ],        "priceQueries": [          {            "alias": "string",            "coinId": [              {                "address": {                  "address": "string",                  "chain": "string"                },                "symbol": "string"              }            ],            "color": "string",            "disabled": true,            "id": "string"          }        ],        "queries": [          {            "aggregate": null,            "alias": "transfer (24h)",            "disabled": false,            "functions": [              {                "arguments": [                  {                    "durationValue": {                      "unit": "d",                      "value": 1                    }                  }                ],                "name": "rollup_sum"              }            ],            "id": "a",            "labelSelector": {},            "query": "transfer_sum"          }        ],        "threshold": 0.1,        "threshold2": 0.1      },      "error": "string",      "for": {        "unit": "string",        "value": 0.1      },      "group": "string",      "id": "string",      "interval": {        "unit": "string",        "value": 0.1      },      "lastQueryTime": "2019-08-24T14:15:22Z",      "logCondition": {        "comparisonOp": "string",        "query": "string",        "threshold": 0,        "threshold2": 0      },      "message": "string",      "mute": true,      "projectId": "string",      "query": "string",      "renotifyDuration": {        "unit": "string",        "value": 0.1      },      "renotifyLimit": 0,      "sqlCondition": {        "columnCondition": {          "aggregation": "COUNT",          "comparisonOp": "string",          "threshold": 0.1,          "threshold2": 0.1,          "timeColumn": "string",          "valueColumn": "string"        },        "rowCondition": {},        "sqlQuery": "string"      },      "state": "NO_DATA",      "subject": "string",      "updateTime": "2019-08-24T14:15:22Z"    }  ]}