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

# Upload Property Values Csv

> Upload property values from CSV content.

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

Required CSV columns: property_key (or attribute_key), value_key, value
Optional columns: label_en

Performs upsert: creates new values or updates existing ones matched by value_key.



## OpenAPI

````yaml /openapi/merchantops-public.json post /api/property-definitions/upload-values-csv
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/property-definitions/upload-values-csv:
    post:
      tags:
        - Property Definitions
      summary: Upload Property Values Csv
      description: >-
        Upload property values from CSV content.


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


        Required CSV columns: property_key (or attribute_key), value_key, value

        Optional columns: label_en


        Performs upsert: creates new values or updates existing ones matched by
        value_key.
      operationId: upload_property_values_csv
      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/merchantops_server__api__routers__property_definitions__CsvUploadRequest
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/merchantops_server__api__routers__property_definitions__CsvBatchResponse
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
components:
  schemas:
    merchantops_server__api__routers__property_definitions__CsvUploadRequest:
      description: Request model for CSV upload.
      properties:
        csv_content:
          description: CSV content as string
          title: Csv Content
          type: string
      required:
        - csv_content
      title: PropertyDefinitionsCsvUploadRequest
      type: object
    merchantops_server__api__routers__property_definitions__CsvBatchResponse:
      description: Response model for batch CSV upload operations.
      properties:
        cleaned:
          default: 0
          description: Number of existing null values cleaned up from the database
          title: Cleaned
          type: integer
        created:
          description: Number of new records created
          title: Created
          type: integer
        errors:
          description: List of errors
          items:
            $ref: '#/components/schemas/CsvBatchError'
          title: Errors
          type: array
        failed:
          description: Number of rows that failed
          title: Failed
          type: integer
        skipped:
          default: 0
          description: Number of rows skipped due to null/empty values
          title: Skipped
          type: integer
        total:
          description: Total rows processed
          title: Total
          type: integer
        updated:
          description: Number of existing records updated
          title: Updated
          type: integer
      required:
        - total
        - created
        - updated
        - failed
      title: PropertyDefinitionsCsvBatchResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    CsvBatchError:
      description: Error details for a single row in batch processing.
      properties:
        error:
          description: Error message
          title: Error
          type: string
        key:
          anyOf:
            - type: string
            - type: 'null'
          description: Key of the item that failed
          title: Key
        row:
          description: Row number (1-indexed, excluding header)
          title: Row
          type: integer
      required:
        - row
        - error
      title: CsvBatchError
      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

````