Skip to main content

Rule System

The Rule System is a rule engine designed to trigger actions when the rule's conditions are met. It evaluates device sensor data against defined rules and executes actions such as creating alerts, sending emails, publishing MQTT messages, and more.


Core Concepts

Rule Group & Rule

Rule Groups organize related Rules that share the same stateName. Key principles:

  • Each Rule Group contains multiple rules.
  • Rules within a Rule Group modify values for the same state name.
  • Rules can have different trigger types: Time-Triggered, Data-Triggered, EventData-Triggered, or State-Time Transition.
  • A Rule Group can be associated with one or more Validity entities to control when the group is active.

Validity

Validity manages the activation times for a Rule Group. It allows scheduling when certain rule groups should be active, based on weekdays, hours of the day, and specific datetime ranges.

For example, a Validity entity that is active on weekdays from 9 AM to 5 PM UTC:

const validity = new ValidityEntity({
workspace: 'myWorkspace',
name: 'Weekday Business Hours',
monday: true,
tuesday: true,
wednesday: true,
thursday: true,
friday: true,
saturday: false,
sunday: false,
startHour: 9,
endHour: 17,
utcOffset: 0,
});

Rule Processing Flow


Entities Reference

RuleGroupEntity

FieldTypeDescription
idnumberAuto-increment primary key
identifierstring (UUID)Unique identifier, auto-generated
stateNamestring | nullState machine name shared by all rules in this group
descriptionstring | nullHuman-readable description
deviceIdsstring[] | nullTarget specific device IDs (null = all workspace devices)
deviceTypesstring[] | nullTarget specific device types (null = all types)
exceptDeviceIdsstring[] | nullExclude specific device IDs
exceptDeviceTypesstring[] | nullExclude specific device types
zoneTypeUnionstring[] | nullZone type union for zone-scoped rule evaluation
extrajson | nullAdditional metadata
workspacestringWorkspace ID (multi-tenant)
disableAtDate | nullSoft-delete timestamp
validityEntityValidityEntity[]Associated validity schedules
rulesRuleEntity[]Child rules

RuleEntity

FieldTypeDescription
idnumberAuto-increment primary key
identifierstring (UUID)Unique identifier, auto-generated
descriptionstring | nullHuman-readable description
conditionsConditionFields[] | nullArray of conditions to evaluate
conditionTypestring"and-case" (all must match) or "or-case" (any must match)
workspacestringWorkspace ID
triggerTypestring"data" | "time" | "event_data" | "state_time"
eventTypesstring[] | nullEvent type filters (for event_data trigger only)
stateTimeConditionstring | nullDuration string (for state_time trigger only)
crontabExpressionsstring[] | nullCron expressions (for time trigger only)
triggerStatenumberRequired current state for the rule to trigger (default 0)
targetStatenumberState to set after rule triggers (default 0)
createdAtDateCreation timestamp
updateAtDateLast update timestamp
disableAtDate | nullSoft-delete timestamp
tagsTagEntity[]Associated tags
actionEntityActionEntity[]Associated actions
ruleGroupRuleGroupEntityParent rule group
  • triggerState: The state value that must match for the rule to evaluate. 0 = normal state, > 0 = abnormal state. If the current state does not equal triggerState, the rule is skipped.
  • targetState: The state to transition to after the rule triggers. This prevents the rule from triggering repeatedly.

ValidityEntity

FieldTypeDescription
idnumberAuto-increment primary key
identifierstring (UUID)Unique identifier, auto-generated
workspacestringWorkspace ID
namestringValidity name
descriptionstring | nullHuman-readable description
monday - sundaybooleanDay-of-week flags (default true)
startHournumberActive start hour, 0-24 decimal (default 0)
endHournumberActive end hour, 0-24 decimal (default 24)
startDatetimeDate | nullAbsolute start datetime
endDatetimeDate | nullAbsolute end datetime
utcOffsetnumberUTC offset in hours (default 0)
createdAtDateCreation timestamp
updateAtDateLast update timestamp
disableAtDate | nullSoft-delete timestamp

StateEntity

States track the current value of a stateName per device or zone. This is how the rule engine prevents repeat triggering.

