{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/instana/json-schema/instana-synthetic-alert-config-schema.json",
  "title": "SyntheticAlertConfig",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/instana-synthetic-alert-configuration-api-openapi.yml#/components/schemas/SyntheticAlertConfig",
  "type": "object",
  "properties": {
    "alertChannelIds": {
      "type": "array",
      "description": "List of IDs of alert channels defined in Instana. Can be left empty.",
      "items": {
        "type": "string",
        "description": "List of IDs of alert channels defined in Instana. Can be left empty."
      },
      "maxItems": 1024,
      "minItems": 0,
      "uniqueItems": true
    },
    "customPayloadFields": {
      "type": "array",
      "description": "Custom payload fields to send additional information in the alert notifications. Can be left empty.",
      "items": {
        "$ref": "#/$defs/CustomPayloadField"
      },
      "maxItems": 20,
      "minItems": 0
    },
    "description": {
      "type": "string",
      "description": "Description of the synthetic alert configuration. Used as a template for the description of alert/event notifications triggered by this Smart Alert configuration.",
      "maxLength": 65536,
      "minLength": 0
    },
    "gracePeriod": {
      "type": "integer",
      "format": "int64",
      "description": "The duration for which an alert remains open after conditions are no longer violated, with the alert auto-closing once the grace period expires."
    },
    "name": {
      "type": "string",
      "description": "Name of the synthetic alert configuration. Used as a template for the title of alert/event notifications triggered by this Smart Alert configuration.",
      "maxLength": 256,
      "minLength": 0
    },
    "rule": {
      "$ref": "#/$defs/SyntheticAlertRule"
    },
    "severity": {
      "type": "integer",
      "format": "int32",
      "description": "The severity of the alert when triggered, which is either 5 (Warning), or 10 (Critical).",
      "maximum": 10,
      "minimum": 5
    },
    "syntheticTestIds": {
      "type": "array",
      "description": "IDs of the synthetic tests that this Smart Alert configuration is applied to.",
      "items": {
        "type": "string",
        "description": "IDs of the synthetic tests that this Smart Alert configuration is applied to."
      },
      "uniqueItems": true
    },
    "tagFilterExpression": {
      "$ref": "#/$defs/TagFilterExpressionElement"
    },
    "timeThreshold": {
      "$ref": "#/$defs/SyntheticTimeThreshold"
    }
  },
  "required": [
    "alertChannelIds",
    "customPayloadFields",
    "description",
    "name",
    "rule",
    "syntheticTestIds",
    "tagFilterExpression",
    "timeThreshold"
  ],
  "$defs": {
    "CustomPayloadField": {
      "type": "object",
      "description": "Custom payload fields to send additional information in the alert notifications. Can be left empty.",
      "properties": {
        "key": {
          "type": "string",
          "description": "A user-specified unique identifier or name for a custom payload entry."
        },
        "type": {
          "type": "string"
        }
      },
      "required": [
        "key",
        "type"
      ]
    },
    "SyntheticAlertRule": {
      "type": "object",
      "description": "Indicates the type of rule this alert configuration is about.",
      "properties": {
        "aggregation": {
          "type": "string",
          "enum": [
            "SUM",
            "MEAN",
            "MAX",
            "MIN",
            "P25",
            "P50",
            "P75",
            "P90",
            "P95",
            "P98",
            "P99",
            "P99_9",
            "P99_99",
            "DISTINCT_COUNT",
            "SUM_POSITIVE",
            "PER_SECOND",
            "INCREASE"
          ]
        },
        "alertType": {
          "type": "string"
        },
        "metricName": {
          "type": "string"
        }
      },
      "required": [
        "alertType",
        "metricName"
      ]
    },
    "SyntheticTimeThreshold": {
      "type": "object",
      "description": "The type of threshold to define the criteria when the event and alert triggers and resolves.",
      "properties": {
        "type": {
          "type": "string"
        },
        "violationsCount": {
          "type": "integer",
          "format": "int32",
          "maximum": 12,
          "minimum": 1
        }
      },
      "required": [
        "type"
      ]
    },
    "TagFilterExpressionElement": {
      "type": "object",
      "description": "Boolean expression of tag filters to define the scope of relevant calls.",
      "properties": {
        "type": {
          "type": "string"
        }
      },
      "required": [
        "type"
      ]
    }
  }
}