Create a batch call campaign with multiple phone numbers to call. Batch calls can be executed immediately or scheduled for a future time.
curl -X POST "https://api.zudu.ai/batch-call" \
-H "X-API-KEY: sk_Abc123Def456..." \
-H "X-API-SECRET: s3cr3t_Xyz789..." \
-d '{
"name": "Customer Follow-up Campaign",
"from_number": "+15551234567",
"agent_id": "agent_1234567890",
"tasks": [
{
"to_number": "+15559876543",
"dynamic_variables": {
"customer_name": "John Doe"
},
{
"to_number": "+15555555555",
"dynamic_variables": {
"customer_name": "Jane Smith"
}
],
"trigger_timestamp": 1705320000,
"timezone": "America/New_York"
}'
{
"message": "Batch call created successfully",
"status": "success",
"data": {
"batch_call_id": "batch_abc123...",
"name": "Customer Follow-up Campaign",
"status": "SCHEDULED",
"total_task_count": 2,
"created_at": "2024-01-15T10:30:00Z"
}
Your API key (format: sk_...)
Your API secret (format: s3cr3t_...)
Request Body
Source phone number in E.164 formatExample: +15551234567Must be different from all to_number values in tasks.
Array of call tasks (1-1000 tasks)Each task object:
to_number (string, required): Destination phone number in E.164 format
dynamic_variables (object, optional): Variables to pass to the agent (max 5KB per task)
Descriptive name for the batch call (max 255 characters)
Agent ID to use for all tasks (format: agent_...)If not provided, each task must specify its own agent.
Unix timestamp (seconds) for scheduled executionMust be in the future. If not provided and send_now is false, defaults to immediate execution.
Timezone identifier (e.g., UTC, America/New_York)Used for scheduling calculations.
Initial status: draft, scheduled, or sentDefault: Determined automatically based on send_now and trigger_timestamp
Execute immediately (default: false)If true, batch call executes immediately regardless of trigger_timestamp.
Response Fields
Unique identifier for the batch call
Current status: DRAFT, SCHEDULED, SENT, COMPLETED, FAILED
Number of tasks in the batch call
Error Responses
Bad Request - Validation error{
"message": "Request validation failed",
"status": "error",
"error": "from_number - Phone number must be in E.164 format"
}
Payment Required - Insufficient credits{
"message": "Insufficient credits",
"status": "error",
"error": "Insufficient credits: Required $10.50, Current balance: $5.00"
}
Notes
- Phone numbers must be in E.164 format (e.g.,
+15551234567)
- No duplicate phone numbers allowed in tasks
from_number cannot match any to_number
- Maximum 1000 tasks per batch call
- Dynamic variables are limited to 5KB per task
- Batch calls with
status="draft" are not executed automatically