ElevenLabs integration (API)

    Connect ElevenLabs to Vobiz SIP trunking via API - programmatic setup for ultra-realistic AI voice agents on outbound and inbound calls in 130+ countries.

    This guide shows how to integrate ElevenLabs with Vobiz programmatically to enable outbound calling and automate voice calls with ultra-realistic AI voices.

    💡 Tip: Prefer watching a walkthrough or using the dashboard? See the ElevenLabs integration overview for the video tutorial, or the dashboard setup guide for a visual step-by-step walkthrough.

    Perfect for:

    • Application integration
    • Bulk calling campaigns
    • Automation workflows
    • Custom call triggers
    text
    Call flow: Your App → ElevenLabs API → Vobiz SIP → Phone Network → Person Answers → AI Agent Speaks

    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 a 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 (for example, abc123def.sip.vobiz.ai)
    • username
    • password

    You'll need them for ElevenLabs configuration.

    Get a phone number

    Purchase a phone number for outbound caller ID.

    See: Vobiz phone numbers documentation

    Part 2: ElevenLabs setup

    Step 1: Get your API key

    Via dashboard:

    • Go to ElevenLabs Developer → API Keys
    • Click Create API Key
    • Name your key (for example, "Vobiz Integration")
    • Set permissions:
      • ElevenLabs Agents: Write (Required)
      • Voices: Read (Required)
      • User: Read (Optional)
    • Click Create and copy the key
    text
    sk_your_elevenlabs_api_key_here

    Save this key securely - you'll use it in all API requests.

    Step 2: List available voices
    bash
    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 agent
    • name - voice name for identification
    • category - voice type (premade, cloned, etc.)
    json
    { "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 an agent
    bash
    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
    json
    { "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

    Step 1: Import your phone number

    Register your Vobiz phone number with ElevenLabs for outbound calling.

    bash
    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 '{ "provider": "sip_trunk", "phone_number": "+911234567890", "label": "Vobiz Main Line", "inbound_trunk_config": {}, "outbound_trunk_config": { "address": "abc123def.sip.vobiz.ai", "transport": "tcp", "credentials": { "username": "your_username", "password": "your_password" } }, "supports_inbound": true, "supports_outbound": true }'

    Replace:

    • +911234567890 → your Vobiz phone number
    • abc123def.sip.vobiz.ai → your Vobiz SIP domain
    • your_username → your Vobiz username
    • your_password → your Vobiz password
    json
    { "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:

    Step 2: Make an outbound call
    bash
    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 3
    • phnum_your_phone_number_id_here → your phone number ID from Step 1
    • +919988776655 → destination number to call
    json
    { "success": true, "message": "Outbound call initiated", "conversation_id": "conv_your_conversation_id_here", "sip_call_id": "SCL_your_sip_call_id" }

    Call initiated.

    What happens next:

    • The phone rings at the destination
    • When answered, the agent speaks
    • The conversation begins with a natural voice

    Verification

    List your agents
    bash
    curl "https://api.elevenlabs.io/v1/convai/agents" \ -H "xi-api-key: sk_your_elevenlabs_api_key_here"
    json
    [ { "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:

    1. Run Step 2 to initiate a call.
    2. Wait for the destination phone to ring.
    3. Answer the call.
    4. The AI agent will greet and speak.
    5. Check the call transcript in the 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 the API key has ElevenLabs Agents: Write permission.
    • Generate a new key at ElevenLabs Developer.
    "Not Found" / 404 error

    Problem: Agent ID or phone number ID doesn't exist.

    Fix:

    • List your agents to verify the agent ID is correct.
    • Check the phone number is configured in ElevenLabs Dashboard.
    • Ensure you're using the correct ID format.
    SIP 408 request timeout

    Problem: The Vobiz trunk cannot reach ElevenLabs SIP servers.

    Fix:

    "Insufficient balance"

    Problem: Vobiz account has no credits.

    Fix:

    Call connects but silent

    Problem: Agent configuration issue or voice not set.

    Fix:

    • Verify the agent has first_message configured.
    • Check the agent has a valid voice_id in conversation_config.
    • Test the voice in the 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 the Vobiz trunk is active.
    • Check Vobiz CDR logs for call attempts at Vobiz Console.
    • Ensure the phone number is not blocked.

    Quick reference

    Required credentials
    CredentialWhere to getExample
    ElevenLabs API KeyElevenLabs Developer → API Keyssk_your_elevenlabs_api_key_here
    Voice IDPart 2, step 2 (List Voices)voice_id_here
    Agent IDPart 2, step 3 (Create Agent)agent_your_agent_id_here
    Phone Number IDPart 3, step 1 (Import Phone)phnum_your_phone_number_id_here
    Vobiz SIP DomainVobiz Console → Trunksabc123def.sip.vobiz.ai
    Vobiz UsernameVobiz Console → Trunksyour_username
    Vobiz PasswordVobiz Console → Trunksyour_password
    API endpoints

    Base URL: https://api.elevenlabs.io - all requests require xi-api-key: YOUR_ELEVENLABS_API_KEY

    ActionMethodEndpoint
    List voicesGET/v1/voices
    Create agentPOST/v1/convai/agents
    List agentsGET/v1/convai/agents
    Import phone numberPOST/v1/convai/phone-numbers
    Make outbound callPOST/v1/convai/sip-trunk/outbound-call
    Common errors
    ErrorCauseFix
    401 UnauthorizedWrong API keyRegenerate at ElevenLabs Developer
    404 Not FoundWrong agent or phone IDList agents to verify IDs
    408 SIP timeoutTrunk config wrongCheck Vobiz Console → Trunks
    Insufficient balanceLow Vobiz creditsAdd funds in Vobiz Console

    Complete example

    Here's a complete working example with real values:

    bash
    # 1. List voices curl "https://api.elevenlabs.io/v1/voices" \ -H "xi-api-key: sk_your_elevenlabs_api_key_here" # Save a voice_id from the response # 2. Create the 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." }, "first_message": "Hello! How can I help you today?", "language": "en" }, "tts": { "voice_id": "voice_id_here" } } }' # Response: save agent_id # 3. Import the phone number 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 '{ "provider": "sip_trunk", "phone_number": "+911234567890", "label": "Vobiz Main Line", "inbound_trunk_config": {}, "outbound_trunk_config": { "address": "abc123def.sip.vobiz.ai", "transport": "tcp", "credentials": { "username": "your_username", "password": "your_password" } }, "supports_inbound": true, "supports_outbound": true }' # Response: save phone_number_id # 4. Make a call 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" }' # Response: call initiated

    Resources