Skip to main content
Batch dialing is a two-step flow: create a draft, then explicitly start it. A batch accepts 1–1,000 unique canonical recipients.

Prerequisites

  • A server-side bt_live_ key with batches:write and batches:read.
  • An eligible agent_id and either unique contact_ids or unique inline recipients from the same organization.
  • Separate nonsecret idempotency keys for creating and starting the batch.
  • If scheduling, an RFC 3339 start_at and/or one contiguous daily calling_window supported by the contract.
Save JavaScript samples as .mjs or run them in an ESM project. Their top-level await requires ESM, and Node 18 or later provides the built-in fetch they use.

Create the draft

The canonical example uses two existing contacts. Creation returns status: draft and does not begin dialing.
Starting this batch can place real PSTN calls to every recipient. Verify the complete recipient set, agent, schedule, calling window, and timing before starting it.

Expected draft

The API returns 201 Created with aggregate counts. Save the batch id.
Review the returned identity and counts before continuing. Do not skip the explicit start transition.

Start the batch

Replace bat_demo_001 with the returned id. Starting immediately returns status: queued; configured scheduled eligibility can return status: scheduled.
The start operation returns 202 Accepted. Capacity can keep eligible recipients queued; monitor aggregate counts instead of treating queueing as an error.

Inspect and control

Use the same batch id and preserve the required scope pair. Pause, resume, and cancel accept an optional Idempotency-Key. Use one when an action might be retried.

Common errors