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

# Get path diff between two versions

> Compare a single path between two versions of a component. Returns field-level and code-flow detail.



## OpenAPI

````yaml /api-reference/bundled.yaml get /v0/component/path-diff/{id}
openapi: 3.1.0
info:
  title: Gable API
  description: >
    API to interact with the Gable platform

    ## Authorization

    All API requests require an API key to be passed in the `X-API-KEY` header.
    For instructions on finding your API key and api endpoint check out the [API
    Key documentation](../docs/api-keys.md).

    Example: `curl -H "X-API-KEY: <your-api-key>"
    https://api-{organization}.gable.ai/v0/ping`
  contact:
    name: Gable Engineering
    url: https://gable.ai
    email: engineers@gable.ai
  version: 1.28.0
servers:
  - url: https://{hostname}.gable.ai
    description: Gable API
    variables:
      hostname:
        default: demo-api
        description: Customer environment assigned by Gable
security:
  - ApiKeyAuth: []
tags:
  - name: action
  - name: api-keys
  - name: auth
  - name: changelog
  - name: config
  - name: contract
  - name: data-asset
  - name: debug
  - name: s3
  - name: settings
  - name: slack
  - name: sso
  - name: webhook
  - name: notifications
  - name: constraints
  - name: telemetry
  - name: component
  - name: components
  - name: sca
  - name: cross-service-components
  - name: lineage
  - name: events
  - name: measurements
  - name: defect-report
  - name: experimental
