Overview
This guide will walk you through creating your first SMS or Voice campaign. Choose your communication channel below.
Prerequisites
- API key (contact your account manager)
- Basic knowledge of REST APIs
- cURL, JavaScript, or Python
SMS Quick Start
Build SMS campaigns with AI-powered conversations.
Step 1: Create Organization
curl -X POST https://api.teli.ai/v1/organizations \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name": "My Company", "contact_email": "[email protected]"}'
Save the unique_id from the response.
Step 2: Create User
curl -X POST https://api.teli.ai/v1/organizations/{org_id}/users \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name": "Admin", "email": "[email protected]", "permission": "admin"}'
Step 3: Create SMS Agent
curl -X POST https://api.teli.ai/v1/agents \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"agent_type": "sms",
"agent_name": "Sales Agent",
"starting_message": "Hi {'{'}{'{'}}first_name{'}'}{'}'},interested in our services?",
"prompt": "You are a helpful sales agent. Ask about their needs and budget.",
"organization_id": "{org_id}",
"user_id": "{user_id}"
}'
Save the agent_id from the response.
curl -X POST https://api.teli.ai/v1/contacts/lists \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"list_name": "My Leads",
"organization_id": "{org_id}",
"user_id": "{user_id}",
"contacts": [
{"phone_number": "+15551234567", "first_name": "John", "last_name": "Doe"}
]
}'
Step 5: Create SMS Campaign
curl -X POST https://api.teli.ai/v1/campaigns \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"campaign_id": "my_first_campaign",
"campaign_name": "First SMS Campaign",
"organization_id": "{org_id}",
"user_id": "{user_id}",
"sms_agent_id": "{agent_id}",
"teli_sms_number": "+15551000001",
"contacts": [{"phone_number": "+15551234567", "first_name": "John"}]
}'
SMS Campaign created! Messages will be sent automatically.
Voice Quick Start
Build voice campaigns with AI-powered phone conversations.
Step 1-2: Organization & User
Same as SMS Quick Start above. Skip if already completed.
Step 3: Create Voice Agent
curl -X POST https://api.teli.ai/v1/agents \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"agent_type": "voice",
"agent_name": "Voice Sales Agent",
"starting_message": "Hi {'{'}{'{'}}first_name{'}'}{'}'},how can I help you today?",
"prompt": "You are a helpful voice assistant. Ask about their needs.",
"voice_id": "11labs-Adrian",
"language": "en-US",
"organization_id": "{org_id}",
"user_id": "{user_id}"
}'
Save the voice_agent_id from the response.
Step 4: Provision Phone Number
curl -X POST https://api.teli.ai/v1/voice/phone-numbers/create \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"area_code": "415",
"user_id": "{user_id}",
"organization_id": "{org_id}",
"tenant_id": "{tenant_id}"
}'
Save the phone_number from the response (e.g., “+14155551234”).
Same as SMS Quick Start Step 4 above.
Step 6: Create Voice Campaign
curl -X POST https://api.teli.ai/v1/voice/campaigns \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"leads": [
{"phone_number": "+15551234567", "first_name": "John", "last_name": "Doe"}
],
"voice_agent_id": "{voice_agent_id}",
"agent_outbound_number": "{provisioned_phone}",
"organization_id": "{org_id}",
"tenant_id": "{tenant_id}"
}'
Voice Campaign created! Calls will be placed automatically.
SMS-to-Voice Transfer
Enable seamless escalation from SMS to voice calls.
Setup
- Create both agents (SMS + Voice) as shown above
- Provision phone number for voice calls
- Create SMS campaign with voice transfer enabled:
curl -X POST https://api.teli.ai/v1/campaigns \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"campaign_name": "SMS with Voice Transfer",
"sms_agent_id": "{sms_agent_id}",
"teli_sms_number": "+15551000001",
"enable_sms_to_voice": true,
"voice_agent_id": "{voice_agent_id}",
"outbound_number": "{provisioned_phone}",
"organization_id": "{org_id}",
"user_id": "{user_id}",
"contacts": [{"phone_number": "+15551234567", "first_name": "John"}]
}'
How It Works:
- Conversation starts via SMS
- AI can trigger phone call if user requests
- Seamless transition to voice
- Same conversation context maintained
Next Steps
Support
Need help? Contact us at [email protected]