Campaigns
Learn about creating batch campaigns to call multiple leads efficiently
Introduction
A campaign is a batch of calls scheduled together. Campaigns allow you to efficiently process multiple leads (up to 10,000) with shared scheduling and configuration settings.
What is a Campaign?
When you create a campaign:
- Multiple leads are processed in a single request
- All calls share the same scheduling and configuration settings
- Each call is executed independently
- Webhooks are triggered for each call completion
- You receive a
campaign_idto track the entire campaign
When to Use Campaigns
Use campaigns when:
- You need to call multiple leads (2-10,000)
- Leads share similar scheduling requirements
- You want to batch process a list of contacts
- You need campaign-level tracking and metrics
- You're running marketing or sales outreach at scale
When to Use Individual Calls Instead
If you need to call a single lead with unique settings, use individual calls instead.
Campaign Features
Batch Processing
Campaigns can process between 1 and 10,000 leads in a single request. For very large campaigns, Kejue processes calls in the background and returns a job_id.
The job_id is returned for large campaigns but cannot be used to track processing status. Use the campaign_id to check campaign status and metrics.
Campaign ID
Each campaign receives a unique campaign_id that you can use to:
- Track campaign status
- Get campaign metrics
- Cancel a running campaign
{
"success": true,
"campaign_id": "camp_abc123xyz789",
"total_submitted": 100,
"valid_leads": 95,
"created_leads": 95,
"scheduled_calls": 95
}Validation Errors
When creating a campaign, some leads may fail validation. The response includes detailed error information:
{
"success": true,
"total_submitted": 100,
"valid_leads": 95,
"invalid_leads": 3,
"duplicate_leads": 2,
"validation_errors": [
{
"index": 5,
"phone_number": "+1234567890",
"error": "Invalid phone number format"
}
]
}Duplicate Detection
Kejue automatically detects duplicate phone numbers within a campaign. Duplicates are reported but don't prevent the campaign from processing valid leads.
Related Guides
To configure your campaigns, you'll need to understand these concepts:
- Assistants - Configure which AI assistant handles your calls
- Call Scheduling - Control when campaigns start and when calls are made
- Day Selection - Choose which days calls can be made
- Phone Assignment - Control which phone numbers are used
- Callbacks - Set up automatic retry logic
- Call Context - Provide campaign-level context to assistants
- Leads - Configure lead properties and information
API Reference
- Create Campaign - Full API documentation for creating campaigns
- Get Campaign - Check campaign status and metrics
- Cancel Campaign - Stop a running campaign
Quick Start
Here's an example of creating a campaign:
{
"leads": [
{
"phone_number": "+15551234567",
"first_name": "John",
"last_name": "Doe",
"email": "john@example.com",
"country": "US",
"language": "english"
},
{
"phone_number": "+442071234567",
"first_name": "Jane",
"last_name": "Smith",
"email": "jane@example.com",
"country": "GB",
"language": "english"
}
],
"schedule": {
"name": "Q4 Sales Campaign",
"start_at_iso": "2024-01-15T09:00:00Z",
"call_start_hour": 9,
"call_end_hour": 18,
"day_selection_mode": "weekend_off",
"phone_assignment_mode": "local",
"context": "This is a Q4 sales campaign focusing on new customers"
},
"assistant_group_id": "grp_abc123",
"call_source": "api_campaign"
}Next Steps
- Learn about creating individual calls for single leads
- Set up webhooks to receive call completion notifications
- Explore assistant configuration options
Last updated on

