Docs

Update Rule

PUT /rule-sets/{ruleSetId}/rules/{ruleId}

PUT/rule-sets/{ruleSetId}/rules/{ruleId}

Required Tokens

FieldTypeRequiredDescription
BearerAuthorization: Bearer <api-key>OptionalYour API key. Pass it as the Bearer token on every request.
Event tokenx-Event-TokenOptionalRun **Get Tokens** in the Authorization folder, or call `GET /Events/{eventId}/authorize` manually.

Replaces a rule's fields.

Requires EventSettings permission on the event.
Event scoping: This endpoint does not include {eventId} in the URL. The event is determined automatically from your x-Event-Token.

Path Parameters

FieldTypeRequiredDescription
ruleSetIdGuidRequiredThe rule set.
ruleIdGuidRequiredThe rule.

Request Body

FieldTypeRequiredDescription
namestringRequiredRule name.
descriptionstringOptionalDescription.
priorityintRequiredEvaluation order.
conditionTypestringRequired`BlockDuration`, `TimeSinceClearance` or `TimeOfDayWindow`.
trackedBlockTypeIdGuid?OptionalThe block type the rule tracks.
isActiveboolOptionalDefaults to `true` on create.
windowStart / windowEndtime?Optional`HH:mm:ss`, for `TimeOfDayWindow`. When both are equal the window covers the whole day.
resultingStateIdGuid?OptionalState applied inside the window.
daysOfWeekstring[]Optional`Sunday` to `Saturday`.
annualDatesstring[]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 StatusDescription
400Invalid arguments, including annualDates on a BlockDuration or TimeSinceClearance rule, a malformed date, or duplicates.
404Rule set, rule, block type or state not found.