Docs

Add Rule

POST /rule-sets/{ruleSetId}/rules

POST/rule-sets/{ruleSetId}/rules

Adds a rule to a rule set. A TimeOfDayWindow rule is live on a day when the weekday is in daysOfWeek or the day matches an entry in annualDates; with neither set it is live every day, and with dates only it is live on those dates alone. A date matches the actual calendar day, never a weekend observance. resultingStateId comes from ResourceTypes_GetResourceStates. A BlockDuration rule accumulates time in every block type listed in trackedBlockTypeIds (at least one, from ResourceTypes_GetScheduleBlockTypes); other rules send it empty. scope is Event (each event evaluates it over its own hours) or Organization (evaluated across every event and org-direct work). exemptBlockTypeIds lists block types the rule ignores, from ResourceTypes_GetScheduleBlockTypes; empty ignores none. Requires ResourceTypeDatabase.Edit.

Path Parameters

FieldTypeRequiredDescription
ruleSetIduuidRequired

Request Body

FieldTypeRequiredDescription
namestringOptional
descriptionstringOptional
priorityintegerOptional
conditionTypestringOptional
trackedBlockTypeIdsuuid[]Optional
isActivebooleanOptional
windowStarttimeOptional
windowEndtimeOptional
resultingStateIduuidOptional
daysOfWeekstring[]Optional
annualDatesstring[]Optional
scopestringOptional
exemptBlockTypeIdsuuid[]Optional