Skip to main content
GET
Get a rule
Returns a single rule by ID, including its containing rule_set_id, its position in that set (order), condition, actions, description, stop_after_match, time window settings, and status. If the rule has budgets configured, the response includes the current budget state for each asset: consumed amount and next_reset_at timestamp. This is the primary way to check how much of a rule’s budget has been spent. To reset a budget manually, use the reset budget endpoint.
For usage patterns and examples, see the Writing Rules 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

Response

Rule details

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.