Skip to main content
POST
Preview rule

Authorizations

Authorization
string
header
required

Path Parameters

project_id
string
required

The project's friendly ID (e.g. prj_aBcD1234eFgH5678).

Body

application/json
rule
object
required
page
integer
default:1

One-based page number for preview results.

Required range: x >= 1
page_size
integer
default:25

Number of preview results per page.

Required range: 1 <= x <= 200

Response

Preview result

valid
boolean
error
string | null

Friendly parse error when valid is false

results
object[]

Targets that matched the rule: data points for data_point, batches for model. A data_point preview returns one row per data point the rule would flag — the same grain results are stored at — so an event with two breaching data points yields two rows.

info
object

Pagination metadata for preview results.

referenced_slugs
string[]
referenced_node_ids
integer[]
expansion_node_ids
integer[]
suggested_window_member_scope
enum<string> | null

Suggested action reach: run when every alternative in the condition requires MIN = MAX over each subject's slug and window; all otherwise. Returned even when the selected scope is invalid; null when the condition cannot be validated. The detection window remains unchanged. Apply the suggestion only when the author chooses it; loading or previewing an existing repeats version must not silently replace its saved window_member_scope.

Available options:
all,
run
sampled
boolean

True when the project has more candidate events than the preview can evaluate in-request. The preview then covers only the most-recent events (see preview_window); create the rule for a full evaluation.

scanned_count
integer

Number of candidate events (model runs for model previews) evaluated to produce this preview.

candidate_count
integer

Candidate events (model runs for model previews) matched by the rule's slugs and period, before evaluation. The denominator for scanned_count: when it exceeds scanned_count, info.count is a match count over the scanned slice only, not over the whole period.

candidate_count_capped
boolean

True when counting stopped at the preview's internal cap, so the real population is at least candidate_count rather than exactly it. Narrow effective_from/effective_to until it is false to get an exact denominator.

preview_window
object

The time span actually scanned for this preview.

default_window
object | null

Present when no effective_from was supplied. The preview is bounded to a default look-back window ending at effective_to or now; supply effective_from to preview a specific range.

effective_from
string<date> | null
effective_to
string<date> | null