Update a derivation rule
Update some fields of a derivation rule. Requires an admin grant on attribute_derivations, and only the
company that owns a rule can change it. Only the fields present in the request change; a changed transformation
runs the same validation as a creation. Set fidelity_note to null to clear it. A rule’s source and target
attributes cannot be changed — create a new rule instead.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Id of the derivation rule.
x >= 1Body
Body of PATCH /derivations/{id}. Only the fields present in the request change. Setting fidelity_note to
null clears it; leaving the key out keeps the current value. The source and target attributes of a rule are
immutable — there is no key for them here, and one sent anyway is ignored.
Name of the derivation rule, unique within the owning company.
256"raw_email_to_sha256"
What the rule does, for whoever is deciding whether to accept derived data.
2048"Hashes the raw email address with SHA-256."
Which companies, besides the one that owns the rule, may have the rule applied to their data. A rule grants a
single thing, so there is one use dimension. Only Narrative can share a rule broadly — with all companies or
with everyone outside an exclusion set.
The transformation that produces the target attribute's value from the source attribute's value. Expressions
reference the source attribute's shape through $source — for a rule from raw_email to sha256_hashed_email,
the value property maps to SHA2(NORMALIZE_EMAIL($source.value), 256).
The shape mirrors mapping expressions, except cached_mapping is not allowed: a cached mapping reads values out
of a stored dataset, so there would be nothing to substitute a $source reference into.
Expressions may use the current date or time (CURRENT_DATE, CURRENT_TIMESTAMP, …): the expression runs when a
query resolves the rule, so a rule like birthdate → age in years is correct as of each query that uses it. Enum
constraints and validation expressions on the target attribute do not restrict the transformation, exactly as
they do not restrict a dataset mapping.
- Option 1
- Option 2
2048Breaks ties when more than one rule reaches the same target attribute — cheapest first. Resolution over multi-step paths sums the cost of every rule on a path and prefers the cheapest total.
x >= 1Response
OK
Unique identifier of the derivation rule.
42
Name of the derivation rule, unique within the owning company.
256"raw_email_to_sha256"
What the rule does, for whoever is deciding whether to accept derived data.
2048"Hashes the raw email address with SHA-256."
Which companies, besides the one that owns the rule, may have the rule applied to their data. A rule grants a
single thing, so there is one use dimension. Only Narrative can share a rule broadly — with all companies or
with everyone outside an exclusion set.
The transformation that produces the target attribute's value from the source attribute's value. Expressions
reference the source attribute's shape through $source — for a rule from raw_email to sha256_hashed_email,
the value property maps to SHA2(NORMALIZE_EMAIL($source.value), 256).
The shape mirrors mapping expressions, except cached_mapping is not allowed: a cached mapping reads values out
of a stored dataset, so there would be nothing to substitute a $source reference into.
Expressions may use the current date or time (CURRENT_DATE, CURRENT_TIMESTAMP, …): the expression runs when a
query resolves the rule, so a rule like birthdate → age in years is correct as of each query that uses it. Enum
constraints and validation expressions on the target attribute do not restrict the transformation, exactly as
they do not restrict a dataset mapping.
- Option 1
- Option 2
Explains the lossy and imprecise flags to whoever is deciding whether to accept derived data. null when
the rule has no note.
2048Breaks ties when more than one rule reaches the same target attribute — cheapest first. Resolution over multi-step paths sums the cost of every rule on a path and prefers the cheapest total.
x >= 1Id of the user who created the rule.
Id of the user who last updated the rule.
Populated on create and update responses; empty on reads.

