Add Rule
POST /rule-sets/{ruleSetId}/rules
/rule-sets/{ruleSetId}/rulesAdds 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
| Field | Type | Required | Description |
|---|---|---|---|
| ruleSetId | uuid | Required |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| name | string | Optional | |
| description | string | Optional | |
| priority | integer | Optional | |
| conditionType | string | Optional | |
| trackedBlockTypeIds | uuid[] | Optional | |
| isActive | boolean | Optional | |
| windowStart | time | Optional | |
| windowEnd | time | Optional | |
| resultingStateId | uuid | Optional | |
| daysOfWeek | string[] | Optional | |
| annualDates | string[] | Optional | |
| scope | string | Optional | |
| exemptBlockTypeIds | uuid[] | Optional |