FieldTypeDescription
idstring (UUID)Primary key
stateNamestringState machine name (from Rule Group)
statenumberCurrent state value (0 = normal)
stateStartAtDateWhen the current state began (updates on state change)
deviceIdstring | nullDevice-scoped state (mutually exclusive with zoneUnion)
zoneUnionstring | nullZone-scoped state (mutually exclusive with deviceId)
workspacestringWorkspace ID

TagEntity

Tags label rules for organization and filtering.

FieldTypeDescription
idnumberAuto-increment primary key
tagstringTag value
descriptionstring | nullHuman-readable description
workspacestring | nullWorkspace ID
createdAtDateCreation timestamp
updateAtDateLast update timestamp
disableAtDate | nullSoft-delete timestamp

Rule Example

{
"id": 28,
"rules": [
{
"id": 794,
"conditions": [
{
"field": "occupyStartDate",
"operator": "ISOTimePassed",
"value": "{\"seconds\":300}",
"aggregator": ""
}
],
"conditionType": "and-case",
"workspace": "7b6a01b4-2cf3-4e29-998b-5b1ffd59a81e",
"triggerType": "data",
"crontabExpression": null,
"triggerState": 0,
"targetState": 1,
"actionEntity": [
{
"id": 6,
"workspace": "7b6a01b4-2cf3-4e29-998b-5b1ffd59a81e",
"description": null,
"type": "alert",
"meta": null
}
]
},
{
"id": 793,
"conditions": [
{
"field": "occupyStartDate",
"operator": "isNull",
"value": "",
"aggregator": ""
}
],
"conditionType": "and-case",
"workspace": "7b6a01b4-2cf3-4e29-998b-5b1ffd59a81e",
"triggerType": "data",
"crontabExpression": null,
"triggerState": 1,
"targetState": 0,
"actionEntity": []
}
],
"description": "some text",
"field": "occupyStartDate",
"stateName": "occupyStartDate",
"deviceIds": null,
"deviceTypes": null,
"extra": null,
"workspace": "7b6a01b4-2cf3-4e29-998b-5b1ffd59a81e",
"validityEntity": []
}

Rule Types

There are 4 types of rules based on trigger type:

1. Data-Triggered ("data")

Activated when specified data conditions are met (e.g., sensor readings exceeding thresholds). Evaluated each time new sensor data arrives for the device.

2. Time-Triggered ("time")

Activated based on specific time schedules using cron expressions. Evaluated every minute by a cron job.

3. EventData-Triggered ("event_data")

Triggered in response to internal Seer platform events. The eventTypes field filters which events activate the rule.

Available event types:

Event TypeDescription
new_data.httpNew data from HTTP sources
new_data.mqttNew data from MQTT sources
new_data.wsNew data from WebSocket sources
new_data.simulatorNew data from simulator sources
new_data.internalNew data from internal sources
alert.triggerAn alert was created
infer.ruleAn inference rule was evaluated
infer.linkAn inference link was evaluated
rule.state_changeA rule's state changed
task.createA task was created
task.ackA task was acknowledged
task.closeA task was closed
task.reopenA task was reopened

4. State-Time Transition ("state_time")

Triggered when the current state has persisted for a specified duration. Combines state monitoring with time-based persistence checks. For example: "temperature state has been 1 (abnormal) for more than 5 minutes".

The stateTimeCondition field specifies the duration as a JSON-encoded Luxon Duration object:

KeyTypeExample
secondsnumber{"seconds": 300} (5 minutes)
minutesnumber{"minutes": 5}
hoursnumber{"hours": 1}
daysnumber{"days": 2}
weeksnumber{"weeks": 1}
monthsnumber{"months": 1}

State-time rules can also have additional conditions that must be met alongside the duration check.


Conditions & Operators

Condition Structure

Each condition in the conditions array has these fields:

FieldTypeRequiredDescription
fieldstringYesDot-path to the data field (e.g., temperature, payload.values.LoadUnit)
operatorstringYesComparison operator
valueanyYesComparison value
aggregatorstringNoAggregation method for array fields

Supported Operators

