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

# Preview Import Run

> Registra la mappatura da provare (e il `source_ref`, la sorgente nella
mappa degli id con cui contare «già importati») e accoda l'anteprima
(validazione a flusso senza scritture + campione annullato). Una mappatura
non valida → 422 `import.mapping.invalid` con gli errori del validatore, un
`source_ref` non accettato → 422 `import.source_ref.invalid`, e il run non
cambia. Una nuova anteprima butta quella di prima. Serve il permesso di
ogni entità della mappatura (403 `auth.permission_required`).



## OpenAPI

````yaml https://api.vellaro.io/openapi/admin.json post /api/v1/admin/import-runs/{run_id}/preview
openapi: 3.1.0
info:
  title: Vellaro Admin API
  description: >-
    Store management under `/api/v1/admin`, for back ends and integrations.
    Every call takes `Authorization: Bearer <token>`: an admin API token or a
    staff user's token. The permissions of its role decide what it can do,
    always in its own store.
  version: 0.1.0
servers:
  - url: https://api.vellaro.io
    description: Produzione
security: []
tags:
  - name: Orders
    description: >-
      Orders and manual orders, payments, refunds, shipments, invoices, returns,
      customer subscriptions.
  - name: Products
    description: Products, variants, images, prices and discounts, product lookups.
  - name: Categories & catalog setup
    description: >-
      Categories, brands, attributes, options, filters, downloadable files,
      recurring profiles.
  - name: Inventory
    description: Stock of the variants and stock statuses.
  - name: Customers
    description: Customers, customer groups, custom fields.
  - name: Reviews & questions
    description: Moderation of product reviews and questions.
  - name: Promotions & coupons
    description: Coupons and gift vouchers.
  - name: Marketing
    description: Campaigns, newsletter subscribers, affiliates and their commissions.
  - name: Content
    description: >-
      CMS pages, menus, banners, information pages, flipbooks, media library,
      SEO URLs, email templates, translations.
  - name: Settings
    description: >-
      Store settings, email delivery, languages, currencies, physical stores,
      social login providers.
  - name: Shipping
    description: Couriers, shipping rates, weight and length classes.
  - name: Taxes & geo
    description: Tax classes, rates and rules; countries, zones and geo zones.
  - name: Integrations & modules
    description: >-
      Integrations, plugins and modules (Iute, extra warranty, Nextera, Financa
      5, WhatsApp, Firebase), outbound webhooks.
  - name: AI
    description: AI content generation and the settings of the AI shopping assistant.
  - name: Imports
    description: 'CSV imports and the universal import: runs, mappings, previews, undo.'
  - name: Reports & dashboard
    description: Dashboard figures and reports.
  - name: Users & API keys
    description: Staff users and roles, publishable keys, admin API tokens.
  - name: Audit
    description: The store's audit log.
paths:
  /api/v1/admin/import-runs/{run_id}/preview:
    post:
      tags:
        - Imports
      summary: Preview Import Run
      description: >-
        Registra la mappatura da provare (e il `source_ref`, la sorgente nella

        mappa degli id con cui contare «già importati») e accoda l'anteprima

        (validazione a flusso senza scritture + campione annullato). Una
        mappatura

        non valida → 422 `import.mapping.invalid` con gli errori del validatore,
        un

        `source_ref` non accettato → 422 `import.source_ref.invalid`, e il run
        non

        cambia. Una nuova anteprima butta quella di prima. Serve il permesso di

        ogni entità della mappatura (403 `auth.permission_required`).
      operationId: preview_import_run_api_v1_admin_import_runs__run_id__preview_post
      parameters:
        - name: run_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Run Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ImportPreviewIn'
      responses:
        '202':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_ImportRunStatusOut_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    ImportPreviewIn:
      properties:
        mapping:
          additionalProperties: true
          type: object
          title: Mapping
        acknowledgements:
          $ref: '#/components/schemas/PreviewAcknowledgementsIn'
        mapping_source:
          anyOf:
            - type: string
              maxLength: 16
            - type: 'null'
          title: Mapping Source
        source_ref:
          type: string
          maxLength: 64
          title: Source Ref
          default: ''
      type: object
      required:
        - mapping
      title: ImportPreviewIn
      description: La mappatura da provare (`vellaro.import.mapping/1`) e le sue spunte.
    ApiResponse_ImportRunStatusOut_:
      properties:
        data:
          anyOf:
            - $ref: '#/components/schemas/ImportRunStatusOut'
            - type: 'null'
        meta:
          anyOf:
            - $ref: '#/components/schemas/PaginationMeta'
            - type: 'null'
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
        error_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Code
      type: object
      title: ApiResponse[ImportRunStatusOut]
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    PreviewAcknowledgementsIn:
      properties:
        declassified:
          items:
            type: string
          type: array
          maxItems: 500
          title: Declassified
      type: object
      title: PreviewAcknowledgementsIn
      description: >-
        Le declassificazioni «non è un dato personale» (tabella:lettera, es.
        "0:B").
    ImportRunStatusOut:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        status:
          type: string
          title: Status
        origin:
          type: string
          title: Origin
        adapter:
          anyOf:
            - type: string
            - type: 'null'
          title: Adapter
        file_name:
          anyOf:
            - type: string
            - type: 'null'
          title: File Name
        file_size:
          anyOf:
            - type: integer
            - type: 'null'
          title: File Size
        file_sha256:
          anyOf:
            - type: string
            - type: 'null'
          title: File Sha256
        file_purged:
          type: boolean
          title: File Purged
          default: false
        phase:
          anyOf:
            - type: string
            - type: 'null'
          title: Phase
        progress_done:
          type: integer
          title: Progress Done
          default: 0
        progress_total:
          anyOf:
            - type: integer
            - type: 'null'
          title: Progress Total
        counts:
          additionalProperties: true
          type: object
          title: Counts
          default: {}
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
        error_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Code
        cancel_requested:
          type: boolean
          title: Cancel Requested
          default: false
        created_at:
          type: string
          format: date-time
          title: Created At
        confirmed_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Confirmed At
        finished_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Finished At
        undo_until:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Undo Until
        mapping_sha256:
          anyOf:
            - type: string
            - type: 'null'
          title: Mapping Sha256
        undone_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Undone At
      type: object
      required:
        - id
        - status
        - origin
        - created_at
      title: ImportRunStatusOut
      description: |-
        Lo stato di un run e il suo avanzamento: ciò che la procedura guidata
        interroga a intervalli (`refetchInterval`) per la barra per fase.
    PaginationMeta:
      properties:
        page:
          type: integer
          title: Page
        page_size:
          type: integer
          title: Page Size
        total:
          type: integer
          title: Total
        total_pages:
          type: integer
          title: Total Pages
      type: object
      required:
        - page
        - page_size
        - total
        - total_pages
      title: PaginationMeta
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.