Skip to main content
PATCH
Update a rule
Partially updates a rule’s configuration. You can modify name, description, condition, actions, rule_set_id, stop_after_match, active_from, active_to, budgets, or status. Only the fields included in the request body are changed; omitted fields remain untouched. The budgets field is a full replacement when present. The provided array replaces all existing budgets. Omitting the field leaves budgets unchanged. To remove all budgets, send an empty budgets array. To suspend a rule without archiving it, set status to SUSPENDED. To archive a rule, set status to ARCHIVED. Suspended rules retain their position. Archived rules leave the sequence. stop_after_match remains local to the rule’s containing set. Moving a stopping rule changes which later rules it can skip. Supplying rule_set_id moves the rule to that set and renumbers both affected sets. To also control where it lands, use the move rule endpoint, which takes a position and an expected_rule_configuration_version for conflict-safe placement. Archived rules cannot be modified. Rules belonging to an archived program also cannot be modified. Successful configuration changes include the resulting rule_configuration_version; no-op writes retain the current version.
For moving and conflict-safe reordering patterns, see the Rule sets guide.

Authorizations

X-API-Key
string
header
required

API key passed in the X-API-Key header.

Path Parameters

id
string<uuid>
required

Rule ID

Body

application/json

Fields to update

Request body for updating an existing rule. Only provided fields are updated; at least one field must be specified.

actions
CREDIT action · object · DEBIT action · object · HOLD action · object · RELEASE action · object · RELEASE action · object · FORFEIT action · object · VOID_HOLD action · object · TAG action · object · UNTAG action · object · COUNTER action · object · SET_ATTRIBUTE action · object · SET_TIER action · object · SCHEDULE_EVENT action · object · BROADCAST action · object[]

Replacement actions array. Omit to leave actions unchanged. If provided, must be non-empty.

Credit an asset to the target. Requires asset_id and a positive amount. reference_id, expires_at, and matures_at apply to LOT-mode assets only.

Example:
active_from
string<date-time>

Start of the rule's active window (RFC 3339). Send null to clear.

Example:

"2024-01-01T00:00:00Z"

active_to
string<date-time>

End of the rule's active window (RFC 3339). Send null to clear.

Example:

"2024-12-31T23:59:59Z"

budgets
(Lifetime budget · object | Cron budget · object | Interval budget · object)[]

Replacement budget array. Omit to leave budgets unchanged. Send empty array to remove all budgets.

Never resets. schedule_type, cron_expression, and interval are all rejected.

condition
string

Updated CEL expression

Minimum string length: 1
Example:

"event.type == 'purchase'"

description
string

Updated description

Maximum string length: 1000
Example:

"Updated description"

name
string

Updated display name

Required string length: 1 - 255
Example:

"Updated Rule Name"

rule_set_id
string<uuid>

Move this rule to another rule set. Omit to keep the current assignment.

Example:

"550e8400-e29b-41d4-a716-446655440001"

status
enum<string>

Updated lifecycle status: ACTIVE, SUSPENDED, or ARCHIVED

Available options:
ACTIVE,
SUSPENDED,
ARCHIVED
Example:

"SUSPENDED"

stop_after_match
boolean

Whether to stop evaluating subsequent rules in this set after this one matches; other sets continue

Example:

true

Response

Updated rule

actions
object[]

Actions to execute when the condition matches

Example:
active_from
string<date-time>

Start of the rule's active window (RFC 3339, null if always active). Checked against the event's event_timestamp, inclusive.

Example:

"2024-01-01T00:00:00Z"

active_to
string<date-time>

End of the rule's active window (RFC 3339, null if no end date). Checked against the event's event_timestamp, exclusive.

Example:

"2024-12-31T23:59:59Z"

budgets
object[]

Budget constraints applied to this rule

condition
string

CEL expression that determines when the rule fires

Example:

"event.type == 'purchase' && event.amount > 0"

created_at
string<date-time>

When this rule was created (RFC 3339)

Example:

"2024-01-15T10:30:00Z"

deleted_at
string<date-time>

When this rule was archived (null if not archived)

Example:

"2024-06-01T00:00:00Z"

description
string

Human-readable summary of what this rule does

Example:

"Awards 10 points per dollar spent"

id
string<uuid>

Unique identifier for this rule

Example:

"550e8400-e29b-41d4-a716-446655440000"

name
string

Display name

Example:

"Purchase Reward"

order
integer

Evaluation position within the containing rule set (lower = first; ACTIVE and SUSPENDED rules occupy unique positions)

Example:

1

program_id
string<uuid>

Program this rule belongs to

Example:

"550e8400-e29b-41d4-a716-446655440001"

rule_configuration_version
integer

Resulting program rule-configuration revision. Present on mutation responses.

Example:

4

rule_set_id
string<uuid>

Rule set that contains this rule and scopes its order and stop_after_match behavior

Example:

"550e8400-e29b-41d4-a716-446655440002"

status
string

Lifecycle status: ACTIVE, SUSPENDED, or ARCHIVED

Example:

"ACTIVE"

stop_after_match
boolean

When true, no subsequent rules in this set evaluate after this one matches; other sets continue

Example:

false

updated_at
string<date-time>

When this rule was last modified (RFC 3339)

Example:

"2024-01-15T10:30:00Z"

warnings
object[]

Non-blocking advisories about the rule's condition or action expressions, such as unknown state-key typos or deprecated CEL aliases. Present on create/update only; never blocks the save.