Skip to main content
POST
/
v1
/
campaigns
curl -X POST https://api.example.com/v1/campaigns \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "campaign_id": "1763072374x123456789012345678",
    "campaign_name": "November Outreach",
    "organization_id": "1763070568417x...",
    "user_id": "1763072368418x...",
    "sms_agent_id": "1763072369786x...",
    "teli_sms_number": "+13135559999",
    "contacts": [
      {"phone_number": "+15551234567", "first_name": "John"}
    ]
  }'
{
  "success": true,
  "campaign_id": "json test",
  "status": "processing",
  "message": "Campaign upload started successfully",
  "agent": {
    "agent_id": "1763490400021x448481236873124087",
    "agent_name": "SMS TO Voice"
  },
  "details": {
    "total_contacts": 1,
    "invalid_leads_count": 0,
    "estimated_processing_seconds": 0.1,
    "has_drips": false,
    "voice_transfer_enabled": true
  },
  "powered_by": "Teli"
}
Create and launch an SMS campaign to send messages to your contact list.

Authorizations

X-API-Key
string
required
Authentication header containing your API key.

Body

campaign_id
string
required
Unique campaign identifier. Format: {timestamp}x{random_18_digits}Example: "1763072374x123456789012345678"
campaign_name
string
required
Campaign display name.Example: "November 2024 Outreach"
organization_id
string
required
Organization unique_id.
user_id
string
required
User unique_id (campaign creator).
sms_agent_id
string
required
SMS agent unique_id for conversations.
teli_sms_number
string
required
SMS phone number to send from (E.164 format or without + prefix). Use organization’s teli_sms_number.Example: "13135727768" or "+13135559999"
contacts
array
required
Array of contact objects. Supports all lead fields from contact list.
[
  {
    "phone_number": "+15551234567",
    "first_name": "John",
    "last_name": "Doe",
    "email": "[email protected]",
    "unique_id": "1762896414634x733468691531460383"
  }
]
enable_sms_to_voice
boolean
default:"false"
Enable SMS-to-voice transfer. When true, AI can escalate conversation to phone call.
voice_agent_id
string
Teli Voice agent ID for voice transfer (required if enable_sms_to_voice is true).Example: "agent_86f826bf8f59bacd5c10ae948a"
outbound_number
string
Outbound phone number for voice calls (required if enable_sms_to_voice is true).Example: "+12489071796"
dry_run
boolean
If true, simulates campaign without sending real SMS.Default: false
enable_number_validation
boolean
Validate phone numbers before sending.Default: false
mms_media_url
string
Media URL for MMS campaigns (optional).
followup_interval
integer
Interval between follow-ups in seconds.Default: 0
extraction_fields
array
Custom data fields to extract from conversations.Default: []
custom_follow_up
string
Custom follow-up message template.
curl -X POST https://api.example.com/v1/campaigns \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "campaign_id": "1763072374x123456789012345678",
    "campaign_name": "November Outreach",
    "organization_id": "1763070568417x...",
    "user_id": "1763072368418x...",
    "sms_agent_id": "1763072369786x...",
    "teli_sms_number": "+13135559999",
    "contacts": [
      {"phone_number": "+15551234567", "first_name": "John"}
    ]
  }'
{
  "success": true,
  "campaign_id": "json test",
  "status": "processing",
  "message": "Campaign upload started successfully",
  "agent": {
    "agent_id": "1763490400021x448481236873124087",
    "agent_name": "SMS TO Voice"
  },
  "details": {
    "total_contacts": 1,
    "invalid_leads_count": 0,
    "estimated_processing_seconds": 0.1,
    "has_drips": false,
    "voice_transfer_enabled": true
  },
  "powered_by": "Teli"
}

Response

campaign_id
string
Campaign identifier
status
string
Processing status: processing, active, completed
agent
object
Agent information
details
object
Campaign processing details
powered_by
string
Always returns “Teli”

SMS-to-Voice Transfer

Enable seamless escalation from SMS conversations to phone calls by setting enable_sms_to_voice: true. Requirements:
  • Voice agent must be created beforehand (use POST /v1/agents with agent_type: "voice")
  • Must provide voice_agent_id (Teli Voice agent ID)
  • Must provide outbound_number (phone number for making calls)
How It Works:
  1. Campaign starts with SMS conversation
  2. AI detects when voice call would be beneficial
  3. System automatically initiates phone call using voice agent
  4. Seamless transition from text to voice conversation
Example with Voice Transfer:
{
  "campaign_id": "json test",
  "sms_agent_id": "1763490400021x448481236873124087",
  "contacts": [...],
  "enable_sms_to_voice": true,
  "voice_agent_id": "agent_86f826bf8f59bacd5c10ae948a",
  "outbound_number": "+12489071796"
}
Response will include voice_transfer_enabled: true in details.

Notes

  • Campaign ID must be unique across your organization
  • Contacts can include all lead fields (email, address, custom fields)
  • Invalid phone numbers are automatically filtered out
  • Campaign starts processing immediately upon creation
  • Use dry_run: true for testing without sending real messages
  • SMS-to-voice requires both voice agent and outbound phone number
  • Drip schedules defined in agent configuration (not campaign)
  • All messages support variable substitution: {'{'}{'{'}}first_name{'}'}{'}'}}, {'{'}{'{'}}last_name{'}'}{'}'}}, etc.