Skip to main content
POST
/
workflows
/
{workflowId}
/
leads
Add leads to a workflow
curl --request POST \
  --url https://api.dialnexa.com/v1/workflows/{workflowId}/leads \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: multipart/form-data' \
  --form file='@example-file'
{
  "workflow_id": "wf_abc123",
  "leads_enrolled": 50,
  "message": "50 leads enrolled in the workflow."
}
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.

Request

curl "https://api.dialnexa.com/v1/workflows/wfl_m3v7zb9rk2px/leads" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{...}'

Response

{
  "id": "wlead_p3q8zv5bk2mx",
  "workflow_id": "wfl_m3v7zb9rk2px",
  "phone_number": "+919876543210",
  "metadata": { "name": "Priya Sharma", "city": "Mumbai" },
  "current_node_id": "node_t2n6bw4pq9rz",
  "status": "in_progress",
  "enrolled_at": "2024-05-01T09:00:00.000Z"
}

Authorizations

Authorization
string
header
required

Pass your API key as a Bearer token in the Authorization header.

Path Parameters

workflowId
string
required

Body

multipart/form-data
file
file

CSV or XLSX file with leads. Must include a phone_number column. For workflows with Voice Call nodes, destination numbers must pass workspace route validation.

Response

Leads enrolled.

workflow_id
string
Example:

"wf_abc123"

leads_enrolled
integer
Example:

50

message
string
Example:

"50 leads enrolled in the workflow."