OperatorDescription
=Exact match
!=Not equal
>Greater than
<Less than
>=Greater than or equal
<=Less than or equal
rangeWithin a range of values
!rangeOutside a range of values
existField exists in data
isNullField is null or doesn't exist
containsData field contains this string
!containsData field does not contain this string
startsWithData field starts with this string
!startsWithData field does not start with this string
endsWithData field ends with this string
!endsWithData field does not end with this string
ISOTimePassedISO time has passed within a duration
UnixTimestampMsPassedUnix timestamp (ms) has passed within a duration
UnixTimestampPassedUnix timestamp (seconds) has passed within a duration

Aggregators

When the field resolves to an array of values, an aggregator determines how to combine them:

AggregatorBehavior
(none) / "any"Default. Rule triggers if any record matches the condition
"all"Rule triggers if every record matches the condition
"avg"Averages numeric values, then compares the result
"min"Takes the minimum numeric value, then compares
"max"Takes the maximum numeric value, then compares
"sum"Sums all numeric values, then compares

Rule Actions

When a rule's conditions are met, the associated actions are executed. Each action has a type and a meta object containing action-specific configuration.

Supported Action Types

TypeDescription
alertCreate an alert in the Seer platform
alarmSend an alarm to an alarmbox via MQTT
alarmAlertSend an alarm and create an alert
closeAlertClose existing alerts for a device
cancelAlarmCancel an alarm on the alarmbox
comEasyTaskCreate a task and POST telemetry to a ComEasy system
emailSend an email via template
httpSend an HTTP request via Seer control
inferDataEmit inferred data to the Seer platform
mqttPublish an MQTT payload to the workspace topic
smsSend an SMS message
taskCreate a task in the Seer platform
taskOperationPerform an operation on an existing task (start/complete/reopen)

Action: alert

Creates an alert in the Seer platform.

Meta FieldDescriptionOptionalDefault
descriptionAlert descriptionYes${category.toLowerCase()} detected from ${shortName ?? extName ?? deviceId}
titleAlert titleYes${category} Alarm from ${shortName ?? extName ?? deviceId}
categoryAlert categoryYesUnclassified
locationAlert locationYesThe zoneName of the device

Example:

{
"actions": [
{
"type": "alert",
"meta": {
"category": "high temperature",
"description": "Temperature too high",
"title": "Temperature Alert",
"location": "Room 101"
}
}
]
}

Action: alarm

Sends an alarm to an alarmbox via MQTT.

Meta FieldDescriptionOptional
controlUrlSeer control URL for target alarmDevicesYes
alarmDevicesAlarm device IDsNo
alarmTopicMQTT topic the alarmbox subscribes toNo
additional fieldsAny extra fields to send to the alarmboxYes

Example:

{
"actions": [
{
"type": "alarm",
"meta": {
"controlUrl": "http://controller-office-mqtt",
"alarmTopic": "alarmbox/alarm",
"alarmDevices": ["ALARM_BOX_01"]
}
}
]
}

Action: alarmAlert

Sends an alarm and creates an alert. Combines the meta fields of both alarm and alert.

Meta FieldDescriptionOptional
controlUrlSeer control URL for target alarmDevicesYes
alarmDevicesAlarm device IDsNo
alarmTopicMQTT topic the alarmbox subscribes toNo
categoryAlert categoryYes
descriptionAlert descriptionYes
additional fieldsAny extra fields to send to the alarmboxYes

Example:

{
"actions": [
{
"type": "alarmAlert",
"meta": {
"category": "high temperature",
"description": "Temperature too high",
"controlUrl": "http://controller-office-mqtt",
"alarmTopic": "alarmbox/alarm",
"alarmDevices": ["ALARM_BOX_01"]
}
}
]
}

Action: cancelAlarm

Cancels an active alarm on the alarmbox.

Meta FieldDescriptionOptional
controlUrlSeer control URL for target alarmDevicesYes
alarmDevicesAlarm device IDsNo
alarmTopicMQTT topic for alarm cancellationNo
additional fieldsAny extra fields to send to the alarmboxYes

Example:

{
"actions": [
{
"type": "cancelAlarm",
"meta": {
"controlUrl": "http://controller-office-mqtt",
"alarmTopic": "alarmbox/alarm",
"alarmDevices": ["ALARM_BOX_01"]
}
}
]
}

