{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/instana/json-schema/instana-website-alert-config-with-metadata-schema.json",
  "title": "WebsiteAlertConfigWithMetadata",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/instana-event-settings-api-openapi.yml#/components/schemas/WebsiteAlertConfigWithMetadata",
  "type": "object",
  "properties": {
    "alertChannelIds": {
      "type": "array",
      "deprecated": true,
      "description": "List of IDs of alert channels defined in Instana. Can be left empty.",
      "items": {
        "type": "string",
        "deprecated": true,
        "description": "List of IDs of alert channels defined in Instana. Can be left empty."
      },
      "maxItems": 1024,
      "minItems": 0,
      "uniqueItems": true
    },
    "alertChannels": {
      "type": "object",
      "additionalProperties": {
        "type": "array",
        "description": "Set of alert channel IDs associated with the severity.",
        "items": {
          "type": "string",
          "description": "Set of alert channel IDs associated with the severity."
        },
        "uniqueItems": true
      },
      "description": "Set of alert channel IDs associated with the severity."
    },
    "created": {
      "type": "integer",
      "format": "int64",
      "description": "Unix timestamp representing the creation time of this revision.",
      "minimum": 1
    },
    "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 website alert configuration. Used as a template for the description of alert/event notifications triggered by this Smart Alert configuration.",
      "maxLength": 65536,
      "minLength": 0
    },
    "enabled": {
      "type": "boolean",
      "description": "Flag to indicate whether or not the configuration is enabled."
    },
    "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."
    },
    "granularity": {
      "type": "integer",
      "format": "int32",
      "default": 600000,
      "description": "The evaluation granularity used for detection of violations of the defined threshold. Defines the size of the tumbling window used.",
      "enum": [
        60000,
        300000,
        600000,
        900000,
        1200000,
        1800000
      ]
    },
    "id": {
      "type": "string",
      "description": "ID of this Website Alert Config. ",
      "maxLength": 64,
      "minLength": 0
    },
    "initialCreated": {
      "type": "integer",
      "format": "int64",
      "description": "Unix timestamp representing the time of the initial revision.",
      "minimum": 1
    },
    "name": {
      "type": "string",
      "description": "Name of the website alert configuration. Used as a template for the title of alert/event notifications triggered by this Smart Alert configuration.",
      "maxLength": 256,
      "minLength": 0
    },
    "readOnly": {
      "type": "boolean",
      "description": "Flag to indicate whether or not the configuration is read-only. Read-only access restricts modification of the config."
    },
    "rule": {
      "$ref": "#/$defs/WebsiteAlertRule"
    },
    "rules": {
      "type": "array",
      "description": "A list of rules where each rule is associated with multiple thresholds and their corresponding severity levels. This enables more complex alert configurations with validations to ensure consistent and logical threshold-severity combinations.",
      "items": {
        "$ref": "#/$defs/RuleWithThresholdWebsiteAlertRule"
      },
      "maxItems": 1,
      "minItems": 1
    },
    "severity": {
      "type": "integer",
      "format": "int32",
      "deprecated": true,
      "description": "The severity of the alert when triggered, which is either 5 (Warning), or 10 (Critical).",
      "maximum": 10,
      "minimum": 5
    },
    "tagFilterExpression": {
      "$ref": "#/$defs/TagFilterExpressionElement"
    },
    "tagFilters": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/TagFilter"
      },
      "uniqueItems": true,
      "writeOnly": true
    },
    "threshold": {
      "$ref": "#/$defs/Threshold"
    },
    "timeThreshold": {
      "$ref": "#/$defs/WebsiteTimeThreshold"
    },
    "triggering": {
      "type": "boolean",
      "description": "Optional flag to indicate whether an Incident is also triggered or not."
    },
    "websiteId": {
      "type": "string",
      "description": "ID of the website that this Smart Alert configuration is applied to.",
      "maxLength": 64,
      "minLength": 0
    }
  },
  "required": [
    "customPayloadFields",
    "description",
    "granularity",
    "id",
    "name",
    "tagFilterExpression",
    "timeThreshold",
    "websiteId"
  ],
  "$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"
      ]
    },
    "RuleWithThresholdWebsiteAlertRule": {
      "type": "object",
      "description": "A list of rules where each rule is associated with multiple thresholds and their corresponding severity levels. This enables more complex alert configurations with validations to ensure consistent and logical threshold-severity combinations.",
      "properties": {
        "rule": {
          "$ref": "#/$defs/WebsiteAlertRule"
        },
        "thresholdOperator": {
          "type": "string",
          "enum": [
            ">",
            ">=",
            "<",
            "<="
          ]
        },
        "thresholds": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/ThresholdConfigRule"
          }
        }
      },
      "required": [
        "rule",
        "thresholdOperator",
        "thresholds"
      ]
    },
    "TagFilter": {
      "type": "object",
      "allOf": [
        {
          "$ref": "#/$defs/TagFilterExpressionElement"
        },
        {
          "type": "object",
          "properties": {
            "entity": {
              "type": "string",
              "description": "SOURCE or DESTINATION tag in case of a call tag. For Infrastructure, always set to NOT_APPLICABLE.",
              "enum": [
                "NOT_APPLICABLE",
                "DESTINATION",
                "SOURCE"
              ]
            },
            "key": {
              "type": "string",
              "description": "Tag key in case of a key/value tag.",
              "maxLength": 512,
              "minLength": 0
            },
            "name": {
              "type": "string",
              "description": "Name of the tag.",
              "maxLength": 128,
              "minLength": 0
            },
            "operator": {
              "type": "string",
              "enum": [
                "EQUALS",
                "CONTAINS",
                "LESS_THAN",
                "LESS_OR_EQUAL_THAN",
                "GREATER_THAN",
                "GREATER_OR_EQUAL_THAN",
                "NOT_EMPTY",
                "NOT_EQUAL",
                "NOT_CONTAIN",
                "IS_EMPTY",
                "NOT_BLANK",
                "IS_BLANK",
                "STARTS_WITH",
                "ENDS_WITH",
                "NOT_STARTS_WITH",
                "NOT_ENDS_WITH",
                "REGEX_MATCH"
              ]
            },
            "value": {
              "type": "object",
              "description": "Tag value to filter on. Can be a string, number, or boolean value."
            }
          }
        }
      ],
      "required": [
        "entity",
        "name",
        "operator"
      ]
    },
    "TagFilterExpressionElement": {
      "type": "object",
      "description": "Boolean expression of tag filters to define the scope of relevant calls.",
      "properties": {
        "type": {
          "type": "string"
        }
      },
      "required": [
        "type"
      ]
    },
    "Threshold": {
      "type": "object",
      "deprecated": true,
      "description": "Indicates the type of threshold this alert rule is evaluated on.",
      "properties": {
        "operator": {
          "type": "string",
          "enum": [
            ">",
            ">=",
            "<",
            "<="
          ]
        },
        "type": {
          "type": "string"
        }
      },
      "required": [
        "operator",
        "type"
      ]
    },
    "ThresholdConfigRule": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string"
        }
      },
      "required": [
        "type"
      ]
    },
    "WebsiteAlertRule": {
      "type": "object",
      "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"
      ]
    },
    "WebsiteTimeThreshold": {
      "type": "object",
      "description": "The type of threshold to define the criteria when the event and alert triggers and resolves.",
      "properties": {
        "timeWindow": {
          "type": "integer",
          "format": "int64"
        },
        "type": {
          "type": "string"
        }
      },
      "required": [
        "type"
      ]
    }
  }
}