Ana içeriğe geç

Batch Calls — client.batch_call

Run outbound calling campaigns over a list of contacts.

create(**params) → BatchCallStatusResponse

POST /v1/batch-calls

ParamTypeRequiredDefaultDescription
agent_idstryesAgent that makes the calls.
from_numberstryesRegistered caller ID.
contactslist[dict]yesEach: {"phone_number": "+1…", "dynamic_variables": {...}}.
namestrnoNoneCampaign name.
max_concurrent_callsintno5Simultaneous calls (1–100).
retry_attemptsintno1Retries per failed contact (0–5).

Returns BatchCallStatusResponse: batch_call_id, name, status, total, pending, active, completed, failed, processed, counts, progress_percent, started_at, completed_at.

batch = client.batch_call.create(
agent_id="ag_abc123",
from_number="+14155550123",
name="March outreach",
contacts=[
{"phone_number": "+14155551001", "dynamic_variables": {"name": "Sam"}},
{"phone_number": "+14155551002"},
],
max_concurrent_calls=10,
)
client.batch_call.start(batch.batch_call_id)

Read & lifecycle

  • retrieve(batch_call_id) → BatchCallStatusResponse — live status/counts.
  • list(skip=0, limit=20, status=None) → list[BatchCallResponse]
  • list_active() → list[BatchCallStatusResponse]
  • list_items(batch_call_id, status=None, limit=100) → list[BatchCallItemResponse] — per-contact results.
  • delete(batch_call_id) → None (only when not running).
  • start(id) / pause(id) / resume(id) / cancel(id)BatchCallStatusResponse.