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

# Add leads from a CSV file

> Bulk-adds leads to a campaign from a CSV: a multipart 'file' field, or raw CSV bytes as the body. The email column is found by its header (email, email_address or e-mail). Every other column becomes a personalization variable, header slugified, so a "Company Name" column becomes {{company_name}}. No dedupe. New leads start as pending. Returns a count, not ids. Errors are capped at 100; errors_truncated and total_errors appear when there were more. 404 if the campaign isn't in the workspace. Any valid key for the workspace can call this; there's no role check on it.

**Minimum role:** `view` (`x-min-role`). **Destructive:** `false` (`x-destructive`).



## OpenAPI

````yaml /openapi.json post /campaigns/{campaign_id}/leads/csv
openapi: 3.0.3
info:
  title: Sales Sequencer API
  version: '1'
  description: >-
    Every Sales Sequencer action over HTTP. Each call runs as the API key's
    creator, with that user's role, in the key's workspace. Auth: X-API-Key
    header.
servers:
  - url: https://api.salessequencer.com/api/v1
security:
  - key: []
paths:
  /campaigns/{campaign_id}/leads/csv:
    post:
      tags:
        - Leads
      summary: Add leads from a CSV file
      description: >-
        Bulk-adds leads to a campaign from a CSV: a multipart 'file' field, or
        raw CSV bytes as the body. The email column is found by its header
        (email, email_address or e-mail). Every other column becomes a
        personalization variable, header slugified, so a "Company Name" column
        becomes {{company_name}}. No dedupe. New leads start as pending. Returns
        a count, not ids. Errors are capped at 100; errors_truncated and
        total_errors appear when there were more. 404 if the campaign isn't in
        the workspace. Any valid key for the workspace can call this; there's no
        role check on it.


        **Minimum role:** `view` (`x-min-role`). **Destructive:** `false`
        (`x-destructive`).
      operationId: api_add_leads_csv
      parameters:
        - in: path
          name: campaign_id
          required: true
          schema:
            type: integer
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
                  description: The CSV file.
              required:
                - file
          text/csv:
            schema:
              type: string
      responses:
        '201':
          description: >-
            JSON {created, errors:[{row, email, error}], errors_truncated?,
            total_errors?}.
components:
  securitySchemes:
    key:
      in: header
      name: X-API-Key
      type: apiKey

````

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