ElevenLabs Agent - API Setup
Connect your ElevenLabs AI agents to Vobiz SIP infrastructure using API/CLI commands for programmatic automation.
Prefer using the Dashboard?
Check out the Dashboard Setup Guide for a visual step-by-step walkthrough.
Overview
This guide shows how to integrate ElevenLabs with Vobiz programmatically to enable outbound calling - automate voice calls with ultra-realistic AI voices.
Call flow:
Your App → ElevenLabs API → Vobiz SIP → Phone Network → Person Answers → AI Agent SpeaksPerfect for:
- Application integration
- Bulk calling campaigns
- Automation workflows
- Custom call triggers
Prerequisites
- →Vobiz Account with SIP trunk → Create account
- →ElevenLabs Account with API key → Sign up
- →ElevenLabs API Key → Get API key
- →Phone number from Vobiz (for caller ID)
Part 1: Vobiz Setup
Create SIP Trunk
Create a SIP trunk in Vobiz to handle voice traffic.
See: Vobiz SIP Trunks Documentation
Save these values from the response:
sip_domain(e.g.,abc123def.sip.vobiz.ai)usernamepassword
You'll need them for ElevenLabs configuration.
Get Phone Number
Purchase a phone number for outbound caller ID.
Part 2: ElevenLabs Setup
Step 1: Get API Key
Via Dashboard:
- Go to ElevenLabs Settings → API Keys
- Click Create API Key
- Name your key (e.g., "Vobiz Integration")
- Set permissions:
- ElevenLabs Agents: Write (Required)
- Voices: Read (Required)
- User: Read (Optional)
- Click Create and copy the key
sk_your_elevenlabs_api_key_hereSave this key securely - you'll use it in all API requests.
Step 2: List Available Voices
curl "https://api.elevenlabs.io/v1/voices" \
-H "xi-api-key: sk_your_elevenlabs_api_key_here"What to extract:
voice_id- Use this when creating your agentname- Voice name for identificationcategory- Voice type (premade, cloned, etc.)
{
"voices": [
{
"voice_id": "voice_id_here",
"name": "Rachel",
"category": "premade",
"labels": {
"accent": "american",
"age": "young"
}
},
{
"voice_id": "another_voice_id",
"name": "Domi",
"category": "premade"
}
]
}Copy a voice_id - you'll need it in Step 3.
Step 3: Create Agent
curl -X POST "https://api.elevenlabs.io/v1/convai/agents" \
-H "Content-Type: application/json" \
-H "xi-api-key: sk_your_elevenlabs_api_key_here" \
-d '{
"name": "Customer Support Bot",
"conversation_config": {
"agent": {
"prompt": {
"prompt": "You are a helpful customer support assistant. Be friendly, professional, and concise."
},
"first_message": "Hello! Thank you for calling. How can I help you today?",
"language": "en"
},
"tts": {
"voice_id": "voice_id_here"
}
}
}'Replace:
voice_id_here→ Your chosen voice ID from Step 2
{
"agent_id": "agent_your_agent_id_here",
"name": "Customer Support Bot",
"conversation_config": {
"agent": {
"first_message": "Hello! Thank you for calling. How can I help you today?",
"language": "en"
}
}
}Save the agent_id - you'll need it to make calls.
Part 3: Connect Vobiz to ElevenLabs (2 Steps)
Step 1: Import Phone Number via API
This registers your Vobiz phone number with ElevenLabs for outbound calling.
curl -X POST "https://api.elevenlabs.io/v1/convai/phone-numbers" \
-H "Content-Type: application/json" \
-H "xi-api-key: sk_your_elevenlabs_api_key_here" \
-d '{
"phone_number": "+911234567890",
"label": "Vobiz Main Line",
"provider": "sip_trunk",
"outbound_trunk": {
"address": "abc123def.sip.vobiz.ai",
"transport": "tcp",
"username": "your_username",
"password": "your_password"
}
}'Replace:
+911234567890→ Your Vobiz phone numberabc123def.sip.vobiz.ai→ Your Vobiz SIP domainyour_username→ Your Vobiz usernameyour_password→ Your Vobiz password
{
"phone_number_id": "phnum_your_phone_number_id_here",
"phone_number": "+911234567890",
"label": "Vobiz Main Line",
"supports_outbound": true,
"supports_inbound": true,
"provider": "sip_trunk"
}Save the phone_number_id - you'll need it in Step 2.
Get Vobiz Credentials:
- Via Console: Vobiz Console → Trunks
- Via API: Vobiz API Reference
Step 2: Make Outbound Call
Now you can make calls using your AI agent!
curl -X POST "https://api.elevenlabs.io/v1/convai/sip-trunk/outbound-call" \
-H "Content-Type: application/json" \
-H "xi-api-key: sk_your_elevenlabs_api_key_here" \
-d '{
"agent_id": "agent_your_agent_id_here",
"agent_phone_number_id": "phnum_your_phone_number_id_here",
"to_number": "+919988776655"
}'Replace:
agent_your_agent_id_here→ Your agent ID from Part 2, Step 3phnum_your_phone_number_id_here→ Your phone number ID from Step 1+919988776655→ Destination number to call
{
"success": true,
"message": "Outbound call initiated",
"conversation_id": "conv_your_conversation_id_here",
"sip_call_id": "SCL_your_sip_call_id"
}Call initiated via API!
What happens next:
- Phone rings at destination
- When answered, agent speaks
- Conversation begins with natural voice
Verification
List Your Agents
curl "https://api.elevenlabs.io/v1/convai/agents" \
-H "xi-api-key: sk_your_elevenlabs_api_key_here"[
{
"agent_id": "agent_your_agent_id_here",
"name": "Customer Support Bot",
"conversation_config": {
"agent": {
"first_message": "Hello! How can I help you today?",
"language": "en"
}
}
}
]Check Call Logs
View your call history in ElevenLabs Dashboard → Call History
Test Call Flow:
- Run Step 2 to initiate a call
- Wait for destination phone to ring
- Answer the call
- AI agent will greet and speak
- Check call transcript in ElevenLabs Dashboard
Troubleshooting
"Unauthorized" / 401 Error
Problem: ElevenLabs API Key is invalid or expired.
Fix:
- Verify you copied the entire key (starts with
sk_) - Check API key has ElevenLabs Agents: Write permission
- Generate new key at ElevenLabs Settings
"Not Found" / 404 Error
Problem: Agent ID or Phone Number ID doesn't exist.
Fix:
- List your agents to verify agent ID is correct
- Check phone number is configured in ElevenLabs Dashboard
- Ensure you're using the correct ID format
SIP 408 Request Timeout
Problem: Vobiz trunk cannot reach ElevenLabs SIP servers.
Fix:
- Verify Vobiz trunk configuration in Vobiz Console
- Ensure transport is set to
tcp - Check trunk status is
active - See: Vobiz SIP Trunks Guide
"Insufficient Balance"
Problem: Vobiz account has no credits.
Fix:
- Log in to Vobiz Console → Billing
- Add funds (minimum ₹100 recommended)
Call Connects But Silent
Problem: Agent configuration issue or voice not set.
Fix:
- Verify agent has
first_messageconfigured - Check agent has valid
voice_idin conversation_config - Test voice in ElevenLabs dashboard first
- View call logs in ElevenLabs Dashboard
Call Doesn't Connect
Problem: Wrong phone number format or trunk configuration.
Fix:
- Use E.164 format:
+919988776655(with + and country code) - Verify Vobiz trunk is active
- Check Vobiz CDR logs for call attempts at Vobiz Console
- Ensure phone number is not blocked
Quick Reference
Required Credentials
| What | Where to Get | Example |
|---|---|---|
| ElevenLabs API Key | ElevenLabs Settings → API Keys | sk_your_elevenlabs_api_key_here |
| Voice ID | Part 2, Step 2: List Voices | voice_id_here |
| Agent ID | Part 2, Step 3: Create Agent | agent_your_agent_id_here |
| Phone Number ID | Part 3, Step 1: Import Phone | phnum_your_phone_number_id_here |
| Vobiz SIP Domain | Vobiz Console → Trunks | abc123def.sip.vobiz.ai |
| Vobiz Username | Vobiz Console → Trunks | your_username |
| Vobiz Password | Vobiz Console → Trunks | your_password |
API Endpoints
| Action | Method | Endpoint |
|---|---|---|
| List Voices | GET | /v1/voices |
| Create Agent | POST | /v1/convai/agents |
| List Agents | GET | /v1/convai/agents |
| Import Phone Number | POST | /v1/convai/phone-numbers |
| Make Outbound Call | POST | /v1/convai/sip-trunk/outbound-call |
Base URL: https://api.elevenlabs.io
All requests require: xi-api-key: YOUR_ELEVENLABS_API_KEY
Common Errors
| Error | Cause | Fix |
|---|---|---|
| 401 Unauthorized | Wrong API Key | Check key in ElevenLabs Settings |
| 404 Not Found | Wrong Agent/Phone ID | List agents to verify IDs |
| 408 SIP timeout | Trunk config wrong | Check Vobiz Console → Trunks |
| Insufficient balance | Low Vobiz credits | Add funds in Vobiz Console |
Complete Example
Here's a complete working example with real values:
curl "https://api.elevenlabs.io/v1/voices" \
-H "xi-api-key: sk_your_elevenlabs_api_key_here"
# Save a voice_id from the responsecurl -X POST "https://api.elevenlabs.io/v1/convai/agents" \
-H "Content-Type: application/json" \
-H "xi-api-key: sk_your_elevenlabs_api_key_here" \
-d '{
"name": "Customer Support Bot",
"conversation_config": {
"agent": {
"prompt": {
"prompt": "You are a helpful customer support assistant."
},
"first_message": "Hello! How can I help you today?",
"language": "en"
},
"tts": {
"voice_id": "voice_id_here"
}
}
}'
# Response: Save agent_idcurl -X POST "https://api.elevenlabs.io/v1/convai/phone-numbers" \
-H "Content-Type: application/json" \
-H "xi-api-key: sk_your_elevenlabs_api_key_here" \
-d '{
"phone_number": "+911234567890",
"label": "Vobiz Main Line",
"provider": "sip_trunk",
"outbound_trunk": {
"address": "abc123def.sip.vobiz.ai",
"transport": "tcp",
"username": "your_username",
"password": "your_password"
}
}'
# Response: Save phone_number_idcurl -X POST "https://api.elevenlabs.io/v1/convai/sip-trunk/outbound-call" \
-H "Content-Type: application/json" \
-H "xi-api-key: sk_your_elevenlabs_api_key_here" \
-d '{
"agent_id": "agent_your_agent_id_here",
"agent_phone_number_id": "phnum_your_phone_number_id_here",
"to_number": "+919988776655"
}'
# Response: Call initiated!Additional Resources
Vobiz Documentation
ElevenLabs Documentation
Integration complete!
Your ElevenLabs agents can now make outbound calls through Vobiz with ultra-realistic voices.
Next Steps:
- Customize your agent in ElevenLabs Dashboard
- View call logs and conversation transcripts
- Build your voice AI application!