Simulate a rule
Rules
Simulate a rule
Dry-run a rule against sample event data. No ledger changes occur.
POST
Simulate a rule
Dry-runs a rule against sample data without persisting any changes. No balances are modified, no counters are incremented, and no events are recorded. TheDocumentation Index
Fetch the complete documentation index at: https://docs.scrip.dev/llms.txt
Use this file to discover all available pages before exploring further.
event field is required and should mirror the shape of a real event your system would send. The participant_state field is optional and lets you provide mock tags, counters, and attributes so the condition can reference participant data.
The response contains two top-level objects:
rule: static metadata about the rule:id,name,condition,order, andstop_after_matchevaluation: the simulation outcome:matched: whether the condition evaluated totruestatus:evaluatedon success, orcondition_failedif the CEL expression erroredreason: error message, present only whenstatusiscondition_failedresults: present only whenmatchedistrue. Each entry pairs the originalactiondefinition with aresultcontaining computed values
| Action type | Result fields |
|---|---|
CREDIT, DEBIT, HOLD, RELEASE, FORFEIT | amount, asset_symbol, description |
COUNTER | current_value, projected_value, value, description |
TAG | current_tags, would_add, description |
UNTAG | current_tags, would_remove, description |
SET_ATTRIBUTE | current_value, would_change, description |
SET_TIER | description |
SCHEDULE_EVENT | description |
BROADCAST | description |
VOID_HOLD actions are not yet supported in simulation.
For asset actions, amount reflects the resolved CEL expression (if dynamic) and asset_symbol is the symbol of the target asset. Participant-state projections (current_value, would_add, etc.) are only included when the action targets the event participant.
Use this to validate rule logic before deploying, or to debug why a rule isn’t matching in production. To check CEL syntax without needing an existing rule, use the validate endpoint.
For usage patterns and examples, see the Writing Rules guide.
Authorizations
API key passed in the X-API-Key header.
Path Parameters
Rule ID
Body
application/json
Sample event and optional participant state
Event is the sample event data to evaluate against the rule
Example:
{ "amount": 75, "type": "purchase" }ParticipantState is optional simulated participant state (tags, counters, attributes)
Example:
{
"attributes": { "region": "US" },
"counters": { "purchase_count": 9 },
"tags": ["vip"]
}