Action: closeAlert

Closes active alerts for the triggering device. Makes a PATCH request to the Alert service.

Meta FieldDescriptionOptional
anyAdditional fields merged into the close request bodyYes

The device ID and type from the triggering payload are automatically included in the close request.

Example:

{
"actions": [
{
"type": "closeAlert",
"meta": {}
}
]
}

Action: email

Sends an email via the Seer Post service. Reference: Nodemailer.

Meta FieldDescriptionOptional
subjectEmail subjectYes
templateEmail template name stored in Seer (Handlebars format)Yes
contextTemplate context variablesYes
fromSender email addressYes
toRecipient email(s) — string or arrayYes
ccCC email(s) — string or arrayYes
bccBCC email(s) — string or arrayYes
textPlaintext message bodyYes
htmlHTML message bodyYes
additional fieldsAny Nodemailer-supported fieldYes

Example:

{
"actions": [
{
"type": "email",
"meta": {
"subject": "warning: $(extName) is too hot",
"template": "openAlert.hbs",
"to": "$(WS_EMAIL_LIST_1)",
"context": {
"temp": "$(TEMPERATURE)",
"category": "High temperature",
"timeZone": "HongKong"
}
}
}
]
}

Action: http

Sends an HTTP request via Seer control.

Meta FieldDescriptionOptional
controlUrlSeer control URL to relay the request throughYes
urlTarget URLNo
methodHTTP methodNo
headersRequest headersYes
bodyRequest bodyYes
targetDeviceDevice ID for resolving TD_ prefixed variablesYes

Example:

{
"actions": [
{
"type": "http",
"meta": {
"method": "GET",
"url": "$(TEST_URL)/radar/#(TD_extName)",
"headers": {
"Authorization": "Bearer $(TEST_TOKEN)"
},
"body": {
"id": ""
},
"targetDevice": "99c115f4-9ba9-4f82-a8c6-56966ebb45dc"
}
}
]
}

Action: inferData

Emits inferred data to the Seer platform via NATS.

Meta FieldDescriptionOptional
any fieldAny key-value pairs to emit as inferred dataYes

All key-value pairs in meta become the inferred data payload. Values can include Seer variables.

Example:

{
"actions": [
{
"type": "inferData",
"meta": {
"online": false,
"customField": "customValue",
"customField2": true
}
}
]
}

Action: mqtt

Publishes an MQTT payload to the workspace MQTT topic via Seer control.

Meta FieldDescriptionOptional
controlUrlSeer control URLYes
mqttTopicOverride MQTT topic (defaults to workspace topic)Yes
typePayload type (e.g., "cmd", "data")No
payloadSingle object or array of objectsNo

Example (single payload):

{
"actions": [
{
"type": "mqtt",
"meta": {
"type": "cmd",
"payload": {
"id": "d686a6ad-c1e2-4fe0-9c18-5aa56606cdf0",
"description": "testing mqtt",
"condition": "$(RULE_CONDITION)",
"POWER_ON": true,
"SWING": false
}
}
}
]
}

Example (array of payloads):

{
"actions": [
{
"type": "mqtt",
"meta": {
"type": "cmd",
"payload": [
{
"id": "d686a6ad-c1e2-4fe0-9c18-5aa56606cdf0",
"description": "testing mqtt 1",
"POWER_ON": true
},
{
"id": "d686a6ad-c1e2-4fe0-9c18-5aa56606cdf1",
"description": "testing mqtt 2",
"POWER_ON": false
}
]
}
}
]
}

Action: sms

Sends an SMS message via the Seer Post service.

Meta FieldDescriptionOptional
phoneNumbersPhone number(s) — string or arrayNo
messageSMS message contentNo
senderIdSMS sender IDYes
messageTypeType of messageYes

Example:

{
"actions": [
{
"type": "sms",
"meta": {
"phoneNumbers": ["+1234567890", "+0987654321"],
"message": "Alert: Device is offline!",
"senderId": "SeerAlert"
}
}
]
}

Action: task

Creates a task in the Seer platform.

