> ## 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 a CSV Upload

> Issue a presigned S3 PUT URL so the browser uploads the CSV directly
(bypassing the Next.js server-action body limit). Returns the URL + the
``s3_key`` to pass to preview/import.

Importing contacts is a 3-step flow so a large file is uploaded directly to storage rather than proxied through an API request body, and so mapping columns is a separate, correctable step from committing rows: **upload-init** (this endpoint — get a presigned URL, PUT the file directly to S3) → [preview](/api-reference/contacts/import-preview) (see detected columns + a sample) → [import](/api-reference/contacts/import-start) (confirm the mapping, get an `import_id` back immediately, poll for the result). All three calls share a 15 MB file-size cap and require CRM manage scope.

Issues a presigned S3 `PUT` URL scoped to the caller's organization (object key is `{org_id}/imports/{random}/{sanitized filename}`). The client uploads the raw CSV bytes directly to `upload_url` with a `text/csv` content type, then passes the returned `s3_key` to preview/import. A client that understates the declared `size` isn't blocked here — it's still caught later, when [Preview](/api-reference/contacts/import-preview) reads the actual object back.

### 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

| Field        | Type     | Description                                                                                                        |
| ------------ | -------- | ------------------------------------------------------------------------------------------------------------------ |
| `upload_url` | `string` | Presigned S3 PUT URL, expires in 15 minutes.                                                                       |
| `s3_key`     | `string` | Pass this to [Preview](/api-reference/contacts/import-preview) and [Import](/api-reference/contacts/import-start). |

### Errors

| Status | Cause                          |
| ------ | ------------------------------ |
| `413`  | Declared `size` exceeds 15 MB. |


## OpenAPI

````yaml POST /contacts/import/upload-init
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/upload-init:
    post:
      tags:
        - Contacts
      summary: Contact Import Upload Init
      description: |-
        Issue a presigned S3 PUT URL so the browser uploads the CSV directly
        (bypassing the Next.js server-action body limit). Returns the URL + the
        ``s3_key`` to pass to preview/import.
      operationId: contact_import_upload_init_contacts_import_upload_init_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ContactImportUploadInitBody'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                additionalProperties: true
                type: object
                title: >-
                  Response Contact Import Upload Init Contacts Import Upload
                  Init Post
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    ContactImportUploadInitBody:
      properties:
        filename:
          type: string
          minLength: 1
          title: Filename
          description: Original CSV filename; sanitized into the S3 key.
        size:
          anyOf:
            - type: integer
            - type: 'null'
          title: Size
          description: >-
            Declared file size in bytes, checked against the 15 MB cap before
            issuing the URL.
      type: object
      required:
        - filename
      title: ContactImportUploadInitBody
      description: Request a presigned S3 PUT URL for a contact-import CSV.
    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

````