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

# Generate Upload Urls

> Generate presigned upload URLs for document files.
Creates document_metadata records and returns presigned URLs for browser upload.
Requires: lakehouse:upload permission



## OpenAPI

````yaml /openapi/merchantops-public.json post /api/lakehouse/upload-url
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/upload-url:
    post:
      tags:
        - Product Lakehouse
      summary: Generate Upload Urls
      description: >-
        Generate presigned upload URLs for document files.

        Creates document_metadata records and returns presigned URLs for browser
        upload.

        Requires: lakehouse:upload permission
      operationId: generate_upload_urls
      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/UploadUrlRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadUrlResponse'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
components:
  schemas:
    UploadUrlRequest:
      description: Request to generate presigned upload URLs.
      properties:
        auto_process:
          default: false
          description: Auto-process documents without HITL review (Phase 8)
          title: Auto Process
          type: boolean
        brand_key:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Brand key for pricing documents (required when
            document_category='pricing')
          title: Brand Key
        brand_name:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Brand display name (e.g. 'New Balance'). Used when creating new
            brands.
          title: Brand Name
        document_category:
          anyOf:
            - type: string
            - type: 'null'
          default: product
          description: 'Category of document: ''product'' or ''pricing'''
          title: Document Category
        files:
          description: 'List of files: [{''filename'': str, ''file_size'': int}]'
          items:
            additionalProperties: true
            type: object
          title: Files
          type: array
      required:
        - files
      title: UploadUrlRequest
      type: object
    UploadUrlResponse:
      description: Response with presigned upload URLs.
      properties:
        job_id:
          title: Job Id
          type: string
        uploads:
          items:
            additionalProperties: true
            type: object
          title: Uploads
          type: array
      required:
        - uploads
        - job_id
      title: UploadUrlResponse
      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

````