Docs
Update Rule
PUT /rule-sets/{ruleSetId}/rules/{ruleId}
PUT
/rule-sets/{ruleSetId}/rules/{ruleId}Required Tokens
| Field | Type | Required | Description |
|---|---|---|---|
| Bearer | Authorization: Bearer <api-key> | Optional | Your API key. Pass it as the Bearer token on every request. |
| Organization token | x-Organization-Token | Optional | Run **Authorize Organization** in the Authorization folder. |
Replaces a rule's fields.
Requires
ResourceTypeDatabase.Edit permission.Path Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| ruleSetId | Guid | Required | The rule set. |
| ruleId | Guid | Required | The rule. |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| name | string | Required | Rule name. |
| description | string | Optional | Description. |
| priority | int | Required | Evaluation order. |
| conditionType | string | Required | `BlockDuration`, `TimeSinceClearance` or `TimeOfDayWindow`. |
| trackedBlockTypeId | Guid? | Optional | The block type the rule tracks. |
| isActive | bool | Optional | Defaults to `true` on create. |
| windowStart / windowEnd | time? | Optional | `HH:mm:ss`, for `TimeOfDayWindow`. When both are equal the window covers the whole day. |
| resultingStateId | Guid? | Optional | State applied inside the window. |
| daysOfWeek | string[] | Optional | `Sunday` to `Saturday`. |
| annualDates | string[] | Optional | `TimeOfDayWindow` only. Dates that repeat every year, either `MM-DD` (`07-04`) or the Nth or last weekday of a month, `MM-{ordinal}-{weekday}` (`05-Last-Monday`). Ordinal is `1`, `2`, `3`, `4` or `Last`. No duplicates. |
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. With dates only, it is live on those dates alone. A date matches the actual calendar day, never a weekend observance.
Response
200 OK. No response body.
Error Codes
| HTTP Status | Description |
|---|---|
| 400 | Invalid arguments, including annualDates on a BlockDuration or TimeSinceClearance rule, a malformed date, or duplicates. |
| 404 | Rule set, rule, block type or state not found. |