Skip to main content
POST
Preview an atomic rule-configuration change set
Checks a complete proposed rule configuration and returns the changes it would make. Nothing changes until you apply the preview, and rule_configuration_version stays unchanged. Each rule replaces its stored definition, and omitting an existing rule archives it when the preview is applied. Start from the current configuration to keep existing rules intact. Include field_definitions for new event fields the proposed rules read, and state_definitions for any new counters or tags they write (definitions are shared across the organization; unrecognized event field reads return a validation error). Send the returned preview_token and request_hash to Apply a rule-configuration change set. Only the caller who created the preview can apply it, and it must be applied before expires_at.
See Preview and apply for preparing and reviewing a configuration change.

Authorizations

Authorization
string
header
default:sk_...
required

Send your API key as Authorization: Bearer <key>.

Path Parameters

program_id
string<uuid>
required

The program's id.

Body

application/json

Complete proposed rule configuration

The complete rule configuration you want for a program. Scrip compares it with the live configuration and returns the changes. Nothing is saved.

base_rule_configuration_version
integer
required

Current rule_configuration_version from the configuration read endpoint.

Required range: x >= 1
Example:

4

rule_sets
object[]
required

Complete desired rule-set and non-archived rule configuration in execution order.

Minimum array length: 1

A rule set in a proposed configuration, with its rules. Use id for an existing set or client_ref for a new one.

Example:
field_definitions
object[]

Fields to save with the rule change.

source
object

Optional caller category and correlation reference for audit history. Defaults to type api.

state_definitions
object[]

Counters and tags to save with the rule change.

Response

The planned changes, and the token and hash to apply them

The changes a proposed rule configuration would make, and the token and hash to apply it.

base_rule_configuration_version
integer

Configuration version the preview was planned from.

change_id
string<uuid>

The id of this change. The apply response and the revision history carry the same id.

diff
object

Resource-level changes between the base and proposed configurations.

expires_at
string<date-time>

When preview_token stops working.

field_definitions
object[]

Fields to save with the rule change.

local_references
object

Mapping from each client_ref to its preview-allocated stable UUID.

preview_token
string

The token to send to apply. Nobody else can use it, and it stops working at expires_at.

Example:

"ahSToYq-OEn3S2Q1-qOP7iebMf_xahN0KciKUSygcKs"

proposed_rule_configuration
object

The configuration that apply will save.

request_hash
string

The hash to send to apply with preview_token.

Example:

"3a7bd3e2360a3d29eea436fcfb7e44c735d117c42d1c1835420b6b9942dd4f1b"

source
object

Who is making the change, as recorded with the preview.

state_definitions
object[]

Counters and tags to save with the rule change.

warnings
object[]

Non-blocking advisories found while validating the proposed configuration.