List Data Policy Rules
List the transformation rules of a data policy: lookups, Lua scripts, computed and conditional fields, all executed in dependency order during resolution.
List the transformation rules of a data policy. Rules are the executable logic of resolution: reference-table lookups (exact and fuzzy), sandboxed Lua scripts, deterministic computations, conditionals, coalescing, and validation checks. The policy compiler orders rules topologically by their field dependencies, so upstream fields always resolve before the rules that read them.
Each rule declares a rule_type, its configuration, and its position (ordinal) in the policy. The compiler validates every rule at compile time: unknown rule types and circular field dependencies are rejected before anything executes against your data.
Rule configuration is where most integration effort goes. A lookup_exact config names the reference table and its search and output columns; lookup_fuzzy adds match tiers and a confidence threshold; a script config carries the Lua source. Reference tables are first-class objects — manage their rows via the [reference data endpoints](list-reference-data), and a lookup reads the table's current rows at execution time, so updating reference data needs no policy edit.
As with fields, GET /v1/data-policies/{id} is the version-resolved view: it returns the current version's rules with input_field_keys, output_field_key, execution_order, and error_behavior — the compiled ordering a run actually follows — alongside the fields they populate. Use it when you need to reason about what the next resolution will execute rather than browse the rule inventory.
/v1/data-policies/{id}/rulesPath parameters
Response
Response fields
curl
curl -s https://api.talonic.com/v1/data-policies/p1a2b3c4-e5f6-7890-abcd-ef1234567890/rules \
-H "Authorization: Bearer tlnc_your_api_key"Response
{
"data": [
{
"id": "r1a2b3c4-0001",
"version_id": "v3a2b3c4-0003",
"field_key": "country_code",
"input_field_keys": ["country"],
"rule_type": "lookup_exact",
"config": {
"reference_table_id": "country_codes",
"search_column": "name",
"output_column": "iso2"
},
"ordinal": 1,
"error_behavior": "flag",
"provenance_label": null
},
{
"id": "r1a2b3c4-0002",
"version_id": "v3a2b3c4-0003",
"field_key": "currency",
"input_field_keys": ["country_code"],
"rule_type": "script",
"config": {
"script": "if record:get('country_code') == 'US' then return 'USD' end"
},
"ordinal": 2,
"error_behavior": "flag",
"provenance_label": "Derived currency"
}
],
"links": {
"self": "/v1/data-policies/p1a2b3c4-e5f6-7890-abcd-ef1234567890/rules",
"policy": "/v1/data-policies/p1a2b3c4-e5f6-7890-abcd-ef1234567890",
"version": "/v1/data-policies/p1a2b3c4-e5f6-7890-abcd-ef1234567890/versions"
}
}Errors
Error responses