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

# Anteprima di un’importazione CSV o Excel

> Passo 1. Invia il file e indica a Emailx cosa contiene ogni colonna. Ricevi un’anteprima riga per riga e un’impronta. Non viene salvato ancora nulla.

Permesso: `contacts:read`

[Leggi le regole di recupero](https://docs.emailx.ai/it/api-reference/idempotency.md) prima di riprovare. Conserva chiave e corpo per la stessa operazione logica.


## OpenAPI

````yaml openapi/emailx.it.json POST /workspaces/{workspace_id}/contacts/imports/preview
openapi: 3.0.3
info:
  title: Emailx API
  version: 1.0.0-beta
  description: >-
    Integrazioni Emailx per clienti e agenzie. L’accesso beta è fornito da un
    operatore. La beta v1 supporta importazioni People CSV/XLSX limitate,
    impostazioni salvate dei template email, generazione email selezionata con
    conferma esplicita dei crediti AI, approvazione del messaggio esatto, avvio
    email verificato per l’invio pianificato e risposte inbox confermate
    esplicitamente e legate al contesto salvato, se le capacità dell’host lo
    consentono. Il contesto inbox è limitato e può essere incompleto o non
    aggiornato; non viene recuperato dal provider. Importazioni, attivazione
    verificata e ripresa verificata delle campagne LinkedIn manuali in pausa
    sono flussi separati e gated. Bozze di risposta, knowledge, team, preventivi
    di infrastruttura con checkout ospitato e amministrazione di agenzia hanno
    scope dedicati. Webhook firmati comunicano l’esito delle operazioni
    durevoli. Non supporta invii immediati o addebiti diretti su carta.
servers:
  - url: https://app.emailx.ai/api/v1
    description: Applicazione Emailx · accesso da abilitare
security: []
tags:
  - name: Getting started
  - name: Workspaces
  - name: Contacts
  - name: Templates
  - name: Campaigns
  - name: Inbox
  - name: Senders
  - name: Team
  - name: Analytics
  - name: Imports
  - name: Operations
  - name: Knowledge
  - name: Infrastructure
  - name: Agency
paths:
  /workspaces/{workspace_id}/contacts/imports/preview:
    post:
      tags:
        - Importare contatti
      summary: Anteprima di un’importazione CSV o Excel
      description: >-
        Passo 1. Invia il file e indica a Emailx cosa contiene ogni colonna.
        Ricevi un’anteprima riga per riga e un’impronta. Non viene salvato
        ancora nulla.


        Permesso: `contacts:read`
      operationId: preview_api_people_import
      parameters:
        - name: workspace_id
          in: path
          required: true
          schema:
            type: integer
            minimum: 1
          description: ID account del workspace Emailx, non ID del collegamento agenzia.
        - name: Idempotency-Key
          in: header
          required: true
          schema:
            type: string
            minLength: 1
            maxLength: 128
            pattern: ^[A-Za-z0-9_.:/-]+$
          description: >-
            Univoco per modifica logica. Stesso percorso e corpo: replay fino a
            24 ore, se conservato.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PeopleImportPreviewRequest'
            example:
              file_base64: RW1haWwKYWRhQGV4YW1wbGUudGVzdAo=
              filename: contacts.csv
              mapping:
                email: Email
              channel: email
              offset: 0
              limit: 25
      responses:
        '200':
          description: Successo
          headers:
            X-Request-Id:
              schema:
                type: string
            Emailx-Api-Version:
              schema:
                type: string
            X-RateLimit-Limit:
              schema:
                type: string
            X-RateLimit-Remaining:
              schema:
                type: string
            X-RateLimit-Reset:
              schema:
                type: string
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/PeopleImportPreview'
                required:
                  - data
              example:
                data:
                  workspace_id: 1
                  channel: email
                  mapping:
                    name: example
                    last_name: example
                    email: example
                    company: example
                    title: example
                    location: example
                    website: example
                    linkedin: example
                  rows: []
                  totals:
                    total_rows: 1
                    eligible_rows: 1
                    existing_rows: 1
                    created_rows: 1
                    blocked_rows: 1
                  fingerprint: >-
                    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
                  total_rows: 1
                  offset: 1
                  limit: 1
                  has_more: false
                  identity_matching:
                    email: example
                    linkedin: example
                    candidate_limit: 1
        '400':
          description: Errore della richiesta
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Chiave API non valida, scaduta o revocata
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Scope o permesso di modifica insufficiente
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Risorsa mancante o inaccessibile
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: Conflitto, richiesta concorrente o esito originale incerto
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          headers:
            Retry-After:
              schema:
                type: string
              description: Secondi da attendere, se presenti.
        '413':
          description: Errore della richiesta
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '415':
          description: Errore della richiesta
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: Limite richieste raggiunto; rispettare Retry-After
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          headers:
            Retry-After:
              schema:
                type: string
              description: Secondi da attendere, se presenti.
        '500':
          description: Errore della richiesta
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: >-
            API disabilitata, storage richieste non disponibile o funzione non
            abilitata
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          headers:
            Retry-After:
              schema:
                type: string
              description: Secondi da attendere, se presenti.
      security:
        - BearerAuth: []
      x-codeSamples:
        - lang: cURL
          source: >-
            curl -X POST
            "https://app.emailx.ai/api/v1/workspaces/123/contacts/imports/preview"
            \
              -H "Authorization: Bearer $EMAILX_API_KEY" \
              -H "Content-Type: application/json" \
              -H "Idempotency-Key: example-operation-001" \
              --data '{"file_base64":"RW1haWwKYWRhQGV4YW1wbGUudGVzdAo=","filename":"contacts.csv","mapping":{"email":"Email"},"channel":"email","offset":0,"limit":25}'
        - lang: Python
          source: |-
            import os, requests

            response = requests.post(
                "https://app.emailx.ai/api/v1/workspaces/123/contacts/imports/preview",
                headers={"Authorization": "Bearer " + os.environ["EMAILX_API_KEY"], "Idempotency-Key": "example-operation-001"},
                json={'file_base64': 'RW1haWwKYWRhQGV4YW1wbGUudGVzdAo=', 'filename': 'contacts.csv', 'mapping': {'email': 'Email'}, 'channel': 'email', 'offset': 0, 'limit': 25},
                timeout=30,
            )
            response.raise_for_status()
            print(response.json())
        - lang: JavaScript
          source: >-
            const response = await
            fetch("https://app.emailx.ai/api/v1/workspaces/123/contacts/imports/preview",
            {
              method: "POST",
              headers: { Authorization: `Bearer ${process.env.EMAILX_API_KEY}`, "Content-Type": "application/json", "Idempotency-Key": "example-operation-001" },
              body: JSON.stringify({"file_base64": "RW1haWwKYWRhQGV4YW1wbGUudGVzdAo=", "filename": "contacts.csv", "mapping": {"email": "Email"}, "channel": "email", "offset": 0, "limit": 25}),
              signal: AbortSignal.timeout(30000),
            });

            if (!response.ok) throw new Error(`Emailx: ${response.status}`);

            console.log(await response.json());
components:
  schemas:
    PeopleImportPreviewRequest:
      type: object
      properties:
        file_base64:
          type: string
          minLength: 1
          maxLength: 87384
          description: >-
            Standard base64 encoding of a CSV or XLSX file, up to 64 KiB
            decoded.
        filename:
          type: string
          minLength: 1
          maxLength: 255
        mapping:
          type: object
          properties:
            name:
              type: string
              minLength: 1
              maxLength: 255
            last_name:
              type: string
              minLength: 1
              maxLength: 255
            email:
              type: string
              minLength: 1
              maxLength: 255
            company:
              type: string
              minLength: 1
              maxLength: 255
            title:
              type: string
              minLength: 1
              maxLength: 255
            location:
              type: string
              minLength: 1
              maxLength: 255
            website:
              type: string
              minLength: 1
              maxLength: 255
            linkedin:
              type: string
              minLength: 1
              maxLength: 255
          minProperties: 1
          additionalProperties: false
        channel:
          type: string
          enum:
            - email
            - linkedin
        offset:
          type: integer
          minimum: 0
          default: 0
        limit:
          type: integer
          minimum: 1
          maximum: 100
          default: 25
      required:
        - file_base64
        - filename
        - mapping
        - channel
      additionalProperties: false
      description: >-
        Read-only preview. The complete command JSON is limited to 256 KiB;
        decoded files are limited to 64 KiB and 1,000 data rows.
    PeopleImportPreview:
      type: object
      properties:
        workspace_id:
          type: integer
          minimum: 1
        channel:
          type: string
          enum:
            - email
            - linkedin
        mapping:
          type: object
          properties:
            name:
              type: string
              minLength: 1
              maxLength: 255
            last_name:
              type: string
              minLength: 1
              maxLength: 255
            email:
              type: string
              minLength: 1
              maxLength: 255
            company:
              type: string
              minLength: 1
              maxLength: 255
            title:
              type: string
              minLength: 1
              maxLength: 255
            location:
              type: string
              minLength: 1
              maxLength: 255
            website:
              type: string
              minLength: 1
              maxLength: 255
            linkedin:
              type: string
              minLength: 1
              maxLength: 255
          minProperties: 1
          additionalProperties: false
        rows:
          type: array
          items:
            type: object
            properties:
              row_number:
                type: integer
                minimum: 1
              fields:
                type: object
                additionalProperties:
                  type: string
                  nullable: true
              row_code:
                type: string
                enum:
                  - existing_contact_id
                  - created_eligible
                  - blocked
              existing_contact_id:
                type: integer
                minimum: 1
                nullable: true
              blockers:
                type: array
                items:
                  type: string
            required:
              - row_number
              - fields
              - row_code
              - existing_contact_id
              - blockers
          maxItems: 100
        totals:
          type: object
          properties:
            total_rows:
              type: integer
              minimum: 0
            eligible_rows:
              type: integer
              minimum: 0
            existing_rows:
              type: integer
              minimum: 0
            created_rows:
              type: integer
              minimum: 0
            blocked_rows:
              type: integer
              minimum: 0
          required:
            - total_rows
            - eligible_rows
            - existing_rows
            - created_rows
            - blocked_rows
        fingerprint:
          type: string
          pattern: ^[a-f0-9]{64}$
        total_rows:
          type: integer
          minimum: 0
          maximum: 1000
        offset:
          type: integer
          minimum: 0
        limit:
          type: integer
          minimum: 1
          maximum: 100
        has_more:
          type: boolean
        identity_matching:
          type: object
          properties:
            email:
              type: string
            linkedin:
              type: string
            candidate_limit:
              type: integer
              minimum: 1
          required:
            - email
            - linkedin
            - candidate_limit
      required:
        - workspace_id
        - channel
        - mapping
        - rows
        - totals
        - fingerprint
        - total_rows
        - offset
        - limit
        - has_more
        - identity_matching
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
            request_id:
              type: string
            details:
              type: object
              additionalProperties: true
          required:
            - code
            - message
            - request_id
      required:
        - error
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        Chiave ex_test_ o ex_live_ emessa da un operatore Emailx. Non usare
        credenziali provider o cookie di sessione.

````

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