Create Batch Job
Batch Calling
Create Batch Job
Create a new batch calling job by uploading a CSV file or sending contacts via JSON.
POST
Create Batch Job
Overview
Creates a batch calling job that will automatically dial contacts from your uploaded list. The job can start immediately or be scheduled for a future time. Key Features:- CSV file upload (up to 10,000 contacts)
- Automatic phone number validation (E.164 format)
- Scheduled start with timezone support
- Configurable retry policy
- Two-level concurrency control
Prerequisites
Before creating a batch job:- Register a phone number in Studio → Phone Numbers
- Assign an outbound agent to that phone number
- Ensure sufficient credits in your organization account
- Prepare CSV file with at least a
phonecolumn
Request
CSV Upload (Recommended)
JSON Request (Programmatic)
Request Parameters
Form/Body Fields
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
file | File | ✅ (CSV mode) | — | CSV file with contacts |
fromPhoneNumberId | string | ✅ | — | Phone number ID to call from |
name | string | ✅ | — | Batch job name (max 200 chars) |
description | string | ❌ | null | Optional description (max 1000 chars) |
contacts | array | ✅ (JSON mode) | — | List of contact objects |
concurrentCallLimit | integer | ❌ | 5 | Max concurrent calls (1-50) |
maxAttempts | integer | ❌ | 3 | Max retry attempts (1-10) |
scheduledStartTime | string | ❌ | null | Schedule start (ISO 8601 format) |
timezone | string | ❌ | "UTC" | IANA timezone for scheduled time |
Contact Object
| Field | Type | Required | Description |
|---|---|---|---|
phone | string | ✅ | Phone number in E.164 format |
name | string | ❌ | Contact name |
* | any | ❌ | Additional custom fields (stored as-is) |
CSV Format
Your CSV file must have aphone column. Additional columns are stored as custom fields.
| Column | Required | Description |
|---|---|---|
phone | ✅ | Phone number in E.164 format (+12025550101) |
name | ❌ | Contact name |
| any other | ❌ | Additional columns stored as custom fields |
Phone Number Format: All phone numbers must be in E.164 format (e.g.,
+12025550101, +442071838750). Numbers without + or with formatting characters will be rejected.Response
Response Fields
| Field | Type | Description |
|---|---|---|
success | boolean | Whether the job was created successfully |
batchJobId | string | Unique batch job identifier |
totalContacts | integer | Number of valid contacts |
estimatedDuration | string | Human-readable duration estimate |
estimatedCost | string | Estimated cost in USD |
status | string | Initial status (scheduled or pending) |
scheduledStartTime | string | Scheduled start time (ISO 8601, UTC) |
message | string | Success message |
Status Values
| Status | Description |
|---|---|
pending | Job created, will start immediately |
scheduled | Job created, waiting for scheduled start time |
running | Job is actively processing contacts |
completed | All contacts processed |
failed | Job failed due to errors |
cancelled | Job was cancelled manually |
Examples
Example 1: Immediate Start (CSV)
Example 2: Scheduled Start with Timezone
Example 3: Custom Fields for Personalization
Cost Estimation
The system estimates cost based on:- Number of contacts
- Agent architecture (pipeline vs realtime)
- Average call duration (assumed 2 minutes)
- Pipeline agent: ~0.035/call)
- Realtime agent: ~0.07/call)
Actual costs may vary based on call duration. The estimate assumes 2-minute average calls.
Error Handling
400 Bad Request
| Error Code | Cause |
|---|---|
invalid_csv | CSV file missing or invalid format |
missing_phone_column | CSV missing required phone column |
no_valid_contacts | CSV contains no valid phone numbers |
too_many_contacts | Exceeds 10,000 contact limit |
invalid_timezone | Invalid IANA timezone |
past_scheduled_time | Scheduled time is in the past |
invalid_phone_format | Phone number not in E.164 format |
insufficient_credits | Organization has insufficient credits |
no_outbound_agent | Phone number has no outbound agent assigned |
404 Not Found
500 Internal Server Error
How It Works
Related
- Batch Jobs List — List all batch jobs
- Batch Job Detail — Get detailed job status
- Cancel Batch Job — Cancel a running job
- Batch Calling Guide — Complete guide to batch campaigns
- Telephony — Configure phone numbers
Authorizations
Your TalkifAI API key. Get it from Studio → Settings → API Keys.
Body
CSV file with contacts (must have 'phone' column)
Phone number ID to call from
Batch job name
Optional description
Required range:
1 <= x <= 50Required range:
1 <= x <= 10Schedule start time (ISO 8601)
IANA timezone for scheduled time