Apply a set of rule_template records to a raw JSON payload.
The ``rules`` list contains rule_template records fetched from the external
API. This service does not store them — it only executes them.
Only ``is_active=true`` rules are applied, sorted by ``position`` ascending.
Rules with ``condition_data`` are skipped when their condition is not met.
``CUSTOM_JS`` rules run a sandboxed JavaScript snippet over the payload
(unless disabled via settings, in which case they are reported as errored).
Returns the original payload, the transformed payload, and a per-rule log.
When ``include_diff=true``, a ``diff`` field carries the before/after state
of the payload around each rule, for the UI to debug modifications.
Request
This endpoint expects an object.
messagestringRequired
Raw JSON payload to transform
ruleslist of objectsRequired
rule_template records to apply (from the external service)
Response
Successful Response
transformed_messagestring
difflist of objects or nullOptional
Per-rule before/after snapshots; present only with include_diff