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

# CSV Import Confirm

> Imports leads from the previously previewed CSV content using the
provided column mapping.
Requires `leads:import` permission.




## OpenAPI

````yaml POST /api/leads/upload/confirm
openapi: 3.1.0
info:
  title: Naturalead Leads API
  version: 1.0.0
  description: |
    API for managing leads in the Naturalead platform. All endpoints require
    API key authentication and are scoped to the caller's account.
servers:
  - url: '{baseUrl}'
    description: API server
    variables:
      baseUrl:
        default: http://localhost:3001
security:
  - ApiKeyAuth: []
  - BearerAuth: []
tags:
  - name: Leads
    description: Lead CRUD, search, filtering, and bulk operations
paths:
  /api/leads/upload/confirm:
    post:
      tags:
        - Leads
      summary: Confirm CSV upload
      description: |
        Imports leads from the previously previewed CSV content using the
        provided column mapping.
        Requires `leads:import` permission.
      operationId: csvConfirm
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                content:
                  type: string
                  description: Raw CSV content
                mapping:
                  type: object
                  additionalProperties:
                    type: string
                  description: Mapping of CSV column names to lead field names
                tags:
                  type: array
                  items:
                    type: string
              required:
                - content
                - mapping
      responses:
        '200':
          description: Import results
          content:
            application/json:
              schema:
                type: object
                properties:
                  total:
                    type: integer
                  imported:
                    type: integer
                  duplicatesSkipped:
                    type: integer
                  errors:
                    type: integer
                  importBatchId:
                    type: string
                required:
                  - total
                  - imported
                  - duplicatesSkipped
                  - errors
                  - importBatchId
        '400':
          $ref: '#/components/responses/BadRequest'
components:
  responses:
    BadRequest:
      description: Bad request
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
            required:
              - error
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: API key prefixed with `nl_live_` or `nl_test_`
    BearerAuth:
      type: http
      scheme: bearer
      description: Bearer token using an API key (format nl_live_* or nl_test_*)

````