Skip to main content
PUT
/
alerts
/
alerts-general
/
v3
/
bulk
Bulk replace alert definitions
curl --request PUT \
  --url https://api.coralogix.com/mgmt/openapi/latest/alerts/alerts-general/v3/bulk \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "alertDefsToReplace": [
    {
      "alertDefProperties": {
        "name": "My Alert",
        "priority": "ALERT_DEF_PRIORITY_P5_OR_UNSPECIFIED",
        "type": "ALERT_DEF_TYPE_LOGS_IMMEDIATE_OR_UNSPECIFIED",
        "activeOn": {
          "dayOfWeek": [
            "DAY_OF_WEEK_MONDAY_OR_UNSPECIFIED"
          ],
          "endTime": {
            "hours": 14,
            "minutes": 30
          },
          "startTime": {
            "hours": 14,
            "minutes": 30
          }
        },
        "deleted": false,
        "description": "Alert description",
        "enabled": true,
        "entityLabels": {
          "key": "value"
        },
        "groupByKeys": [
          [
            "key1",
            "key2"
          ]
        ],
        "incidentsSettings": {
          "minutes": 30,
          "notifyOn": "NOTIFY_ON_TRIGGERED_ONLY_UNSPECIFIED"
        },
        "notificationGroup": {
          "destinations": [
            {
              "connectorId": "connector_id_example",
              "notifyOn": "NOTIFY_ON_TRIGGERED_ONLY_UNSPECIFIED",
              "presetId": "preset_id_example",
              "resolvedRouteOverrides": {
                "configOverrides": {
                  "connectorConfigFields": [
                    {
                      "fieldName": "description",
                      "template": "template_example"
                    }
                  ],
                  "messageConfigFields": [
                    {
                      "fieldName": "description",
                      "template": "template_example"
                    }
                  ],
                  "payloadType": "slack_raw, slack_structured, pagerduty_triggered, pagerduty_resolved, generic_https_default"
                }
              },
              "triggeredRoutingOverrides": {
                "configOverrides": {
                  "connectorConfigFields": [
                    {
                      "fieldName": "description",
                      "template": "template_example"
                    }
                  ],
                  "messageConfigFields": [
                    {
                      "fieldName": "description",
                      "template": "template_example"
                    }
                  ],
                  "payloadType": "slack_raw, slack_structured, pagerduty_triggered, pagerduty_resolved, generic_https_default"
                }
              }
            }
          ],
          "groupByKeys": [
            [
              "key1",
              "key2"
            ]
          ],
          "router": {
            "id": "123e4567-e89b-12d3-a456-426614174000",
            "notifyOn": "NOTIFY_ON_TRIGGERED_ONLY_UNSPECIFIED"
          },
          "webhooks": [
            {
              "integration": {
                "integrationId": 123
              },
              "minutes": 15,
              "notifyOn": "NOTIFY_ON_TRIGGERED_ONLY_UNSPECIFIED"
            }
          ]
        },
        "notificationGroupExcess": [
          {
            "destinations": [
              {
                "connectorId": "connector_id_example",
                "notifyOn": "NOTIFY_ON_TRIGGERED_ONLY_UNSPECIFIED",
                "presetId": "preset_id_example",
                "resolvedRouteOverrides": {
                  "configOverrides": {
                    "connectorConfigFields": [
                      {
                        "fieldName": "description",
                        "template": "template_example"
                      }
                    ],
                    "messageConfigFields": [
                      {
                        "fieldName": "description",
                        "template": "template_example"
                      }
                    ],
                    "payloadType": "slack_raw, slack_structured, pagerduty_triggered, pagerduty_resolved, generic_https_default"
                  }
                },
                "triggeredRoutingOverrides": {
                  "configOverrides": {
                    "connectorConfigFields": [
                      {
                        "fieldName": "description",
                        "template": "template_example"
                      }
                    ],
                    "messageConfigFields": [
                      {
                        "fieldName": "description",
                        "template": "template_example"
                      }
                    ],
                    "payloadType": "slack_raw, slack_structured, pagerduty_triggered, pagerduty_resolved, generic_https_default"
                  }
                }
              }
            ],
            "groupByKeys": [
              [
                "key1",
                "key2"
              ]
            ],
            "router": {
              "id": "123e4567-e89b-12d3-a456-426614174000",
              "notifyOn": "NOTIFY_ON_TRIGGERED_ONLY_UNSPECIFIED"
            },
            "webhooks": [
              {
                "integration": {
                  "integrationId": 123
                },
                "minutes": 15,
                "notifyOn": "NOTIFY_ON_TRIGGERED_ONLY_UNSPECIFIED"
              }
            ]
          }
        ],
        "phantomMode": false,
        "tracingImmediate": {
          "tracingFilter": {
            "simpleFilter": {
              "latencyThresholdMs": 1000,
              "tracingLabelFilters": {
                "applicationName": [
                  {
                    "operation": "TRACING_FILTER_OPERATION_TYPE_IS_OR_UNSPECIFIED",
                    "values": [
                      [
                        "value1",
                        "value2"
                      ]
                    ]
                  }
                ],
                "operationName": [
                  {
                    "operation": "TRACING_FILTER_OPERATION_TYPE_IS_OR_UNSPECIFIED",
                    "values": [
                      [
                        "value1",
                        "value2"
                      ]
                    ]
                  }
                ],
                "serviceName": [
                  {
                    "operation": "TRACING_FILTER_OPERATION_TYPE_IS_OR_UNSPECIFIED",
                    "values": [
                      [
                        "value1",
                        "value2"
                      ]
                    ]
                  }
                ],
                "spanFields": [
                  {
                    "filterType": {
                      "operation": "TRACING_FILTER_OPERATION_TYPE_IS_OR_UNSPECIFIED",
                      "values": [
                        [
                          "value1",
                          "value2"
                        ]
                      ]
                    },
                    "key": "span.field.key"
                  }
                ],
                "subsystemName": [
                  {
                    "operation": "TRACING_FILTER_OPERATION_TYPE_IS_OR_UNSPECIFIED",
                    "values": [
                      [
                        "value1",
                        "value2"
                      ]
                    ]
                  }
                ]
              }
            }
          },
          "notificationPayloadFilter": [
            [
              "obj.field"
            ]
          ]
        }
      },
      "id": "123e4567-e89b-12d3-a456-426614174000"
    }
  ]
}
'
{
  "alertDefs": [
    {
      "alertDefProperties": {
        "name": "My Alert",
        "priority": "ALERT_DEF_PRIORITY_P5_OR_UNSPECIFIED",
        "type": "ALERT_DEF_TYPE_LOGS_IMMEDIATE_OR_UNSPECIFIED",
        "activeOn": {
          "dayOfWeek": [
            "DAY_OF_WEEK_MONDAY_OR_UNSPECIFIED"
          ],
          "endTime": {
            "hours": 14,
            "minutes": 30
          },
          "startTime": {
            "hours": 14,
            "minutes": 30
          }
        },
        "deleted": false,
        "description": "Alert description",
        "enabled": true,
        "entityLabels": {
          "key": "value"
        },
        "groupByKeys": [
          [
            "key1",
            "key2"
          ]
        ],
        "incidentsSettings": {
          "minutes": 30,
          "notifyOn": "NOTIFY_ON_TRIGGERED_ONLY_UNSPECIFIED"
        },
        "notificationGroup": {
          "destinations": [
            {
              "connectorId": "connector_id_example",
              "notifyOn": "NOTIFY_ON_TRIGGERED_ONLY_UNSPECIFIED",
              "presetId": "preset_id_example",
              "resolvedRouteOverrides": {
                "configOverrides": {
                  "connectorConfigFields": [
                    {
                      "fieldName": "description",
                      "template": "template_example"
                    }
                  ],
                  "messageConfigFields": [
                    {
                      "fieldName": "description",
                      "template": "template_example"
                    }
                  ],
                  "payloadType": "slack_raw, slack_structured, pagerduty_triggered, pagerduty_resolved, generic_https_default"
                }
              },
              "triggeredRoutingOverrides": {
                "configOverrides": {
                  "connectorConfigFields": [
                    {
                      "fieldName": "description",
                      "template": "template_example"
                    }
                  ],
                  "messageConfigFields": [
                    {
                      "fieldName": "description",
                      "template": "template_example"
                    }
                  ],
                  "payloadType": "slack_raw, slack_structured, pagerduty_triggered, pagerduty_resolved, generic_https_default"
                }
              }
            }
          ],
          "groupByKeys": [
            [
              "key1",
              "key2"
            ]
          ],
          "router": {
            "id": "123e4567-e89b-12d3-a456-426614174000",
            "notifyOn": "NOTIFY_ON_TRIGGERED_ONLY_UNSPECIFIED"
          },
          "webhooks": [
            {
              "integration": {
                "integrationId": 123
              },
              "minutes": 15,
              "notifyOn": "NOTIFY_ON_TRIGGERED_ONLY_UNSPECIFIED"
            }
          ]
        },
        "notificationGroupExcess": [
          {
            "destinations": [
              {
                "connectorId": "connector_id_example",
                "notifyOn": "NOTIFY_ON_TRIGGERED_ONLY_UNSPECIFIED",
                "presetId": "preset_id_example",
                "resolvedRouteOverrides": {
                  "configOverrides": {
                    "connectorConfigFields": [
                      {
                        "fieldName": "description",
                        "template": "template_example"
                      }
                    ],
                    "messageConfigFields": [
                      {
                        "fieldName": "description",
                        "template": "template_example"
                      }
                    ],
                    "payloadType": "slack_raw, slack_structured, pagerduty_triggered, pagerduty_resolved, generic_https_default"
                  }
                },
                "triggeredRoutingOverrides": {
                  "configOverrides": {
                    "connectorConfigFields": [
                      {
                        "fieldName": "description",
                        "template": "template_example"
                      }
                    ],
                    "messageConfigFields": [
                      {
                        "fieldName": "description",
                        "template": "template_example"
                      }
                    ],
                    "payloadType": "slack_raw, slack_structured, pagerduty_triggered, pagerduty_resolved, generic_https_default"
                  }
                }
              }
            ],
            "groupByKeys": [
              [
                "key1",
                "key2"
              ]
            ],
            "router": {
              "id": "123e4567-e89b-12d3-a456-426614174000",
              "notifyOn": "NOTIFY_ON_TRIGGERED_ONLY_UNSPECIFIED"
            },
            "webhooks": [
              {
                "integration": {
                  "integrationId": 123
                },
                "minutes": 15,
                "notifyOn": "NOTIFY_ON_TRIGGERED_ONLY_UNSPECIFIED"
              }
            ]
          }
        ],
        "phantomMode": false,
        "tracingImmediate": {
          "tracingFilter": {
            "simpleFilter": {
              "latencyThresholdMs": 1000,
              "tracingLabelFilters": {
                "applicationName": [
                  {
                    "operation": "TRACING_FILTER_OPERATION_TYPE_IS_OR_UNSPECIFIED",
                    "values": [
                      [
                        "value1",
                        "value2"
                      ]
                    ]
                  }
                ],
                "operationName": [
                  {
                    "operation": "TRACING_FILTER_OPERATION_TYPE_IS_OR_UNSPECIFIED",
                    "values": [
                      [
                        "value1",
                        "value2"
                      ]
                    ]
                  }
                ],
                "serviceName": [
                  {
                    "operation": "TRACING_FILTER_OPERATION_TYPE_IS_OR_UNSPECIFIED",
                    "values": [
                      [
                        "value1",
                        "value2"
                      ]
                    ]
                  }
                ],
                "spanFields": [
                  {
                    "filterType": {
                      "operation": "TRACING_FILTER_OPERATION_TYPE_IS_OR_UNSPECIFIED",
                      "values": [
                        [
                          "value1",
                          "value2"
                        ]
                      ]
                    },
                    "key": "span.field.key"
                  }
                ],
                "subsystemName": [
                  {
                    "operation": "TRACING_FILTER_OPERATION_TYPE_IS_OR_UNSPECIFIED",
                    "values": [
                      [
                        "value1",
                        "value2"
                      ]
                    ]
                  }
                ]
              }
            }
          },
          "notificationPayloadFilter": [
            [
              "obj.field"
            ]
          ]
        }
      },
      "alertVersionId": "<string>",
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "createdTime": "2023-10-01T12:00:00.000Z",
      "lastTriggeredTime": "2023-10-01T12:00:00.000Z",
      "status": "ALERT_DEF_STATUS_UNSPECIFIED",
      "updatedTime": "2023-10-01T12:00:00.000Z"
    }
  ],
  "failedToReplaceAlertDefs": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000"
    }
  ],
  "notFoundIds": [
    [
      "123e4567-e89b-12d3-a456-426614174000"
    ]
  ],
  "skippedIds": [
    [
      "123e4567-e89b-12d3-a456-426614174000"
    ]
  ]
}

Authorizations

Authorization
string
header
required

API key authentication

Body

application/json

A request to bulk replace multiple alert definitions

alertDefsToReplace
Alert definition to replace · object[]
required

Response

A response that contains the results of the bulk replace operation

alertDefs
Alert definition · object[]
required
failedToReplaceAlertDefs
Failed to replace alert definition · object[]
required
notFoundIds
string[]
required

List of alert definition IDs that were not found

skippedIds
string[]
required

List of alert definition IDs that were skipped (no changes detected)