> ## Documentation Index
> Fetch the complete documentation index at: https://docs.costory.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Trace one row through the enrichments

> Runs one billed row through the live set with the drafts applied. `published` is the same trace on the live set alone and is present when drafts exist. Org admin only.



## OpenAPI

````yaml POST /enrichments/explain
openapi: 3.0.0
info:
  title: Costory
  version: '1.0'
  description: API Documentation
servers:
  - url: ''
    description: Production server
security: []
paths:
  /enrichments/explain:
    post:
      tags:
        - Enrichments
      summary: Trace one row through the enrichments
      description: >-
        Runs one billed row through the live set with the drafts applied.
        `published` is the same trace on the live set alone and is present when
        drafts exist. Org admin only.
      operationId: explainEnrichmentRow
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                row:
                  type: object
                  additionalProperties:
                    type: string
                  description: Column name to value for the billed row to trace.
              required:
                - row
            example:
              row:
                cos_namespace: team-a
                cos_cluster_name: d01
      responses:
        '200':
          description: Row trace
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EnrichmentExplainResponse'
        '400':
          description: The body is not a row, or the set cannot be traced
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EnrichmentErrors'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Unauthorized'
        '403':
          description: Org admin required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DimensionsAdminRequired'
      security:
        - bearerAuth: []
components:
  schemas:
    EnrichmentExplainResponse:
      type: object
      properties:
        steps:
          type: array
          items:
            type: object
            properties:
              mapping:
                type: string
              keyField:
                type: string
              key:
                type: string
                nullable: true
              hit:
                type: boolean
              reason:
                type: string
                enum:
                  - no key
                  - no entry
                  - condition false
                  - unsupported condition
                description: Why a mapping did not hit.
              allocations:
                type: array
                items:
                  type: object
                  properties:
                    weight:
                      type: number
                    values:
                      type: object
                      additionalProperties:
                        type: string
                        nullable: true
                  required:
                    - weight
                    - values
              metric:
                type: object
                properties:
                  table:
                    type: string
                  dateColumn:
                    type: string
                  metricColumn:
                    type: string
                  propagates:
                    type: array
                    items:
                      type: string
                required:
                  - table
                  - dateColumn
                  - metricColumn
                  - propagates
                description: Present on a metric hit. Allocations are empty.
            required:
              - mapping
              - keyField
              - key
              - hit
              - allocations
        rows:
          type: array
          items:
            type: object
            properties:
              weight:
                type: number
              values:
                type: object
                additionalProperties:
                  type: string
                  nullable: true
            required:
              - weight
              - values
          description: The rows the billed row becomes. Weights sum to 1.
        warnings:
          type: array
          items:
            type: string
        published:
          type: object
          properties:
            steps:
              type: array
              items:
                type: object
                properties:
                  mapping:
                    type: string
                  keyField:
                    type: string
                  key:
                    type: string
                    nullable: true
                  hit:
                    type: boolean
                  reason:
                    type: string
                    enum:
                      - no key
                      - no entry
                      - condition false
                      - unsupported condition
                    description: Why a mapping did not hit.
                  allocations:
                    type: array
                    items:
                      type: object
                      properties:
                        weight:
                          type: number
                        values:
                          type: object
                          additionalProperties:
                            type: string
                            nullable: true
                      required:
                        - weight
                        - values
                  metric:
                    type: object
                    properties:
                      table:
                        type: string
                      dateColumn:
                        type: string
                      metricColumn:
                        type: string
                      propagates:
                        type: array
                        items:
                          type: string
                    required:
                      - table
                      - dateColumn
                      - metricColumn
                      - propagates
                    description: Present on a metric hit. Allocations are empty.
                required:
                  - mapping
                  - keyField
                  - key
                  - hit
                  - allocations
            rows:
              type: array
              items:
                type: object
                properties:
                  weight:
                    type: number
                  values:
                    type: object
                    additionalProperties:
                      type: string
                      nullable: true
                required:
                  - weight
                  - values
              description: The rows the billed row becomes. Weights sum to 1.
            warnings:
              type: array
              items:
                type: string
          required:
            - steps
            - rows
            - warnings
          description: Trace of the published set alone. Present when drafts exist.
      required:
        - steps
        - rows
        - warnings
    EnrichmentErrors:
      type: object
      properties:
        errors:
          type: array
          items:
            type: string
      required:
        - errors
    Unauthorized:
      type: object
      properties:
        error:
          type: string
          description: Unauthorized error message
      required:
        - error
    DimensionsAdminRequired:
      type: object
      properties:
        error:
          type: string
          enum:
            - ADMIN_REQUIRED
      required:
        - error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT or Clerk ak_* API key
      description: >-
        Send `Authorization: Bearer <credential>` using either a Clerk session
        JWT or a Clerk API key (`ak_*`). API keys may identify a user (`user_*`)
        or organization (`org_*`) principal and are generated in the Clerk
        Dashboard under API keys.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.