{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/eagle-eye-networks/main/json-schema/eagle-eye-networks-alert-action-rule-update-schema.json",
  "title": "AlertActionRuleUpdate",
  "x-generated": "2026-10-14",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/eagle-eye-networks-automations-openapi.yml#/components/schemas/AlertActionRuleUpdate",
  "type": "object",
  "properties": {
    "id": {
      "description": "Unique identifier of the alert action rule.",
      "type": "string",
      "readOnly": true
    },
    "createTimestamp": {
      "description": "Time at which the alert action rule was created.",
      "type": "string",
      "format": "date-time",
      "readOnly": true
    },
    "name": {
      "description": "Name to let humans easily identify and understand the alert action rule.",
      "type": "string"
    },
    "notes": {
      "description": "Large text field that allows users to leave notes for themselves and others.",
      "type": "string"
    },
    "enabled": {
      "description": "If set to true, this rule is active, if set to false, it will not be applied.",
      "type": "boolean",
      "default": true
    },
    "alertTypes": {
      "description": "If defined, this rule will only trigger on alerts of the given types.",
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "string"
      },
      "minLength": 1
    },
    "actorIds": {
      "description": "If defined, this rule will only trigger on alerts about actors with the given ids.",
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "string"
      },
      "minLength": 1
    },
    "actorTypes": {
      "description": "If defined, this rule will only trigger on alerts about actors of the given types.",
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "string"
      },
      "minLength": 1
    },
    "actorAccountIds": {
      "description": "If defined, this rule will only trigger on alerts about actors from the given accounts.",
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "string"
      },
      "minLength": 1
    },
    "ruleIds": {
      "description": "If defined, this rule will only trigger on alerts that were generated by one of the given alert condition\nrules.\n",
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "string"
      },
      "minLength": 1
    },
    "priority__gte": {
      "description": "If defined, this rule will only trigger on alerts with a priority greater than or equal to the given value.\n",
      "type": [
        "integer",
        "null"
      ]
    },
    "priority__lte": {
      "description": "If defined, this rule will only trigger on alerts with a priority less than or equal to the given value.\n",
      "type": [
        "integer",
        "null"
      ]
    },
    "alertActionIds": {
      "description": "Defines the actions to take if an alert matches the rule.",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "locationIds": {
      "description": "If defined, this rule will only trigger on alerts about actors from the given locations.",
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "string"
      },
      "minLength": 1
    },
    "imageOptions": {
      "allOf": [
        {
          "$ref": "#/$defs/ImageOptions"
        }
      ],
      "nullable": true,
      "default": null,
      "description": "Image attachment configuration for this rule. When null, the existing single-image behaviour is used unchanged. When set, all actions linked to this rule will receive images resolved from alert.data URLs (images are resolved from alert.data URLs). Maximum 6 images total per execution. Currently applied to SMTP and Immix actions.\n"
    }
  },
  "$defs": {
    "AlertImageConfig": {
      "type": "object",
      "description": "Configuration for the primary alert image. Always included when imageOptions is set; cannot be disabled.",
      "properties": {
        "embeddedOverlay": {
          "type": "boolean",
          "default": true,
          "description": "Use the overlay-embedded full-frame image. Falls back to the plain full-frame image if the overlay version is unavailable in alert.data.\n"
        },
        "includeCropUrl": {
          "type": "boolean",
          "default": false,
          "description": "Also attach the cropped detection-region image. Silently skipped if the crop URL is not present in alert.data.\n"
        }
      }
    },
    "ContextImageItem": {
      "type": "object",
      "description": "Configuration for one context image at a specific second offset from the event timestamp.",
      "required": [
        "offsetSeconds"
      ],
      "properties": {
        "offsetSeconds": {
          "type": "integer",
          "enum": [
            -5,
            -4,
            -3,
            -2,
            -1,
            1,
            2,
            3,
            4,
            5
          ],
          "description": "Seconds relative to the event timestamp. Negative values are before the event, positive values are after. 0 is excluded — that is the alert image itself (configured in alertImage). Valid range: -5 to +5 excluding 0.\n"
        },
        "imageType": {
          "type": "string",
          "enum": [
            "full"
          ],
          "default": "full",
          "description": "Image type. Only \"full\" is supported currently."
        }
      }
    },
    "ImageOptions": {
      "type": "object",
      "description": "Image attachment configuration for an alert action rule. Defines which images are attached when the rule fires. Maximum 6 images total per execution: 1 alert image + 1 optional crop + up to 4 context images.\n",
      "required": [
        "alertImage"
      ],
      "properties": {
        "alertImage": {
          "$ref": "#/$defs/AlertImageConfig"
        },
        "contextImages": {
          "type": "array",
          "description": "Ordered list of additional context images. Each item specifies one image at an explicit second offset from the event timestamp. Offsets must be unique; 0 is excluded (that is the alert image itself).\n",
          "default": [],
          "maxItems": 4,
          "uniqueItems": true,
          "items": {
            "$ref": "#/$defs/ContextImageItem"
          }
        }
      }
    }
  }
}