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

# Bulk Upload Leads

> Upload a CSV or XLSX file to add multiple leads to a campaign at once.

<Warning>
  **Legacy endpoint - deprecated.** Unversioned endpoints are scheduled for removal on **July 31, 2026**. A public v1 replacement is not currently listed in the v1 reference. This endpoint remains available for existing integrations until then.
</Warning>

Uploads a file to add multiple leads to a campaign in a single request. This is the fastest way to populate a campaign with a large contact list.

## File format

Your file must include a `phone_number` column. All other column headers are treated as **dynamic variable names** and are injected into the agent's prompt per lead:

```
phone_number,name,city,product_interest,last_purchase_value
9876543210,Priya Sharma,Mumbai,home_loan,500000
9123456789,Rahul Mehra,Delhi,car_loan,250000
```

In your agent prompt, reference these as `{{name}}`, `{{city}}`, `{{product_interest}}`, etc. Each call is personalized with that lead's row data.

## File requirements

* **Formats:** CSV, XLSX, or XLS
* **Max size:** 10 MB
* **Required column:** `phone_number`
* **Optional columns:** Any additional column becomes a dynamic variable (max 15 custom columns)

## Destination validation

Uploaded campaign leads are checked against the campaign's outbound phone number before they are queued. For non-SIP routes, each destination must be allowed by **Workspace Settings > Telephony Config**.

If rows fail validation, the API returns `400 Bad Request` with grouped errors and row numbers. Fix invalid phone numbers, unsupported countries, unsupported prefixes, or missing Telephony Config coverage before uploading again.


## OpenAPI

````yaml POST /campaigns-leads/upload-file/{campaignId}
openapi: 3.0.0
info:
  title: DialNexa API
  description: >-
    Public REST API for the DialNexa voice AI platform. Versioned endpoints are
    under /v1; unversioned endpoints are legacy and deprecated.
  version: 1.0.0
servers:
  - url: https://api.dialnexa.com
    description: DialNexa production API
security:
  - bearer: []
tags:
  - name: API Keys
  - name: Agent Functions
  - name: Agents V1
  - name: Agents2
  - name: Batch Calls
  - name: Batch Calls V1
  - name: Call Logs
  - name: Calls
  - name: Calls V1
  - name: Campaign Leads
  - name: Campaigns
  - name: External Webhooks
  - name: Knowledge Base
  - name: Knowledge Base V1
  - name: LLMs
  - name: LLMs V1
  - name: Languages
  - name: Languages V1
  - name: Organization Phone Numbers
  - name: Organization Phone Numbers V1
  - name: Phone Number Pricing
  - name: Phone Number Pricing V1
  - name: Transcribers
  - name: Transcribers V1
  - name: User Webhooks
  - name: User Webhooks V1
  - name: V1
  - name: Voices
  - name: Voices V1
  - name: Webcall
  - name: Workflow Leads
  - name: Workflow Leads V1
  - name: Workflows
  - name: Workflows V1
paths:
  /campaigns-leads/upload-file/{campaignId}:
    post:
      tags:
        - Campaign Leads
      summary: Upload CSV or Excel file with leads data
      description: >-
        **Legacy endpoint - deprecated, scheduled for removal on July 31,
        2026.** Use the `/v1` version for new integrations. 
      operationId: CampaignsLeadsController_uploadFile
      parameters:
        - name: campaignId
          required: true
          in: path
          description: ID of the campaign
          schema:
            type: string
        - name: x-organization-id
          in: header
          description: RSA encrypted organization ID (base64 format)
          required: true
          schema:
            type: string
            example: BASE64_ENCRYPTED_ORG_ID_HERE
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
                  description: CSV or Excel file with leads data
      responses:
        '201':
          description: File processed successfully
        '400':
          description: Bad request
        '500':
          description: Internal server error
      deprecated: true
components:
  securitySchemes:
    bearer:
      scheme: bearer
      bearerFormat: JWT
      type: http

````