Skip to main content

Batch calls

The batchCalls resource runs bulk outbound phone campaigns. Upload a recipients file, then launch or schedule the campaign.

Upload recipients

upload reads a .csv, .xls, or .xlsx file (max 5 MB), uploads it, and waits for parsing, returning the parsed batch.

const batch = await client.batchCalls.upload({ filePath: "./leads.csv" });

Options: filePath (required), batchId (replace the file on an existing batch), waitForParse (default true), poll interval / timeout, an onParsing hook.

Create a campaign

const campaign = await client.batchCalls.create({
batchName: "Q3 outreach",
phoneNumberId: "pn_1",
routingRuleId: "rr_1",
batchId, // from upload
timing: "scheduled",
scheduledDate: "2026-07-01",
scheduledTime: "09:30",
});

Required: batchName, phoneNumberId, routingRuleId. Scheduling: timing (immediate or scheduled), timezone, scheduledDate / scheduledTime, allowedFrom / allowedUntil, daysOfWeek. Also retry, webhook, saveAsDraft.

Manage a campaign

await client.batchCalls.list({ status: "running" });
await client.batchCalls.get(batchId);
await client.batchCalls.update(batchId, { scheduledTime: "10:00" });
await client.batchCalls.cancel(batchId, "graceful"); // or "immediate"
await client.batchCalls.delete(batchId);
await client.batchCalls.stats(batchId);

Records

await client.batchCalls.listRecords(batchId, { status: "not connected" });
await client.batchCalls.updateRecord(batchId, recordId, { phoneNumber: "+14155550123" });
await client.batchCalls.deleteRecords(batchId, [recordId]);

const csv = await client.batchCalls.exportRecords(batchId); // CSV text

Got a Question? Ask us on discord