> ## 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 component diff between two versions

> Compare two versions of a component's lineage. Returns a high-level summary of all path-level changes.



## OpenAPI

````yaml /api-reference/bundled.yaml get /v0/component/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/diff/{id}:
    get:
      tags:
        - component
      summary: Get component diff between two versions
      description: >-
        Compare two versions of a component's lineage. Returns a high-level
        summary of all path-level changes.
      operationId: getComponentDiff
      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: scanOnly
          schema:
            type: boolean
            default: false
          required: false
          description: >-
            When true, load lineage from raw scan snapshots and return summary
            counts only (no field details).
      responses:
        '200':
          description: Component diff retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ComponentDiffResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    ComponentDiffResponse:
      type: object
      description: >-
        Response for the component diff API, comparing two versions of a
        component's lineage.
      required:
        - metadata
        - pathChanges
      properties:
        metadata:
          $ref: '#/components/schemas/ComponentDiffMetadata'
        pathChanges:
          type: array
          items:
            $ref: '#/components/schemas/PathDiff'
          description: List of path-level diffs between the two versions.
    ErrorResponse:
      type: object
      required:
        - message
      properties:
        id:
          type: number
        title:
          type: string
        message:
          type: string
    ComponentDiffMetadata:
      type: object
      description: Metadata for a component diff comparison.
      required:
        - componentName
        - componentId
        - baseEventId
        - baseDate
        - compareEventId
        - compareDate
        - totalAdded
        - totalRemoved
        - totalModified
      properties:
        componentName:
          type: string
          description: Stable name of the component.
        componentId:
          type: string
          format: uuid
          description: UUID of the component (retained for links and disambiguation).
        baseEventId:
          type: string
          description: Event ID of the base (older) version.
        baseDate:
          type: string
          format: date-time
          description: Timestamp of the base version.
        baseLabel:
          type: string
          description: Label for the base version (e.g. job trigger type).
        baseCommitSha:
          type: string
          description: Commit SHA of the base version, if available.
        compareEventId:
          type: string
          description: Event ID of the compare (newer) version.
        compareDate:
          type: string
          format: date-time
          description: Timestamp of the compare version.
        compareLabel:
          type: string
          description: Label for the compare version.
        compareCommitSha:
          type: string
          description: Commit SHA of the compare version, if available.
        totalAdded:
          type: integer
          description: Total number of paths added.
        totalRemoved:
          type: integer
          description: Total number of paths removed.
        totalModified:
          type: integer
          description: Total number of paths modified.
        totalUnchanged:
          type: integer
          description: Total number of unchanged paths.
    PathDiff:
      type: object
      description: >-
        Diff summary for a single path (ingress→egress) between two component
        versions.
      required:
        - pathId
        - ingressName
        - egressName
        - status
        - fieldsAdded
        - fieldsRemoved
        - fieldsChanged
        - totalFields
        - codeStepsAdded
        - codeStepsRemoved
        - codeStepsModified
        - fields
      properties:
        pathId:
          type: string
          description: Unique identifier for the path.
        basePathId:
          type: string
          description: Path ID from the base version. Absent when the path is newly added.
        comparePathId:
          type: string
          description: Path ID from the compare version. Absent when the path was removed.
        basePathType:
          $ref: '#/components/schemas/PathType'
          description: Source of the base path. Absent when the path is newly added.
        comparePathType:
          $ref: '#/components/schemas/PathType'
          description: Source of the compare path. Absent when the path was removed.
        ingressName:
          type: string
          description: Name of the ingress payload.
        ingressFunction:
          type: string
          description: Function name of the ingress, if available.
        egressName:
          type: string
          description: Name of the egress payload.
        egressFunction:
          type: string
          description: Function name of the egress, if available.
        status:
          $ref: '#/components/schemas/DiffStatus'
        fieldsAdded:
          type: integer
          description: Number of fields added in this path.
        fieldsRemoved:
          type: integer
          description: Number of fields removed from this path.
        fieldsChanged:
          type: integer
          description: Number of fields modified in this path.
        totalFields:
          type: integer
          description: Total number of fields in this path.
        codeStepsAdded:
          type: integer
          description: Number of code steps added.
        codeStepsRemoved:
          type: integer
          description: Number of code steps removed.
        codeStepsModified:
          type: integer
          description: Number of code steps with file/line changes.
        fields:
          type: array
          items:
            $ref: '#/components/schemas/FieldDiff'
          description: Detailed field-level diffs for this path.
    PathType:
      type: string
      description: >-
        Indicates how a path was created - either from a scan or via user
        override.
      enum:
        - SCAN_OUTPUT
        - USER_OVERRIDE
    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.
    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'
    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

````