Prerequisites
Before creating a campaign, you need:- Agent ID — Create one with
new_agent()or use an existing agent - Audience ID — Create one with
create_audience()(see Audiences) - Phone Number ID — Retrieve available numbers with
get_phone_numbers()
Getting Your Phone Number
get_phone_numbers() returns all outbound phone numbers available for campaigns:
Creating a Campaign
create() creates a campaign linking your agent, audience, and phone number:
Campaign Parameters
| Parameter | Type | Description |
|---|---|---|
name | string | Campaign name (required) |
agent_id | string | Agent to handle calls (required) |
audience_id | string | Contacts to dial (required) |
phone_ids | list | Outbound phone number IDs (required) |
max_retries | int | Retry attempts for failed calls (0–10, default: 3) |
retry_delay | int | Minutes between retries (1–1440, default: 15) |
Starting a Campaign
start() begins dialing contacts in the audience:
Monitoring Progress
get() returns the campaign status, execution history, and metrics:
Cleaning Up
delete() removes the campaign and its execution history:
Running campaigns should be paused before deletion. Use
pause(id) first if needed.SDK Reference
| Method | Description |
|---|---|
get_phone_numbers() | List available outbound numbers (via generic client) |
create(...) | Create a campaign |
start(id) | Begin dialing |
get(id) | Get status and metrics |
pause(id) | Pause a running campaign |
delete(id) | Remove a campaign |
Tips
Why are contacts_called and contacts_connected different?
Why are contacts_called and contacts_connected different?
contacts_called counts dial attempts. contacts_connected counts answered calls. The difference represents voicemail, busy signals, and no-answers.What happens when a call fails?
What happens when a call fails?
Failed calls enter the retry queue based on your
max_retries and retry_delay settings. After all retries are exhausted, the contact is marked as failed.Can I run multiple campaigns simultaneously?
Can I run multiple campaigns simultaneously?
Yes. Each campaign operates independently. Just ensure you have sufficient phone capacity for parallel dialing.
How do I change an agent mid-campaign?
How do I change an agent mid-campaign?
Campaigns cannot change agents after creation. Create a new campaign with the desired agent and audience.

