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

# Add Lead to Workflow

> Enrol a lead into a workflow via file upload.

<Warning>
  **Legacy endpoint - deprecated.** Unversioned endpoints are scheduled for removal on **July 31, 2026**. Use the [`/v1` version](/docs/api-reference/v1/workflow-leads/add) for new integrations. This endpoint remains available for existing integrations until then.
</Warning>

Enrols leads into a workflow by uploading a CSV or XLSX file. Each row in the file becomes one enrolled lead. The file must include a `phone_number` column; all other columns become dynamic variables available in the agent's prompt at each voice call step.

## File format

```
phone_number,name,city,product
9876543210,Priya Sharma,Mumbai,home_loan
9123456789,Rahul Mehra,Delhi,car_loan
```

Leads begin processing immediately once the workflow is active. Their progress through the nodes depends on the outcomes of each step.

## Destination validation

If the workflow contains Voice Call nodes, uploaded leads are validated before enrollment. A lead's `phone_number` must be valid and must be allowed by at least one active Voice Call phone number in the workflow.

For non-SIP routes, the destination country and prefix must be enabled in **Workspace Settings > Telephony Config**. Validation failures return `400 Bad Request` with grouped row-level errors so you can fix the file and retry.


## OpenAPI

````yaml POST /workflows/{workflowId}/leads
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:
  /workflows/{workflowId}/leads:
    post:
      tags:
        - Workflow 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: WorkflowLeadsController_uploadFile
      parameters:
        - name: workflowId
          required: true
          in: path
          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

````