> ## 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.

# Batch Enrich Products

> Trigger enrichment for multiple products.

**Authentication Required**: Requires `product:write` permission.

Version selection is controlled by filters:
- If latest_version_only is True: enriches the highest version number
- If filter_by_labels is True: enriches versions matching the specified labels
- If both are True: enriches the latest version that also has matching labels



## OpenAPI

````yaml /openapi/merchantops-public.json post /api/products/batch-enrich
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/products/batch-enrich:
    post:
      tags:
        - Products
      summary: Batch Enrich Products
      description: >-
        Trigger enrichment for multiple products.


        **Authentication Required**: Requires `product:write` permission.


        Version selection is controlled by filters:

        - If latest_version_only is True: enriches the highest version number

        - If filter_by_labels is True: enriches versions matching the specified
        labels

        - If both are True: enriches the latest version that also has matching
        labels
      operationId: batch_enrich_products
      parameters:
        - 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
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BatchEnrichRequest'
        required: true
      responses:
        '202':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchEnrichResponse'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
components:
  schemas:
    BatchEnrichRequest:
      description: Request model for batch enriching multiple products.
      properties:
        enrich_product:
          default: true
          description: Run AI enrichment (description, features, attributes)
          title: Enrich Product
          type: boolean
        enrich_source:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            When set, baseline enrichment on the latest version of this source
            (e.g. 'merchant_input', 'brand_site', 'ai_generated', 'lakehouse',
            'merged'). None = latest version regardless of source.
          title: Enrich Source
        filter_by_labels:
          default: false
          description: Filter versions by specific labels
          title: Filter By Labels
          type: boolean
        label_keys:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          description: Label keys to filter by (when filter_by_labels is True)
          title: Label Keys
        latest_version_only:
          default: true
          description: Enrich only the latest version of each product
          title: Latest Version Only
          type: boolean
        product_keys:
          description: List of product keys to enrich
          items:
            type: string
          title: Product Keys
          type: array
        reinitialize_attributes:
          default: false
          description: Clear and reinitialize attributes from ProductType before enrichment
          title: Reinitialize Attributes
          type: boolean
        scrape_brand_site:
          default: true
          description: Scrape brand website during enrichment
          title: Scrape Brand Site
          type: boolean
        search_lakehouse:
          default: true
          description: Search product lakehouse for existing data
          title: Search Lakehouse
          type: boolean
      required:
        - product_keys
      title: BatchEnrichRequest
      type: object
    BatchEnrichResponse:
      description: Response model for batch enrich request.
      properties:
        failed_products:
          description: Number of products that failed to queue
          title: Failed Products
          type: integer
        job_id:
          description: Job ID for tracking enrichment progress
          title: Job Id
          type: string
        message:
          description: Status message
          title: Message
          type: string
        queued_products:
          description: Number of products successfully queued
          title: Queued Products
          type: integer
        results:
          description: Results for each product
          items:
            $ref: '#/components/schemas/BatchEnrichProductResult'
          title: Results
          type: array
        total_products:
          description: Total products requested
          title: Total Products
          type: integer
      required:
        - job_id
        - total_products
        - queued_products
        - failed_products
        - results
        - message
      title: BatchEnrichResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    BatchEnrichProductResult:
      description: Result for a single product in batch enrich.
      properties:
        error:
          anyOf:
            - type: string
            - type: 'null'
          description: Error message if failed
          title: Error
        product_key:
          description: Product key
          title: Product Key
          type: string
        source:
          description: Product source
          title: Source
          type: string
        success:
          description: Whether the product was queued successfully
          title: Success
          type: boolean
        version:
          description: Version being enriched
          title: Version
          type: integer
      required:
        - product_key
        - version
        - source
        - success
      title: BatchEnrichProductResult
      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

````