Rule Simulation
Use the simulation endpoint to test a rule against sample data without creating real events or affecting balances. Simulation evaluates the rule’s CEL condition and returns what actions would fire, without executing them.participant_state, you can pass participant_id to simulate against a real participant’s live tags, counters, attributes, tiers, identity fields, and ledger balances, the same context production evaluation sees. The two fields are mutually exclusive. If the rule’s condition reads participant state and you provide neither, the response includes a missing_participant_context warning and the condition evaluates against empty defaults (counters 0, no tags, attributes, or balances).
participant_state may be JSON numbers or decimal strings (the format the participant state endpoints return). Both are evaluated numerically, so you can paste a counters map from a real state read directly into a simulation request.
Simulation enforces the same constraints as production execution: asset action amounts must resolve to positive values, and event numbers beyond the 2^53 precision boundary are rejected with 400 amount_precision_exceeded.
Simulation does not execute SCHEDULE_EVENT or BROADCAST actions, but it does resolve their payload templates: the action result shows the resolved payload the action would emit, or an error naming the payload field when a template fails. Bad payload templates surface here instead of waiting for a live event.
Simulating a draft rule
To simulate a rule before saving it, usePOST /v1/rules/simulate. It takes a program_id, a rule object with name, condition, and actions, and the same event, participant_id, and participant_state fields as saved-rule simulation; the draft is validated exactly like rule create but nothing is persisted.
Validation
To check an expression without creating a rule, use the validation endpoint:event.* field references like event.amount are not verified because events are schemaless. Participant fields, tier keys, and asset symbols are validated when you save a rule; pass program_id to this endpoint to run the same reference checks before saving.