Docs

Add Rule

POST /rule-sets/{ruleSetId}/rules

POST/rule-sets/{ruleSetId}/rules

Adds a rule to a rule set; resources governed by the set are re-evaluated. conditionType is BlockDuration, TimeSinceClearance or TimeOfDayWindow, and resultingStateId comes from Resources_GetResourceStates. A TimeOfDayWindow rule is live on a day when the weekday is in daysOfWeek or the day matches an annualDates entry (MM-DD, or MM-ordinal-weekday such as 05-Last-Monday, where ordinal is 1, 2, 3, 4 or Last); with neither it is live every day, and a date matches the actual calendar day, never a weekend observance. When windowStart and windowEnd are equal the window covers the whole day. Needs the event settings permission.

Path Parameters

FieldTypeRequiredDescription
ruleSetIduuidRequired

Request Body

FieldTypeRequiredDescription
namestringOptional
descriptionstringOptional
priorityintegerOptional
conditionTypestringOptional
trackedBlockTypeIduuidOptional
isActivebooleanOptional
windowStarttimeOptional
windowEndtimeOptional
resultingStateIduuidOptional
daysOfWeekstring[]Optional
annualDatesstring[]Optional