Meta FieldDescriptionOptional
categoryTask categoryYes
descriptionTask descriptionYes

Example:

{
"actions": [
{
"type": "task",
"meta": {
"description": "$(extName) is too hot"
}
}
]
}

Action: taskOperation

Performs an operation on an existing task. The task is found by taskId from the triggering event payload, or by querying with deviceId + category.

Meta FieldDescriptionOptional
operationOperation to perform: "start", "complete", or "reopen"No
descriptionDescription for the operationYes
categoryTask category (used to find the task if taskId not in payload)Yes

Example:

{
"actions": [
{
"type": "taskOperation",
"meta": {
"operation": "start",
"description": "Technician dispatched"
}
}
]
}

Action: comEasyTask

Creates a task and sends telemetry to a ComEasy system. This action first creates a Seer task, then POSTs task details to an external ComEasy endpoint.

Meta FieldDescriptionOptionalDefault
urlComEasy endpoint URLNo
usernameAuthentication usernameNo
passwordAuthentication passwordNo
task_feedback_base_urlBase URL for task feedback callbacksNo
emergency_levelEmergency levelYes1
descriptionTask descriptionYes
device_nameDevice name for ComEasy payloadYes
device_idDevice ID for ComEasy payloadYes
typeRequest typeYes"POST_TELEMETRY_REQUEST"

Seer Variable System

Seer variables allow dynamic value resolution in action meta fields and rule conditions. Variables are written as $(VAR_NAME) or ${VAR_NAME} and are replaced with actual values at execution time.

Rule-Specific Variables

VariableDescription
TRIGGER_FIELD_NAMEThe name of the condition field that matched
TRIGGER_FIELD_VALUEThe value of the condition field that matched
RULE_OBJAccess any field within the rule object via dot-path (e.g., $(RULE_OBJ.conditions.1.field))
RULE_CONDITIONFormatted string of the matched rule conditions
RULE_DESCRIPTIONThe rule's description
RULE_STATE_NAMEThe rule's state name
ACTION_SEQ_NUMUnique action sequence number

RULE_OBJ Usage Examples

"$(RULE_OBJ.conditions.1.field)"       -> "VOLTAGE"
"$(RULE_OBJ.crontabExpressions.0)" -> "* * * * *"
"$(RULE_OBJ.stateTimeCondition)" -> '{"minutes": 5}'

Device-Level Variables

VariableDescription
idUnique identifier for the device
shortNameDevice short name
nameDevice name
typeDevice type
extNameExternal ID or label assigned to the device
extraAdditional device data (e.g., $(extra.diameter))
decoderThe decoder/protocol used by the device
enableAlertWhether alerts are enabled for the device
timeoutDevice timeout period
workspaceThe device's workspace ID
VariableDescription
ZONE_IDZone ID associated with the device
ZONE_NAMEZone name associated with the device
ZONE_TYPEZone type associated with the device

Time Variables

VariableDescription
UNIX_TIMECurrent Unix timestamp (seconds)
UNIX_TIME_MSCurrent Unix timestamp (milliseconds)
UTC_DATECurrent UTC+8 date formatted as MMMM d, yyyy (EEEE)
UTC_TIMECurrent UTC+8 time formatted as HH:mm:ss 'GMT'Z

Target Device Variables (TD_ prefix)

Variables prefixed with TD_ resolve against a different target device instead of the triggering device. Requires targetDevice to be set in the action meta (for http actions) or specified through other means.

Example: $(TD_extName) resolves extName from the target device specified in the action meta.

Workspace Variables

Any variable that doesn't match a built-in code is resolved as a workspace user-defined variable or secret (stored in MinIO). For example, $(WS_EMAIL_LIST_1) would resolve to a workspace configuration variable named WS_EMAIL_LIST_1.

Variable Resolution Order

  1. Rule-specific variables (TRIGGER_*, RULE_*, ACTION_SEQ_NUM)
  2. A field in the triggering payload matching the variable name
  3. A field on the device record matching the variable name (dot-path supported)
  4. A field in the payload (if not the same device)
  5. A configuration/environment variable
  6. Workspace user-defined variable (from MinIO)
  7. Workspace secret (from MinIO)

Variable Interpolation & Calculations