paths:
  /v0/component/path-diff/{id}:
    get:
      tags:
        - component
      summary: Get path diff between two versions
      description: >-
        Compare a single path between two versions of a component. Returns
        field-level and code-flow detail.
      operationId: getPathDiff
      parameters:
        - in: path
          name: id
          schema:
            type: string
            format: uuid
          required: true
          description: UUID of the component
        - in: query
          name: base
          schema:
            type: string
          required: true
          description: Base event ID for comparison
        - in: query
          name: compare
          schema:
            type: string
          required: true
          description: Compare event ID for comparison
        - in: query
          name: ingress
          schema:
            type: string
          required: true
          description: Payload name of the ingress boundary
        - in: query
          name: egress
          schema:
            type: string
          required: true
          description: Payload name of the egress boundary
        - in: query
          name: basePathId
          schema:
            type: string
          required: false
          description: >-
            Path ID from the base version. When provided, filters to a specific
            path instead of merging all matching paths.
        - in: query
          name: comparePathId
          schema:
            type: string
          required: false
          description: >-
            Path ID from the compare version. When provided, filters to a
            specific path instead of merging all matching paths.
        - in: query
          name: scanOnly
          schema:
            type: boolean
            default: false
          required: false
          description: >-
            When true, load lineage from raw scan snapshots instead of projected
            results.
      responses:
        '200':
          description: Path diff retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PathDiffResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Path or component not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    PathDiffResponse:
      type: object
      description: >-
        Response for the path diff API, comparing a single path between two
        component versions.
      required:
        - metadata
        - diff
      properties:
        metadata:
          $ref: '#/components/schemas/PathDiffMetadata'
        diff:
          $ref: '#/components/schemas/PathDiffDetail'
    ErrorResponse:
      type: object
      required:
        - message
      properties:
        id:
          type: number
        title:
          type: string
        message:
          type: string
    PathDiffMetadata:
      type: object
      description: Metadata for a path diff comparison.
      required:
        - componentName
        - ingressPayloadName
        - egressPayloadName
        - baseEventId
        - baseDate
        - compareEventId
        - compareDate
      properties:
        componentName:
          type: string
          description: Stable name of the component.
        componentId:
          type: string
          format: uuid
          description: UUID of the component, for back-links.
        ingressPayloadName:
          type: string
          description: Payload name of the ingress boundary.
        egressPayloadName:
          type: string
          description: Payload name of the egress boundary.
        ingressComponent:
          type: string
          description: Name of the upstream component connected to the ingress.
        egressComponent:
          type: string
          description: Name of the downstream component connected to the egress.
        basePathType:
          $ref: '#/components/schemas/PathType'
          description: Source of the selected base path, when one exists.
        baseEventId:
          type: string
          description: Event ID of the base (older) version.
        baseDate:
          type: string
          format: date-time
          description: Timestamp of the base version.
        comparePathType:
          $ref: '#/components/schemas/PathType'
          description: Source of the selected compare path, when one exists.
        compareEventId:
          type: string
          description: Event ID of the compare (newer) version.
        compareDate:
          type: string
          format: date-time
          description: Timestamp of the compare version.
    PathDiffDetail:
      type: object
      description: >-
        Detailed diff of a single path between two versions, including code flow
        steps and field mappings.
      required:
        - codeFlowSteps
        - codeFlowChangeCount
        - fieldMappings
        - fieldMappingChangeCount
      properties:
        codeFlowSteps:
          type: array
          items:
            $ref: '#/components/schemas/PathStep'
          description: Ordered code flow steps for this path.
        codeFlowChangeCount:
          type: integer
          description: Number of code flow steps that changed.
        fieldMappings:
          type: array
          items:
            $ref: '#/components/schemas/FieldDiff'
          description: Field-level diffs for this path.
        fieldMappingChangeCount:
          type: integer
          description: Number of field mappings that changed.
    PathType:
      type: string
      description: >-
        Indicates how a path was created - either from a scan or via user
        override.
      enum:
        - SCAN_OUTPUT
        - USER_OVERRIDE
    PathStep:
      type: object
      description: >-
        A step in a code flow path, with optional file/line location and change
        indicators.
      required:
        - id
        - label
      properties:
        id:
          type: string
          description: Unique identifier for the step.
        label:
          type: string
          description: Display label for the step.
        sublabel:
          type: string
          description: Optional secondary label.
        componentName:
          type: string
          description: Name of the component this step belongs to.
        isIngress:
          type: boolean
          description: Whether this step is an ingress boundary.
        isEgress:
          type: boolean
          description: Whether this step is an egress boundary.
        isChanged:
          type: boolean
          description: Whether this step changed between versions.
        changeBadge:
          type: string
          description: Badge text indicating the type of change (e.g. "added", "moved").
        file:
          type: string
          description: File path in the compare version.
        lineStart:
          type: integer
          description: Start line in the compare version.
        lineEnd:
          type: integer
          description: End line in the compare version.
        previousFile:
          type: string
          description: File path in the base version.
        previousLineStart:
          type: integer
          description: Start line in the base version.
        previousLineEnd:
          type: integer
          description: End line in the base version.
    FieldDiff:
      type: object
      description: Diff of a single field mapping between two versions.
      required:
        - sourceField
        - targetField
        - status
      properties:
        sourceField:
          type: string
          description: Source (ingress) field name.
        targetField:
          type: string
          description: Target (egress) field name.
        type:
          type: string
          description: Field type, if available.
        status:
          $ref: '#/components/schemas/DiffStatus'
        dataFlowSteps:
          type: array
          items:
            $ref: '#/components/schemas/DiffCodeAnchor'
          description: Code anchors in the compare version's data flow for this field.
        previousDataFlowSteps:
          type: array
          items:
            $ref: '#/components/schemas/DiffCodeAnchor'
          description: Code anchors in the base version's data flow for this field.
        upstreamDependencies:
          type: array
          description: >-
            Fields feeding this field, each at its minimum hop distance with the
            path taken to reach it. Used to surface who is affected upstream by
            this change.
          items:
            $ref: '#/components/schemas/FieldDependency'
        downstreamDependencies:
          type: array
          description: >-
            Fields consuming this field, each at its minimum hop distance with
            the path taken to reach it. Used to surface who is affected
            downstream by this change.
          items:
            $ref: '#/components/schemas/FieldDependency'
    DiffStatus:
      type: string
      enum:
        - added
        - removed
        - modified
        - unchanged
      description: >-
        Status of a diff element indicating whether it was added, removed,
        modified, or unchanged between two versions.
    DiffCodeAnchor:
      type: object
      description: >-
        A code anchor with file and line location, used in diff contexts.
        Flattened from StaticAnalysisCodeAnchor.
      required:
        - anchorId
        - file
        - lineStart
      properties:
        anchorId:
          type: string
          description: Unique identifier for the code anchor.
        file:
          type: string
          description: Relative file path in the repo.
        lineStart:
          type: integer
          description: Starting line number.
        lineEnd:
          type: integer
          description: Ending line number.
        columnStart:
          type: integer
          description: Starting column number.
        columnEnd:
          type: integer
          description: Ending column number.
    FieldDependency:
      type: object
      description: >-
        A field reachable from a field-level unit (field pair or field diff)
        through the lineage graph, at its minimum hop distance, with the path
        taken to reach it. Fields are matched by name across service boundaries,
        so results are only as accurate as the underlying name matching.
      properties:
        componentName:
          type: string
          description: The component the reached field belongs to.
        componentType:
          type: string
          enum:
            - CODE
            - DATA_STORE
          description: >-
            Whether the reached field's component is a code component or a data
            store.
        field:
          type: string
          description: The reached field name.
        hops:
          type: integer
          description: >-
            Service boundaries crossed to reach this field. 1 = directly
            connected.
        path:
          type: array
          description: >-
            Ordered, source-first chain from this unit's field to the reached
            field. The first element is this component's field; the last element
            is the reached field itself.
          items:
            type: object
            properties:
              componentName:
                type: string
              componentType:
                type: string
                enum:
                  - CODE
                  - DATA_STORE
              field:
                type: string
            required:
              - componentName
              - componentType
              - field
      required:
        - componentName
        - componentType
        - field
        - hops
        - path
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY

````