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

# Get Document

> Get document metadata by ID with lakehouse extraction data. Requires: document:read permission.



## OpenAPI

````yaml /openapi/merchantops-public.json get /api/lakehouse/documents/{document_id}
openapi: 3.1.0
info:
  description: >-
    Public API for the MerchantOps product catalog, pricing, and publishing
    surface.
  title: MerchantOps API
  version: 1.0.0
servers:
  - description: Production
    url: https://api.merchantops.ai
security: []
paths:
  /api/lakehouse/documents/{document_id}:
    get:
      tags:
        - Product Lakehouse
      summary: Get Document
      description: >-
        Get document metadata by ID with lakehouse extraction data. Requires:
        document:read permission.
      operationId: get_document
      parameters:
        - in: path
          name: document_id
          required: true
          schema:
            title: Document Id
            type: string
        - in: header
          name: authorization
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Authorization
        - in: header
          name: X-Organization-ID
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Organization-Id
        - in: cookie
          name: stytch_session
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Stytch Session
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentMetadataResponse'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
components:
  schemas:
    DocumentMetadataResponse:
      description: Response model for document metadata.
      properties:
        approval_status:
          anyOf:
            - type: string
            - type: 'null'
          default: pending_review
          description: 'Governance status: pending_review, approved, rejected'
          title: Approval Status
        approved_at:
          anyOf:
            - type: string
            - format: date-time
              type: string
            - type: 'null'
          title: Approved At
        approved_by:
          anyOf:
            - type: string
            - type: 'null'
          title: Approved By
        available_columns:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Available Columns
        brand_key:
          anyOf:
            - type: string
            - type: 'null'
          description: Brand key (for pricing documents)
          title: Brand Key
        brand_name:
          anyOf:
            - type: string
            - type: 'null'
          description: Brand display name (e.g. 'New Balance')
          title: Brand Name
        changes_detected:
          anyOf:
            - type: integer
            - type: 'null'
          description: Number of changes detected vs previous policy
          title: Changes Detected
        document_category:
          anyOf:
            - type: string
            - type: 'null'
          default: product
          description: 'Category: ''product'' or ''pricing'''
          title: Document Category
        document_id:
          title: Document Id
          type: string
        extracted_products:
          anyOf:
            - items:
                $ref: '#/components/schemas/ExtractedProductSummary'
              type: array
            - type: 'null'
          description: Products extracted from this document (from the shared lakehouse)
          title: Extracted Products
        extracted_technologies:
          anyOf:
            - items:
                $ref: '#/components/schemas/ExtractedTechnologySummary'
              type: array
            - type: 'null'
          description: >-
            Technologies extracted from this document (from the shared
            lakehouse)
          title: Extracted Technologies
        file_size:
          title: File Size
          type: integer
        file_type:
          title: File Type
          type: string
        file_url:
          title: File Url
          type: string
        filename:
          title: Filename
          type: string
        job_id:
          title: Job Id
          type: string
        organization_id:
          title: Organization Id
          type: string
        organization_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Organization Name
        policy_id:
          anyOf:
            - type: string
            - type: 'null'
          description: MAP policy ID created from this document
          title: Policy Id
        preview_rows:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Preview Rows
        prices_extracted:
          anyOf:
            - type: integer
            - type: 'null'
          description: Number of MAP prices extracted
          title: Prices Extracted
        prices_linked:
          anyOf:
            - type: integer
            - type: 'null'
          description: Number of prices linked to existing products
          title: Prices Linked
        prices_unmatched:
          anyOf:
            - type: integer
            - type: 'null'
          description: Number of prices without product match
          title: Prices Unmatched
        processing_completed_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Processing Completed At
        processing_error:
          anyOf:
            - type: string
            - type: 'null'
          title: Processing Error
        processing_started_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Processing Started At
        products_extracted:
          default: 0
          title: Products Extracted
          type: integer
        rejection_reason:
          anyOf:
            - type: string
            - type: 'null'
          title: Rejection Reason
        rows_skipped:
          anyOf:
            - type: integer
            - type: 'null'
          title: Rows Skipped
        skipped_rows_details:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Skipped Rows Details
        status:
          title: Status
          type: string
        stubs_created:
          anyOf:
            - type: integer
            - type: 'null'
          description: Number of product stubs auto-created
          title: Stubs Created
        technologies_extracted:
          default: 0
          title: Technologies Extracted
          type: integer
        total_rows_processed:
          anyOf:
            - type: integer
            - type: 'null'
          title: Total Rows Processed
        uploaded_at:
          title: Uploaded At
          type: string
        uploaded_by:
          title: Uploaded By
          type: string
        uploaded_by_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Uploaded By Name
      required:
        - document_id
        - organization_id
        - filename
        - file_type
        - file_size
        - file_url
        - status
        - job_id
        - uploaded_at
        - uploaded_by
      title: DocumentMetadataResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    ExtractedProductSummary:
      description: >-
        Summary of a product extracted from a document, sourced from the
        lakehouse.
      properties:
        brand_key:
          default: ''
          description: Brand key
          title: Brand Key
          type: string
        extraction_confidence:
          anyOf:
            - type: number
            - type: 'null'
          description: Extraction quality score
          title: Extraction Confidence
        key:
          description: Product key in the lakehouse
          title: Key
          type: string
        name:
          default: ''
          description: Product name
          title: Name
          type: string
        needs_review:
          default: false
          description: Flagged for human review
          title: Needs Review
          type: boolean
        visibility:
          default: shared
          description: Access control
          title: Visibility
          type: string
      required:
        - key
      title: ExtractedProductSummary
      type: object
    ExtractedTechnologySummary:
      description: >-
        Summary of a technology extracted from a document, sourced from the
        lakehouse.
      properties:
        brand_key:
          default: ''
          description: Brand key
          title: Brand Key
          type: string
        description:
          anyOf:
            - type: string
            - type: 'null'
          description: Technology description
          title: Description
        key:
          description: Technology key in the lakehouse
          title: Key
          type: string
        name:
          default: ''
          description: Technology name
          title: Name
          type: string
      required:
        - key
      title: ExtractedTechnologySummary
      type: object
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object

````