Skip to main content

Request

organization_id
integer
required
Your organization ID
api_key
string
required
Your organization API key
campaign_name
string
required
Name for the campaign
agent_id
integer
required
ID of the agent to use for the campaign
call_from
string
required
Source phone number in E.164 format
contacts
array
required
Array of contact objects with phone numbers and optional custom data
start_time
string
Scheduled start time for the campaign (ISO 8601 format). If not provided, starts immediately.
calls_per_hour
integer
default:"60"
Maximum number of calls to make per hour
retry_attempts
integer
default:"2"
Number of retry attempts for failed calls
retry_delay
integer
default:"3600"
Delay between retry attempts in seconds

Contact Object

phone_number
string
required
Destination phone number in E.164 format
custom_first_line
string
Custom first line for this specific contact
custom_instruction
string
Custom instructions for this specific contact
custom_identifiers
string
Custom identifier for mapping back to your system

Examples

curl -X POST 'https://www.tabbly.io/dashboard/agents/endpoints/create-campaign' \
-H 'Content-Type: application/json' \
-d '{
    "organization_id": 244,
    "api_key": "your_api_key",
    "campaign_name": "January Follow-up Campaign",
    "agent_id": 33,
    "call_from": "+14156801215",
    "contacts": [
        {
            "phone_number": "+917359056097",
            "custom_first_line": "Hello, I am calling from Company XYZ",
            "custom_instruction": "John'\''s Order ID is 12345",
            "custom_identifiers": "user_12345"
        },
        {
            "phone_number": "+917359056098",
            "custom_first_line": "Hello, I am calling from Company XYZ",
            "custom_instruction": "Jane'\''s Order ID is 12346",
            "custom_identifiers": "user_12346"
        }
    ],
    "calls_per_hour": 60,
    "retry_attempts": 2
}'

Response

success
boolean
Indicates if the campaign was successfully created
campaign_id
integer
ID of the newly created campaign
campaign_name
string
Name of the created campaign
status
string
Status of the campaign (scheduled, running, paused, completed)
total_contacts
integer
Total number of contacts in the campaign

Success Response (200 OK)

{
    "success": true,
    "campaign_id": 12,
    "campaign_name": "January Follow-up Campaign",
    "status": "scheduled",
    "total_contacts": 2
}

Error Responses

400
object
Missing required fields or invalid parameters
402
object
Insufficient wallet balance
404
object
Organization/Agent not found or invalid call_from number
500
object
Server error