Traditional Variable References

  • Format: $(VARIABLE_NAME) or ${VARIABLE_NAME}
  • Example: $(TEMPERATURE_SENSOR) is replaced with the value of the TEMPERATURE_SENSOR field from the device data.

Calculation Expressions

$SUM(value1, value2, ..., valueN)

Adds all argument values.

$SUM($(VAR1), $(VAR2), 10)  →  adds VAR1 + VAR2 + 10

$SUB(value1, value2, ..., valueN)

Subtracts subsequent values from the first.

$SUB($(VAR1), $(VAR2), 5)  →  VAR1 - VAR2 - 5

$MULT(value1, value2, ..., valueN)

Multiplies all argument values.

$MULT($(VAR1), $(VAR2), 2)  →  VAR1 * VAR2 * 2

$DIV(value1, value2, ..., valueN)

Divides the first value by subsequent values sequentially.

$DIV($(VAR1), $(VAR2), 2)  →  VAR1 / VAR2 / 2

$MAX(value1, value2, ..., valueN)

Returns the maximum of all argument values.

$MAX($(VAR1), $(VAR2), 100)  →  max(VAR1, VAR2, 100)

$MIN(value1, value2, ..., valueN)

Returns the minimum of all argument values.

$MIN($(TEMP1), $(TEMP2), 0)  →  min(TEMP1, TEMP2, 0)

$BOUNDARY(value, min, max)

Clamps value to be between min and max.

$BOUNDARY($(TEMP), 10, 50)  →  clamp(TEMP, 10, 50)

$COALESCE(value1, value2, ..., valueN)

Returns the first non-null, non-undefined value.

$COALESCE($(SPEED), 0)  →  SPEED ?? 0

$CONCAT(value1, value2, ..., valueN)

Concatenates all values as strings.

$CONCAT($(PREFIX), '-', $(SUFFIX))  →  "PREFIX-SUFFIX"

Notes

  • All calculation results are returned as strings for compatibility.
  • Mathematical operations are performed when all arguments are numbers.
  • When any argument is a string, concatenation is performed instead.
  • Division by zero is handled gracefully with error logging.
  • Nested parentheses and quoted strings are properly parsed in arguments.

Time-Triggered Rules

Users specify cron job expressions to schedule rule execution. The rule system evaluates time-triggered rules every minute.

Cron Expression Format

*    *    *    *    *
┬ ┬ ┬ ┬ ┬
│ │ │ │ │
│ │ │ │ └── Day of week (0-7, 1L-7L; 0 or 7 is Sunday)
│ │ │ └───── Month (1-12)
│ │ └────────── Day of month (1-31, L)
│ └─────────────── Hour (0-23)
└──────────────────── Minute (0-59)

The cron expression is validated using the cron-parser library. Second precision is not supported — the system evaluates on a per-minute basis.

Important: If the Rule Group is not active (disabled or outside validity window), the cron job will not trigger.

Testing Cron Expressions

Use the dry-run endpoint to test if a cron expression matches a specific datetime:

POST /rule/v1/rules/cron-expression/dryrun
Body: { "crontabExpression": "* * * * *", "checkWithDate": "2025-01-01T12:00:00Z", "utcOffset": 0 }
Response: true/false

API Reference

Base URL: /rule/v1

Health

MethodPathAuthDescription
GET/healthHealth check (DB ping, memory RSS, NATS connectivity)

Workspace Resources

Bulk operations for all rule resources in a workspace.

MethodPathAuthDescription
GET/workspaceResources/:workspaceLV1Get all workspace resources (rule groups, rules, actions, validities)
POST/workspaceResources/:workspaceLV1Bulk create/import workspace resources
DELETE/workspaceResources/:workspaceLV1Delete all workspace resources

Rules

