Skip to main content
The Enrichments API publishes the lookup files described in Enrichments. One file reads a billing column and writes one or more business columns. You keep the files in git, upload each one as a draft, then publish the set. Authenticate with a bearer token as described in the API overview. Writes require an organization admin. Enrichments are in beta.

Upload an enrichment

PUT /enrichments/{name} stores one document as a draft. The {name} in the path matches name in the body. Uploading the live document again clears its draft and the response is unchanged. DELETE /enrichments/{name} drafts the removal of a live file. DELETE /enrichments/draft drops every pending draft. The live files stay as they are.
The body is the JSON you keep in git. A GET of the live file is a valid upload body. In this example, keyField selects cos_namespace, key matches payments, and then writes Commerce to owner_team. See billing column lookups for the source-to-target workflow. Enrichments also covers static splits and Terraform publishing. Dynamic allocations support any external metric provider accepted by the query API, including S3 Parquet, CloudWatch, Datadog, and Tsuga. See dynamic allocation examples for configuration. To map a returned metric field to a differently named target, use then.propagates: [{"source": "team", "target": "owner_team"}]. Request team in metric.groupByFields and declare owner_team in targetColumns. See metric column mapping for a complete example and allocation results. For external metrics, add an optional regex to extract part of each source value: [{"source": "service", "regex": "^svc-(.+)-v[0-9]+$"}]. Here, omitted target defaults to service. Patterns use RE2 with at most one capturing group. Unmatched values keep their share with a null target. See regex transformations for configuration, examples, and allocation behavior. Legacy metric.table entries do not accept regex. Get pending enrichment drafts lists what would change and any reason the set would not compile.

Publish enrichments

Publish pending enrichment drafts compiles the live set with every draft applied. When the set compiles, Costory stores it in one step and starts a billing update. A set that does not compile is refused, and the live files stay as they are. After publish, the output columns are available in Explorer, dashboards, alerts, and reports, including history, on the next billing update.

Trace one row

List columns needed to trace a row returns the columns a test row needs. Trace one row through the enrichments runs that row through the live files with the drafts applied, and returns each file’s hit or miss.
For a dynamic allocation, the trace identifies the metric source without computing allocation shares. The shares appear after publish, on the next billing update. The same test is Test enrichments on the Dimensions page.

Endpoints

Last modified on November 23, 2026