Running Campaigns
This guide walks through the complete campaign lifecycle-from setup to cleanup.
Prerequisites
Before creating a campaign, you need:
- Agent ID - Create one with
client.atoms.agents.create_agent()or use an existing agent - Audience ID - Create one with the
Audiencehelper (see Audiences) - Phone Number ID - Retrieve available numbers with
client.atoms.phone_numbers.list()
Getting Your Phone Number
client.atoms.phone_numbers.list() returns all outbound phone numbers available for campaigns:
Each phone includes provider details. The SDK returns typed objects, so _id in the raw response is phones.data[0].id and attributes.phoneNumber is phones.data[0].attributes.phone_number:
Creating a Campaign
create() creates a campaign linking your agent, audience, and phone number:
The response includes all campaign details:
Campaign Parameters
Scheduling a campaign (REST)
POST /campaign also accepts an optional scheduledAt (ISO-8601, must be in
the future) to defer the first dial-out. If provided, the campaign is created
in scheduled status and begins automatically at the specified time.
Full request/response shape: see POST /campaign in the API reference.
Starting a Campaign
start() begins dialing contacts in the audience:
The response confirms the campaign is processing:
Monitoring Progress
get() returns the campaign status, execution history, and metrics:
Full status response:
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
Tips
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?
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?
Yes. Each campaign operates independently. Just ensure you have sufficient phone capacity for parallel dialing.
How do I change an agent mid-campaign?
Campaigns cannot change agents after creation. Create a new campaign with the desired agent and audience.