MethodPathAuthDescription
GET/rules/paginateLV2Paginated rule listing
GET/rules/workspace/:workspaceLV2Get all rules for a workspace
GET/rules/workspace/:workspace/:ruleIdLV2Get a single rule by ID
POST/rules/workspace/:workspaceLV2Create a new rule
PATCH/rules/workspace/:workspace/:ruleIdLV2Update a rule
DELETE/rules/workspace/:workspaceLV2Delete all rules in a workspace
DELETE/rules/workspace/:workspace/:ruleIdLV2Delete a specific rule
POST/rules/workspace/:workspace/:ruleId/addTagLV2Add a tag to a rule
POST/rules/workspace/:workspace/:ruleId/addActionLV2Add an action to a rule
PUT/rules/workspace/:workspace/:ruleId/updateTagLV2Replace all tags on a rule
PUT/rules/workspace/:workspace/:ruleId/updateActionLV2Replace all actions on a rule
POST/rules/workspace/:workspace/dryrunLV3Dry-run rule evaluation against sample data
POST/rules/cron-expression/dryrunLV4Test a cron expression against a datetime
GET/rules/stateLV5Query rule states (with device/zone info)
POST/rules/state/:stateIdLV2Manually set a rule state

Rule Groups

MethodPathAuthDescription
GET/rulegp/paginateLV2Paginated rule group listing
POST/rulegpLV2Create a rule group
PATCH/rulegp/:idLV2Update a rule group
DELETE/rulegp/:ruleGpIdLV2Delete a rule group and all its rules
POST/rulegp/:ruleGpId/enableLV2Enable all rules in a group
POST/rulegp/:ruleGpId/disableLV2Disable (soft-delete) all rules in a group
POST/rulegp/:ruleGpId/cloneLV2Clone a rule group with all its rules
POST/rulegp/:ruleGpId/addValidityLV2Add a validity schedule to a group
PUT/rulegp/:ruleGpId/updateValidityLV2Replace validity schedules on a group
POST/rulegp/:ruleGpId/ruleLV2Create a rule within this group
PATCH/rulegp/:ruleGpId/rule/:ruleIdLV2Update a rule within this group
DELETE/rulegp/:ruleGpId/rule/:ruleIdLV2Delete a rule from this group
POST/rulegp/:ruleGpId/rule/:ruleId/addActionLV2Add an action to a group's rule
PUT/rulegp/:ruleGpId/rule/:ruleId/updateTagLV2Update tags on a group's rule
PUT/rulegp/:ruleGpId/rule/:ruleId/updateActionLV2Update actions on a group's rule

Actions

MethodPathAuthDescription
GET/action/workspace/:workspaceLV2Get workspace actions
POST/action/workspace/:workspaceLV2Create an action
PATCH/action/workspace/:workspace/:actionIdLV2Update an action
DELETE/action/workspace/:workspace/:actionIdLV2Delete an action
POST/action/parse-seer-variableLV2Parse Seer variables in a meta string
GET/action/logs/paginateLV2Get executed action logs (paginated)

Tags

MethodPathAuthDescription
GET/tags/workspace/:workspaceLV1Get workspace tags
POST/tags/workspace/:workspaceLV1Create a tag
DELETE/tags/workspace/:workspace/:tagIdLV1Delete a tag (soft-delete)

Validities

MethodPathAuthDescription
GET/validity/workspace/:workspaceLV2Get workspace validities
POST/validity/workspace/:workspaceLV2Create a validity
PATCH/validity/workspace/:workspace/:validityIdLV2Update a validity
DELETE/validity/workspace/:workspace/:validityIdLV2Delete a validity

Auth Levels

LevelPurpose
LV1Basic read/write access (workspace resources, tags)
LV2Standard workspace operations (rules, rule groups, actions, validities)
LV3Dry-run operations
LV4Cron expression testing
LV5State querying

Action Execution Logging

Every action execution is recorded in the executed_actions table:

FieldDescription
ruleGpIdRule group ID
ruleIdRule ID
ruleTriggerStateTrigger state value
ruleTargetStateTarget state value
ruleTriggerTypeTrigger type at execution
ruleConditionTypeCondition type at execution
ruleConditionsConditions that were matched
actionTypeType of action executed
actionSeqNumSequence number
actionMetaAction meta at execution time
triggerDataTriggering payload data
executionResultSerialized execution result
successWhether execution succeeded
errorMessageError details (if failed)
deviceIdDevice ID
deviceTypeDevice type
executedAtExecution timestamp

View logs via GET /rule/v1/action/logs/paginate.