Campaigns
Add Recipients
Add numbers to a campaign, as JSON or by uploading a CSV or Excel file.
Recipients can be added as JSON or by uploading a file. Both routes validate identically — a number accepted one way is accepted the other.
You can add to a campaign at any point before it finishes, including while it is running.
Add as JSON
https://api.tryvox.io/v1/voice/accounts/{auth_id}/campaigns/{id}/recipients| Field | Type | Required | Description |
|---|---|---|---|
recipients | array | yes | Up to 50,000 per request. |
recipients[].to | string | yes | Destination number. E.164 preferred; local formats are normalised. |
recipients[].client_ref | string | no | Your own identifier, echoed back on the post-call webhook. |
recipients[].variables | object | no | String values merged into the agent prompt as {{key}}. |
curl -X POST https://api.tryvox.io/v1/voice/accounts/$TRYVOX_AUTH_ID/campaigns/$CAMPAIGN_ID/recipients \
-u $TRYVOX_AUTH_ID:$TRYVOX_AUTH_TOKEN \
-H 'Content-Type: application/json' \
-d '{
"recipients": [
{ "to": "9876543210", "client_ref": "CUST-1001", "variables": { "name": "Asha", "amount": "4,500" } },
{ "to": "+919123456789", "client_ref": "CUST-1002", "variables": { "name": "Rahul", "amount": "1,200" } }
]
}'Upload a file
https://api.tryvox.io/v1/voice/accounts/{auth_id}/campaigns/{id}/recipients/uploadSend the file as multipart form data under the field file. CSV and Excel (.xlsx) are both accepted; for a workbook, only the first sheet is read.
curl -X POST https://api.tryvox.io/v1/voice/accounts/$TRYVOX_AUTH_ID/campaigns/$CAMPAIGN_ID/recipients/upload \
-u $TRYVOX_AUTH_ID:$TRYVOX_AUTH_TOKEN \
-F 'file=@recipients.csv'Maximum 16 MB and 50,000 rows per upload.
File format
The first row is the header. One column must be the number to dial; any of these names is accepted:
phone phone_number number mobile msisdn to contactOne column may be your own reference: client_ref, reference, ref, id or external_id.
Every other column becomes a variable, named after its header. A column headed name is available to the agent as {{name}}.
phone,client_ref,name,due_date,amount
9876543210,CUST-1001,Asha Nair,2026-12-01,"4,500"
+919123456789,CUST-1002,Rahul Mehta,2026-12-05,"1,200"
09988776655,CUST-1003,Priya Sharma,2026-12-09,"8,750"Those three number formats all resolve to the same thing — a bare ten-digit number, an international one, and one with a leading zero. You do not need to normalise before uploading.
Quote any value containing a comma, as the amounts above do. An unquoted comma shifts every later column by one.
Response
Both routes return the same shape:
{
"data": {
"accepted": 3,
"duplicates": 1,
"columns": ["name", "due_date", "amount"],
"problems": [
{ "row": 5, "value": "not-a-number", "reason": "no phone number" },
{ "row": 9, "value": "9.19877E+11", "reason": "looks like a number Excel converted to scientific notation; format the column as text" }
]
}
}| Field | Description |
|---|---|
accepted | Recipients stored. |
duplicates | Numbers already in this campaign, or repeated within the request, skipped. |
columns | Variable names found, so you know what the prompt can use. |
problems | Rejected rows, with the row number as it appears in your file. |
A file with no dialable numbers is rejected with 400 INVALID_FILE, and the body still carries an intake object with the problem rows, so you can fix the sheet rather than guess:
{
"error": { "code": "INVALID_FILE", "message": "no dialable numbers found; 12 rows had problems" },
"intake": { "accepted": 0, "duplicates": 0, "columns": [], "problems": [ … ] }
}A sheet with no recognisable phone column is refused the same way, with no phone column found; expected one of phone, phone_number, number, mobile, msisdn or to.
Things worth knowing
Numbers are validated strictly. Anything that cannot be turned into a valid E.164 number is rejected and reported rather than passed through. An unparseable number in a campaign is a call that would be attempted, billed and fail.
Duplicates are collapsed. One number appears at most once in a campaign, so re-uploading the same sheet or retrying a request will not dial anyone twice.
Excel's scientific notation is caught. Long numbers that Excel has turned into 9.19877E+11 are rejected by name rather than parsed into something nobody typed. Format the column as text before saving.
A byte-order mark is fine. Files saved from Excel as UTF-8 CSV begin with one; it is handled.