---
updatedAt: 2026-06-05T18:59:01.000Z
agentTools:
  projectIndex: https://developer.eagleeyenetworks.com/llms.txt
---

# /eventAlertConditionRules

Create a new rule that produces alerts based on certain conditions. Specifically, the user specifies alert conditions that indicate when the alert is produced based on following:
  * Which resources can produce the alert
  * What is the schedule for the alert.
  * What event types can produce the alert.

Resellers may create rules on behalf of an end user account by setting `endUserAccountId` in the request body. The reseller must have permission to edit automations on that end user account.

# OpenAPI definition

```json
{
  "openapi": "3.0.3",
  "info": {
    "title": "AUTOMATIONS",
    "version": "3.0.0"
  },
  "servers": [
    {
      "url": "https://{BaseUrl}/api/v3.0",
      "description": "Eagle Eye Networks API Server",
      "variables": {
        "BaseUrl": {
          "default": "api.cxxx.eagleeyenetworks.com",
          "description": "HTTPS Base url to use for all API calls, retrieved from https://api.eagleeyenetworks.com/api/v3.0/clientSettings"
        }
      }
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "tags": [
    {
      "name": "Event Alert Rules",
      "description": "Describe when an event should trigger an alert."
    }
  ],
  "paths": {
    "/eventAlertConditionRules": {
      "post": {
        "operationId": "addEventAlertConditionRule",
        "tags": [
          "Event Alert Rules"
        ],
        "description": "Create a new rule that produces alerts based on certain conditions. Specifically, the user specifies alert conditions that indicate when the alert is produced based on following:\n  * Which resources can produce the alert\n  * What is the schedule for the alert.\n  * What event types can produce the alert.\n\nResellers may create rules on behalf of an end user account by setting `endUserAccountId` in the request body. The reseller must have permission to edit automations on that end user account.",
        "requestBody": {
          "description": "Conditions for the rule to be added",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiEventAlertConditionRuleCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "$ref": "#/components/responses/ruleCreatedResponse"
          },
          "400": {
            "$ref": "#/components/responses/validationError"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    },
    "responses": {
      "ruleCreatedResponse": {
        "description": "Response on successful creation of the rule.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ApiEventAlertConditionRule"
            }
          }
        }
      },
      "validationError": {
        "description": "The supplied object is invalid. Error detail will contain the validation error.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ApiV3Error"
            },
            "examples": {
              "unexpectedArgument": {
                "value": {
                  "code": 400,
                  "status": "invalidArgument",
                  "message": "Unexpected argument: name",
                  "details": [
                    {
                      "type": "errorInfo",
                      "reason": "unexpectedArgument",
                      "domain": "apiv3",
                      "metadata": {
                        "path": "/api/v3.0/<resource>"
                      }
                    }
                  ]
                }
              },
              "missingRequiredArgument": {
                "value": {
                  "code": 400,
                  "status": "invalidArgument",
                  "message": "Missing required arguments: name, id",
                  "details": [
                    {
                      "type": "errorInfo",
                      "reason": "missingRequiredArgument",
                      "domain": "apiv3",
                      "metadata": {
                        "path": "/api/v3.0/<resource>"
                      }
                    }
                  ]
                }
              },
              "badRequestInvalidJSON": {
                "value": {
                  "code": 400,
                  "status": "invalidArgument",
                  "message": "Invalid JSON",
                  "details": [
                    {
                      "type": "errorInfo",
                      "reason": "invalidJSON",
                      "domain": "apiv3",
                      "metadata": {
                        "path": "/api/v3.0/<resource>"
                      }
                    }
                  ]
                }
              },
              "badRequestInvalidArgument": {
                "value": {
                  "code": 400,
                  "status": "invalidArgument",
                  "message": "Invalid Argument: Argument name is too long",
                  "details": [
                    {
                      "type": "errorInfo",
                      "reason": "wrongArgumentValue",
                      "domain": "apiv3",
                      "metadata": {
                        "path": "/api/v3.0/<resource>"
                      }
                    },
                    {
                      "type": "badRequest",
                      "argumentViolations": [
                        {
                          "argumentName": "name",
                          "description": "Name is too long"
                        }
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "unauthorized": {
        "description": "You are not authenticated. Please authenticate and try again.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ApiV3Error"
            },
            "example": {
              "code": 401,
              "status": "unauthenticated",
              "message": "The client caller does not have a valid authentication credential",
              "details": [
                {
                  "type": "errorInfo",
                  "reason": "unauthenticated",
                  "domain": "apiv3",
                  "metadata": {
                    "path": "/api/v3.0/<resource>"
                  }
                }
              ]
            }
          }
        }
      },
      "forbidden": {
        "description": "You have no permission to access the specified resource.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ApiV3Error"
            },
            "examples": {
              "invalidPermission": {
                "value": {
                  "code": 403,
                  "status": "permissionDenied",
                  "message": "The client caller does not have permission for the specified operation",
                  "details": [
                    {
                      "type": "errorInfo",
                      "reason": "invalidPermission",
                      "domain": "apiv3",
                      "metadata": {
                        "path": "/api/v3.0/<resource>"
                      }
                    }
                  ]
                }
              },
              "wrongEdition": {
                "value": {
                  "code": 403,
                  "status": "permissionDenied",
                  "message": "This feature is not enabled for the account",
                  "details": [
                    {
                      "type": "errorInfo",
                      "reason": "wrongEdition",
                      "domain": "apiv3",
                      "metadata": {
                        "path": "/api/v3.0/locations"
                      }
                    }
                  ]
                }
              },
              "wrongAccountType": {
                "value": {
                  "code": 403,
                  "status": "permissionDenied",
                  "message": "This feature is only available for end users",
                  "details": [
                    {
                      "type": "errorInfo",
                      "reason": "wrongAccountType",
                      "domain": "apiv3",
                      "metadata": {
                        "path": "/api/v3.0/locations"
                      }
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "internalServerError": {
        "description": "Something went wrong in the server. Please try again.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ApiV3Error"
            },
            "example": {
              "code": 500,
              "status": "internal",
              "message": "An internal error has occurred. Please try again later.",
              "details": [
                {
                  "type": "errorInfo",
                  "reason": "unexpectedError",
                  "domain": "apiv3",
                  "metadata": {
                    "path": "/api/v3.0/<resource>"
                  }
                }
              ]
            }
          }
        }
      }
    },
    "schemas": {
      "Priority": {
        "type": "integer",
        "description": "Defines the priority of the alert",
        "format": "int32",
        "minimum": 1,
        "maximum": 10
      },
      "EventFilter": {
        "type": "object",
        "description": "A list of attributes of the event used to funnel down a specific set of events for any downstream action.",
        "properties": {
          "eventTypes": {
            "type": "array",
            "description": "Specifies the types of events that this rule should evaluate. Only events matching one of the specified types will trigger the rule. For example, if this field includes `een.personDetectionEvent.v1`, but the incoming event is a `een.motionDetectionEvent.v1`, the rule will not be triggered.\n",
            "items": {
              "type": "string",
              "example": "een.lprPlateReadEvent.v1"
            }
          },
          "data": {
            "type": "object",
            "description": "A key-value map used to filter events based on fields defined in event data schemas.\n\nKeys must follow the format: `{schema}.{field}__{operator}`. Refer to the event descriptions and corresponding data schemas to determine the available schema names and their respective fields.\n\nIf the operator is omitted, equality is assumed.\n\nThe `schema` and `field` names used in the keys must match the `dataSchemas` associated with the filtered `eventTypes`. \nIf any schema or field is invalid for the given event type(s), the API will return a validation error.\n\nSupported operators:\n  - `__in`: Match if the field value is in the provided list\n  - `__gte`: Match if the field value is greater than or equal to the given value (number or date-time)\n  - `__lte`: Match if the field value is less than or equal to the given value (number or date-time)\n",
            "properties": {
              "and": {
                "type": "array",
                "description": "All conditions must match",
                "items": {
                  "type": "object",
                  "additionalProperties": true,
                  "example": {
                    "een.lprDetection.v1.plateConfidence__gte": 0.95,
                    "een.lprDetection.v1.plateRegion__in": [
                      "US-NY",
                      "CA-ON"
                    ]
                  }
                }
              }
            }
          },
          "schedule": {
            "$ref": "#/components/schemas/WeeklyIntervalSchedule"
          },
          "resourceFilter": {
            "$ref": "#/components/schemas/ResourceFilter"
          }
        }
      },
      "ResourceFilter": {
        "type": "object",
        "description": "List of actors against which filtering has to happen",
        "properties": {
          "actors": {
            "description": "Actors that can trigger alerts for this rule, in the format `actorType:actorId`.\nWildcard Support: Use `<actorType>:*` to match all actors of a specific type (e.g., `camera:*` matches all cameras).  Only full wildcards (`<actorType>:*`) are supported. Partial wildcards like `camera:123*` are not allowed.  Only admin users can use wildcard actors.\n",
            "type": "array",
            "items": {
              "type": "string"
            },
            "example": [
              "camera:100d4c41",
              "camera:*"
            ]
          }
        }
      },
      "EventAlertConditionRuleBase": {
        "type": "object",
        "description": "Encompasses all the user specified properties of a rule used to generate alerts.",
        "properties": {
          "name": {
            "type": "string",
            "description": "Name for the rule",
            "minLength": 1,
            "maxLength": 126,
            "example": "Alert on Motion detection"
          },
          "priority": {
            "$ref": "#/components/schemas/Priority"
          },
          "notes": {
            "type": "string",
            "description": "A verbose explanation of the rule",
            "example": "Generate alerts on Motion Detection at night."
          },
          "enabled": {
            "type": "boolean",
            "description": "Whether rule is enabled"
          },
          "cooldownSeconds": {
            "type": "integer",
            "format": "int32",
            "description": "Cooldown period (in seconds). If two events for the same actor and event type have event timestamps within this duration, only the first will trigger an alert while the second event will be suppressed. A value of 0 disables the cooldown checks.\n",
            "default": 10,
            "minimum": 0
          },
          "humanValidation": {
            "type": "object",
            "properties": {
              "enabled": {
                "type": "boolean",
                "description": "If set to true, the alert will be validated by a human before being applied. This is useful for rules that are not 100% reliable and need human confirmation.\n",
                "example": true
              },
              "service": {
                "type": "string",
                "description": "The service that will be used for human validation. Currently, the only supported service is Eagle Eye Human Review, which is the default.\n",
                "example": "eenV1",
                "enum": [
                  "eenV1"
                ],
                "default": "eenV1"
              },
              "maxWaitTimeSeconds": {
                "type": "integer",
                "format": "int32",
                "description": "The maximum time (in seconds) to wait for human validation before the alert is applied. If the human validation is not completed within this time, the alert will be applied automatically.\n",
                "default": 60,
                "minimum": 1,
                "maximum": 60
              }
            }
          },
          "eventFilter": {
            "$ref": "#/components/schemas/EventFilter"
          }
        }
      },
      "ApiEventAlertConditionRuleCreate": {
        "type": "object",
        "description": "Encompasses all the user specified properties of a rule used to generate alerts.",
        "required": [
          "name",
          "priority"
        ],
        "allOf": [
          {
            "$ref": "#/components/schemas/EventAlertConditionRuleBase"
          }
        ],
        "properties": {
          "enabled": {
            "type": "boolean",
            "description": "Whether the rule is enabled",
            "default": false
          },
          "endUserAccountId": {
            "type": "string",
            "example": "00012345",
            "description": "The end user account this rule should target. Required when the caller is a reseller (with or without wildcard actors); the caller must have permission to edit automations on the target end user account. Must not be set by non-reseller callers."
          }
        }
      },
      "ApiEventAlertConditionRule": {
        "type": "object",
        "description": "Encompasses all the user specified and system generated properties of a rule used to generate alerts.",
        "allOf": [
          {
            "$ref": "#/components/schemas/EventAlertConditionRuleBase"
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "readOnly": true,
                "description": "The system generated id of this rule resource"
              },
              "createTimeStamp": {
                "type": "string",
                "description": "Time at which the Alert Condition Rule was created.",
                "example": "2021-04-22T00:00:00.000+00:00",
                "readOnly": true,
                "format": "date-time"
              },
              "updateTimeStamp": {
                "type": "string",
                "description": "Time at which the Alert Condition Rule was last updated.",
                "example": "2021-04-22T00:20:00.000+00:00",
                "readOnly": true,
                "format": "date-time"
              },
              "outputAlertTypes": {
                "type": "array",
                "readOnly": true,
                "description": "Possible Alert Types that are producible by this rule. For a given event, what alert is produced depends on the configuration parameters of the rule and the event properties.",
                "items": {
                  "type": "string",
                  "example": "een.motionDetectionAlert.v1"
                }
              },
              "endUserAccountId": {
                "type": "string",
                "nullable": true,
                "readOnly": true,
                "description": "The end user account this rule targets. Available only for a rule created by a reseller targeting an end user; `null` otherwise.",
                "example": "00012345"
              }
            }
          }
        ]
      },
      "WeeklyIntervalSchedule": {
        "type": "object",
        "description": "It signifies a week long alert schedule. This schedule is effective according to actor's (user/camera/account) timezone. It allows setting different times for different days.\n",
        "properties": {
          "sunday": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Interval"
            }
          },
          "monday": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Interval"
            }
          },
          "tuesday": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Interval"
            }
          },
          "wednesday": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Interval"
            }
          },
          "thursday": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Interval"
            }
          },
          "friday": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Interval"
            }
          },
          "saturday": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Interval"
            }
          }
        }
      },
      "Interval": {
        "type": "object",
        "description": "Interval of a schedule. If the start time is greater than the end time, the interval is considered to cover the remaining time of the day from the start time until 24:00, and then from 00:00 to the end time. \nFor example, start: 16:30 and end: 06:00 on monday means the interval covers from 16:30 to 24:00 and continues from 00:00 to 06:00 on the same day (monday).\n",
        "properties": {
          "start": {
            "type": "string",
            "pattern": "^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$",
            "description": "Starting point of the interval. It should be in the range of 00:00 to 23:59 since this is the range for a day"
          },
          "end": {
            "type": "string",
            "pattern": "^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$",
            "description": "End point of the interval. It should be in the range of 00:00 to 23:59 since this is the range for the day"
          }
        },
        "required": [
          "start",
          "end"
        ]
      },
      "ApiV3Error": {
        "type": "object",
        "properties": {
          "code": {
            "description": "HTTP code defined in EEN Standard Code Values",
            "type": "integer"
          },
          "status": {
            "description": "A string enum describing the code",
            "type": "string",
            "enum": [
              "cancelled",
              "unknown",
              "invalidArgument",
              "deadlineExceeded",
              "notFound",
              "conflict",
              "permissionDenied",
              "resourceExhausted",
              "failedPrecondition",
              "aborted",
              "outOfRange",
              "unimplemented",
              "internal",
              "unavailable",
              "dataLoss",
              "unauthenticated",
              "mediaTypeNotSupported",
              "acceptNotSupported",
              "methodNotSupported",
              "tooManyRequests",
              "badGateway"
            ]
          },
          "message": {
            "description": "Developer friendly human readable error message in English",
            "type": "string"
          },
          "details": {
            "description": "An array of extensible objects that define error information",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ExceptionDetail"
            }
          }
        },
        "required": [
          "code",
          "status",
          "message",
          "details"
        ]
      },
      "ExceptionDetail": {
        "type": "object",
        "oneOf": [
          {
            "$ref": "#/components/schemas/ErrorInfoExceptionDetail"
          },
          {
            "$ref": "#/components/schemas/BadRequestExceptionDetail"
          },
          {
            "$ref": "#/components/schemas/ResourceInfoExceptionDetail"
          }
        ],
        "discriminator": {
          "propertyName": "type",
          "mapping": {
            "errorInfo": "#/components/schemas/ErrorInfoExceptionDetail",
            "badRequest": "#/components/schemas/BadRequestExceptionDetail",
            "resourceInfo": "#/components/schemas/ResourceInfoExceptionDetail"
          }
        },
        "properties": {
          "type": {
            "description": "A string enum describing the type of detail object.",
            "type": "string",
            "enum": [
              "errorInfo",
              "badRequest",
              "resourceInfo"
            ]
          }
        },
        "required": [
          "type"
        ]
      },
      "ErrorInfoExceptionDetail": {
        "properties": {
          "type": {
            "description": "A string enum describing the type of detail object.",
            "type": "string",
            "enum": [
              "errorInfo"
            ]
          },
          "reason": {
            "description": "The reason for the error. This is a constant value that identifies the proximate cause of the\nerror. Error reasons are unique within a particular domain of errors.\n",
            "type": "string",
            "enum": [
              "unauthenticated",
              "unexpectedArgument",
              "missingRequiredArgument",
              "wrongArgumentValue",
              "invalidPermission",
              "wrongEdition",
              "wrongAccountType",
              "resourceNotFound",
              "endpointNotFound",
              "methodNotSupported",
              "unexpectedError",
              "acceptNotSupported",
              "alreadyExists",
              "foreignKeyConflict",
              "childDevicesExist",
              "contentNotSupported",
              "deadlineExpired",
              "tooManyRequests",
              "deviceUnavailable",
              "serviceUnavailable",
              "invalidJSON",
              "resourceLocked",
              "notSupportedOnBridge",
              "outOfRetention",
              "deviceIdentificationFailed",
              "credentialValidationFailed",
              "credentialSetupFailed",
              "localUrlValidationFailed",
              "hwRegistrationFailed",
              "failedAddingCameraAfterValidation",
              "neverConnected",
              "reconnectFailed",
              "unsupportedModel",
              "purged",
              "userBlocked",
              "userTemporarilyBlocked",
              "quotaExceeded",
              "alreadyValidated",
              "reAuthenticationRequired",
              "badGateway"
            ]
          },
          "domain": {
            "description": "Logical grouping to which the \"reason\" belongs\n",
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/ExceptionMetadata"
          }
        }
      },
      "BadRequestExceptionDetail": {
        "properties": {
          "type": {
            "description": "A string enum describing the type of detail object.",
            "type": "string",
            "enum": [
              "badRequest"
            ]
          },
          "argumentViolations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ArgumentViolation"
            }
          }
        }
      },
      "ArgumentViolation": {
        "properties": {
          "argumentName": {
            "type": "string",
            "description": "Name of the argument"
          },
          "description": {
            "type": "string",
            "description": "Description of the violation"
          }
        }
      },
      "ResourceInfoExceptionDetail": {
        "properties": {
          "type": {
            "description": "A string enum describing the type of detail object.",
            "type": "string",
            "enum": [
              "resourceInfo"
            ]
          },
          "resource": {
            "description": "Referenced resource type, eg \"cameras\", \"bridges\", or \"locations\".",
            "type": "string"
          },
          "ids": {
            "type": "array",
            "description": "Identities of resources",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "ExceptionMetadata": {
        "properties": {
          "path": {
            "description": "Path of the request",
            "type": "string"
          },
          "method": {
            "description": "Method of the request",
            "type": "string"
          }
        }
      }
    }
  }
}
```