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

# Import Records File

> Mass-add product keys from an uploaded CSV/XLSX (or the paste path,
which the UI wraps into a one-key-per-line CSV). Foreground by design:
validation is a single org-scoped distinct (~3 Mongo ops total).



## OpenAPI

````yaml /openapi/merchantops-public.json post /api/catalog/batches/{key}/records/import-file
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/catalog/batches/{key}/records/import-file:
    post:
      tags:
        - Catalog
        - Catalog
        - Catalog Batch Records
      summary: Import Records File
      description: |-
        Mass-add product keys from an uploaded CSV/XLSX (or the paste path,
        which the UI wraps into a one-key-per-line CSV). Foreground by design:
        validation is a single org-scoped distinct (~3 Mongo ops total).
      operationId: import_records_file
      parameters:
        - in: path
          name: key
          required: true
          schema:
            title: Key
            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
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: >-
                #/components/schemas/Body_import_records_file_api_catalog_batches__key__records_import_file_post
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImportKeysFileResponse'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
components:
  schemas:
    Body_import_records_file_api_catalog_batches__key__records_import_file_post:
      properties:
        file:
          contentMediaType: application/octet-stream
          title: File
          type: string
      required:
        - file
      title: Keyrecords_import_file_post
      type: object
    ImportKeysFileResponse:
      properties:
        added:
          title: Added
          type: integer
        already_in_batch:
          title: Already In Batch
          type: integer
        not_found:
          items:
            type: string
          title: Not Found
          type: array
        total_parsed:
          title: Total Parsed
          type: integer
      required:
        - added
        - already_in_batch
        - total_parsed
      title: ImportKeysFileResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      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

````