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

# Start an Import

> Start an async import of the stashed CSV with a confirmed mapping.

Inserts a ``contact_imports`` job row and starts ContactImportWorkflow,
returning ``202 { import_id }`` immediately. The frontend polls
``GET /contacts/imports/{import_id}`` for progress + results.

Third step of the [CSV import flow](/api-reference/contacts/import-upload-init). Inserts a `contact_imports` job row (`status: "pending"`) and starts `ContactImportWorkflow` on Temporal, then returns immediately — the actual parsing/inserting happens asynchronously. If the workflow fails to start, the job row is patched to `status: "failed"` synchronously and the request itself still returns `502`.

Rows are matched against `mapping` (raw CSV header → canonical field, same keys as `fields[].key` from [Preview](/api-reference/contacts/import-preview); `""` means "don't import this column"). A row needs at least one identity field after mapping to be imported; a row is skipped if its email already exists in the org, or repeats an email already used earlier in the same file. Type-checking is lenient — an invalid cell (e.g. a malformed phone number) is dropped and the row still imports as a warning, not a hard failure.

Beyond the 15 MB file-size cap shared by all three steps, there's a second limit that's easy to miss: at most **5,000 rows** are imported per file. A CSV can sit well under 15 MB and still blow past it. Rows after the 5,000th aren't a hard failure — each is skipped individually with the reason `exceeds the 5,000-row limit`, counted in `skipped` on [Get import status](/api-reference/contacts/import-status) and annotated per-row in that job's result CSV, while the job itself still finishes as `completed`. Split larger files into separate import jobs.

### Auth

Requires a CRM manage [scope](/authentication#scopes) and an active organization on the token. Any `*:manage` scope qualifies — in practice `contacts:manage`, `deals:manage`, `companies:manage`, or `activities:manage`.

### Response

`202 Accepted`:

| Field       | Type     | Description                                                                                        |
| ----------- | -------- | -------------------------------------------------------------------------------------------------- |
| `import_id` | `string` | Also the Temporal workflow ID. Pass to [Get import status](/api-reference/contacts/import-status). |

### Errors

| Status | Cause                                                              |
| ------ | ------------------------------------------------------------------ |
| `404`  | `s3_key` no longer exists in S3 — re-upload.                       |
| `422`  | `mapping` names a target field that isn't a known canonical field. |
| `502`  | Failed to start the Temporal workflow.                             |


## OpenAPI

````yaml POST /contacts/import
openapi: 3.1.0
info:
  title: anycrm-api
  version: 0.0.1
servers: []
security: []
tags:
  - name: Customer Intelligence
    description: >-
      Company research and ICP-fit scoring — create a research run, track its
      progress, and read back scored companies as leads.
  - name: Outreach
    description: >-
      The cold-email management console — domains, mailboxes, and campaigns — as
      a thin control plane over the SalesForge stack.
  - name: AnyCard
    description: >-
      Authenticated CRUD for AnyCard, the org's digital business-card /
      lead-capture product.
  - name: AnyCard Events
    description: >-
      Event-attribution analytics for AnyCard — which captured leads converted,
      broken down by source, owner, and deal.
  - name: AnyCard Share Links
    description: >-
      Unauthenticated endpoints reached by anyone who scans a QR code or opens a
      shared AnyCard link.
  - name: AI
    description: >-
      A streaming (SSE) AI chat endpoint with account-commit actions it can take
      on the caller's behalf.
  - name: Analytics Assistant
    description: >-
      The natural-language analytics assistant — a guarded text-to-SQL loop
      (SSE) that answers ad-hoc questions over the org's CRM data as a
      least-privilege, read-only database role.
  - name: Account Readiness
    description: >-
      Account Readiness Profiles — AI-scored signals on whether an account is
      ready for outreach or expansion, computed via a Temporal workflow.
  - name: Integrations
    description: >-
      Pipedream Connect — issuing connect tokens and managing the org's
      connected third-party accounts.
  - name: Feedback
    description: >-
      User-submitted platform feedback (bug reports, feature requests) — global,
      not scoped to one organization.
  - name: Public Media
    description: >-
      Unauthenticated image reads for publicly-embeddable assets (card photos,
      inline email images) — allowlisted by key shape; everything else in the
      storage bucket stays private.
  - name: Service Health
    description: Service liveness.
paths:
  /contacts/import:
    post:
      tags:
        - Contacts
      summary: Import Contacts
      description: |-
        Start an async import of the stashed CSV with a confirmed mapping.

        Inserts a ``contact_imports`` job row and starts ContactImportWorkflow,
        returning ``202 { import_id }`` immediately. The frontend polls
        ``GET /contacts/imports/{import_id}`` for progress + results.
      operationId: import_contacts_route_contacts_import_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ContactImportBody'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    ContactImportBody:
      properties:
        s3_key:
          type: string
          minLength: 1
          title: S3 Key
          description: The s3_key returned by upload-init.
        mapping:
          additionalProperties:
            type: string
          type: object
          title: Mapping
          description: >-
            Raw CSV header → canonical contact field ('' means skip that
            column).
      type: object
      required:
        - s3_key
      title: ContactImportBody
      description: |-
        Start an async import of a stashed CSV with a confirmed column mapping.

        ``mapping`` is raw-CSV-header → canonical field ("" = don't import).
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````