> ## Documentation Index
> Fetch the complete documentation index at: https://apidocs.specurate.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Replace Mappings



## OpenAPI

````yaml /openapi.json put /v1/workspaces/{workspaceId}/assistant/imports/{importId}/mappings
openapi: 3.1.0
info:
  title: Specurate API
  description: ''
  version: 1.0.0
  contact: {}
servers:
  - url: https://app.specurate.com/api
    description: API Server
security: []
tags: []
paths:
  /v1/workspaces/{workspaceId}/assistant/imports/{importId}/mappings:
    put:
      tags:
        - Data Imports
      summary: Replace Mappings
      operationId: DataImportsController_replaceMappings_v1
      parameters:
        - name: workspaceId
          required: true
          in: path
          schema:
            type: string
            pattern: ^[1-9]\d*$
        - name: importId
          required: true
          in: path
          schema:
            type: string
            pattern: ^[1-9]\d*$
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReplaceDataImportMappingsBodyDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataImportResponseDto'
components:
  schemas:
    ReplaceDataImportMappingsBodyDto:
      type: object
      properties:
        projectId:
          type: string
          pattern: ^[1-9]\d*$
        expectedVersion:
          type: integer
          exclusiveMinimum: 0
          maximum: 9007199254740991
        columnMappings:
          type: object
          properties:
            mappings:
              maxItems: 256
              type: array
              items:
                type: object
                properties:
                  sourceColumnKey:
                    type: string
                    minLength: 1
                    maxLength: 2000
                  target:
                    oneOf:
                      - type: object
                        properties:
                          kind:
                            type: string
                            const: system
                          field:
                            type: string
                            enum:
                              - name
                              - quantity
                              - category
                              - manufacturer
                              - supplier
                              - identifier
                              - parentIdentifier
                              - image
                              - area
                        required:
                          - kind
                          - field
                        additionalProperties: false
                      - type: object
                        properties:
                          kind:
                            type: string
                            const: company_field
                          role:
                            type: string
                            enum:
                              - manufacturer
                              - supplier
                          field:
                            type: string
                            enum:
                              - website
                              - notes
                              - external_reference
                              - office_address
                              - office_phone
                              - contact_email
                              - contact_name
                              - contact_first_name
                              - contact_last_name
                              - contact_phone
                              - contact_position
                        required:
                          - kind
                          - role
                          - field
                        additionalProperties: false
                      - type: object
                        properties:
                          kind:
                            type: string
                            const: item_column
                          itemColumnId:
                            type: string
                            pattern: ^[1-9]\d*$
                        required:
                          - kind
                          - itemColumnId
                        additionalProperties: false
                      - type: object
                        properties:
                          kind:
                            type: string
                            const: ignore
                        required:
                          - kind
                        additionalProperties: false
                  excluded:
                    type: boolean
                  manuallyMapped:
                    type: boolean
                  confidence:
                    type: string
                    enum:
                      - high
                      - medium
                      - low
                  rationale:
                    anyOf:
                      - type: string
                        maxLength: 500
                      - type: 'null'
                required:
                  - sourceColumnKey
                  - target
                  - confidence
                  - rationale
                additionalProperties: false
          required:
            - mappings
          additionalProperties: false
        valueMappings:
          type: object
          properties:
            allItemsCategoryId:
              type: string
              pattern: ^[1-9]\d*$
            mappings:
              maxItems: 10000
              type: array
              items:
                oneOf:
                  - type: object
                    properties:
                      kind:
                        type: string
                        const: category
                      sourceValue:
                        type: string
                        maxLength: 2000
                      categoryId:
                        anyOf:
                          - type: string
                            pattern: ^[1-9]\d*$
                          - type: 'null'
                      confidence:
                        type: string
                        enum:
                          - high
                          - medium
                          - low
                      rationale:
                        anyOf:
                          - type: string
                            maxLength: 500
                          - type: 'null'
                      manuallyMapped:
                        type: boolean
                    required:
                      - kind
                      - sourceValue
                      - categoryId
                      - confidence
                      - rationale
                    additionalProperties: false
                  - type: object
                    properties:
                      kind:
                        type: string
                        const: area
                      sourceValue:
                        type: string
                        maxLength: 2000
                      resolution:
                        oneOf:
                          - type: object
                            properties:
                              kind:
                                type: string
                                const: existing_area
                              projectAreaId:
                                type: string
                                pattern: ^[1-9]\d*$
                            required:
                              - kind
                              - projectAreaId
                            additionalProperties: false
                          - type: object
                            properties:
                              kind:
                                type: string
                                const: new_area
                              path:
                                minItems: 1
                                maxItems: 4
                                type: array
                                items:
                                  type: string
                                  minLength: 1
                                  maxLength: 2000
                              creation:
                                type: object
                                properties:
                                  parentAreaId:
                                    anyOf:
                                      - type: string
                                        pattern: ^[1-9]\d*$
                                      - type: 'null'
                                  code:
                                    anyOf:
                                      - type: string
                                        minLength: 1
                                        maxLength: 6
                                        pattern: ^[A-Z0-9-]+$
                                      - type: 'null'
                                required:
                                  - parentAreaId
                                  - code
                                additionalProperties: false
                            required:
                              - kind
                              - path
                            additionalProperties: false
                          - type: object
                            properties:
                              kind:
                                type: string
                                const: empty
                            required:
                              - kind
                            additionalProperties: false
                          - type: object
                            properties:
                              kind:
                                type: string
                                const: unresolved
                            required:
                              - kind
                            additionalProperties: false
                      confidence:
                        type: string
                        enum:
                          - high
                          - medium
                          - low
                      rationale:
                        anyOf:
                          - type: string
                            maxLength: 500
                          - type: 'null'
                      manuallyMapped:
                        type: boolean
                    required:
                      - kind
                      - sourceValue
                      - resolution
                      - confidence
                      - rationale
                    additionalProperties: false
                  - type: object
                    properties:
                      kind:
                        type: string
                        enum:
                          - manufacturer
                          - supplier
                      sourceValue:
                        type: string
                        maxLength: 2000
                      resolution:
                        oneOf:
                          - type: object
                            properties:
                              kind:
                                type: string
                                const: existing_company
                              companyId:
                                type: string
                                pattern: ^[1-9]\d*$
                            required:
                              - kind
                              - companyId
                            additionalProperties: false
                          - type: object
                            properties:
                              kind:
                                type: string
                                const: name
                              name:
                                type: string
                                minLength: 1
                                maxLength: 2000
                            required:
                              - kind
                              - name
                            additionalProperties: false
                          - type: object
                            properties:
                              kind:
                                type: string
                                const: empty
                            required:
                              - kind
                            additionalProperties: false
                          - type: object
                            properties:
                              kind:
                                type: string
                                const: unresolved
                            required:
                              - kind
                            additionalProperties: false
                      confidence:
                        type: string
                        enum:
                          - high
                          - medium
                          - low
                      rationale:
                        anyOf:
                          - type: string
                            maxLength: 500
                          - type: 'null'
                      manuallyMapped:
                        type: boolean
                    required:
                      - kind
                      - sourceValue
                      - resolution
                      - confidence
                      - rationale
                    additionalProperties: false
            companyUpdates:
              maxItems: 22
              type: array
              items:
                type: object
                properties:
                  role:
                    type: string
                    enum:
                      - manufacturer
                      - supplier
                  field:
                    type: string
                    enum:
                      - website
                      - notes
                      - external_reference
                      - office_address
                      - office_phone
                      - contact_email
                      - contact_name
                      - contact_first_name
                      - contact_last_name
                      - contact_phone
                      - contact_position
                required:
                  - role
                  - field
                additionalProperties: false
          required:
            - mappings
            - companyUpdates
          additionalProperties: false
      required:
        - projectId
        - expectedVersion
        - columnMappings
        - valueMappings
      additionalProperties: false
    DataImportResponseDto:
      type: object
      properties:
        conversation:
          type: object
          properties:
            id:
              type: string
            title:
              type: string
              nullable: true
            currentRun:
              type: object
              nullable: true
              additionalProperties: false
              example: null
        takeoff:
          type: object
          nullable: true
          additionalProperties: true
        sourceSelection:
          type: object
          nullable: true
          additionalProperties: true
        columnMappings:
          type: object
          nullable: true
          additionalProperties: true
        valueMappings:
          type: object
          nullable: true
          additionalProperties: true
        reviewDraft:
          type: object
          nullable: true
          additionalProperties: true
        publishResult:
          type: object
          nullable: true
          additionalProperties: true
        id:
          type: string
        target:
          type: object
          properties:
            kind:
              type: string
            projectId:
              type: string
          required:
            - kind
            - projectId
        status:
          enum:
            - awaiting_upload
            - queued
            - analyzing
            - review
            - publishing
            - published
            - failed
            - cancelled
          type: string
        kind:
          enum:
            - project_items
            - takeoff
          type: string
        version:
          type: number
        analysisRevision:
          type: number
        document:
          type: object
          properties:
            id:
              type: string
            displayName:
              type: string
            mimeType:
              type: string
            sizeBytes:
              type: number
            status:
              enum:
                - pending
                - confirmed
                - failed
              type: string
            confirmedAt:
              type: string
              nullable: true
            extractionDispatchedAt:
              type: string
              nullable: true
            safeErrorCode:
              type: string
              nullable: true
          required:
            - id
            - displayName
            - mimeType
            - sizeBytes
            - status
            - confirmedAt
            - extractionDispatchedAt
            - safeErrorCode
        sourceSnapshot:
          type: object
          nullable: true
        progress:
          type: object
          properties:
            phase:
              nullable: true
              enum:
                - analysis
                - publication
              type: string
            safeErrorCode:
              type: string
              nullable: true
          required:
            - phase
            - safeErrorCode
        counts:
          type: object
          properties:
            blockingIssues:
              type: number
            warningIssues:
              type: number
          required:
            - blockingIssues
            - warningIssues
        issueSummary:
          type: object
          properties:
            blocking:
              type: number
            warning:
              type: number
          required:
            - blocking
            - warning
        publishable:
          type: boolean
        createdAt:
          type: string
        updatedAt:
          type: string
      required:
        - conversation
        - takeoff
        - sourceSelection
        - columnMappings
        - valueMappings
        - reviewDraft
        - publishResult
        - id
        - target
        - status
        - kind
        - version
        - analysisRevision
        - document
        - sourceSnapshot
        - progress
        - counts
        - issueSummary
        - publishable
        - createdAt
        - updatedAt

````