> ## 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 Definitions Csv

> Upload property definitions from CSV content.

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

Required CSV columns: key, name, type
Optional columns: multi, label_en, isRequired, isFacetable, isSearchable, level, category,
                  mustBeAccurateToAssign, aiCanAddANewValue, aiMatchingGuidance,
                  description, ui_widget, display_group, display_order, visibility,
                  is_entry_field, isVisibleInStorefront, inputHint, attributeConstraint,
                  prompt_name, enrichment_strategies, enrichment_generation_prompt,
                  enrichment_context_fields, enrichment_max_length,
                  enrichment_extraction_hint, enrichment_source_priority,
                  enrichment_overwrite_merchant, enrichment_llm_model,
                  is_common

is_common: When true, the property is added to the base template so it becomes
           a common property inherited by all product types.

Valid type values: enum, text, number, boolean, date, datetime, time, set, money, reference,
                   localized_text, localized_enum, rich_text, url, string_array,
                   ltext (alias for localized_text), lenum (alias for localized_enum)

Performs upsert: creates new records or updates existing ones by key.



## OpenAPI

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


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


        Required CSV columns: key, name, type

        Optional columns: multi, label_en, isRequired, isFacetable,
        isSearchable, level, category,
                          mustBeAccurateToAssign, aiCanAddANewValue, aiMatchingGuidance,
                          description, ui_widget, display_group, display_order, visibility,
                          is_entry_field, isVisibleInStorefront, inputHint, attributeConstraint,
                          prompt_name, enrichment_strategies, enrichment_generation_prompt,
                          enrichment_context_fields, enrichment_max_length,
                          enrichment_extraction_hint, enrichment_source_priority,
                          enrichment_overwrite_merchant, enrichment_llm_model,
                          is_common

        is_common: When true, the property is added to the base template so it
        becomes
                   a common property inherited by all product types.

        Valid type values: enum, text, number, boolean, date, datetime, time,
        set, money, reference,
                           localized_text, localized_enum, rich_text, url, string_array,
                           ltext (alias for localized_text), lenum (alias for localized_enum)

        Performs upsert: creates new records or updates existing ones by key.
      operationId: upload_property_definitions_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

````