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:

Integration Flow
Your App → ElevenLabs API → Vobiz SIP → Phone Network → Person Answers → AI Agent Speaks

Perfect 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 KeyGet 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)
  • username
  • password

You'll need them for ElevenLabs configuration.

Get Phone Number

Purchase a phone number for outbound caller ID.

See: Vobiz Phone Numbers Documentation

Part 2: ElevenLabs Setup

Step 1: Get API Key

Via Dashboard:

  1. Go to ElevenLabs Settings → API Keys
  2. Click Create API Key
  3. Name your key (e.g., "Vobiz Integration")
  4. Set permissions:
    • ElevenLabs Agents: Write (Required)
    • Voices: Read (Required)
    • User: Read (Optional)
  5. Click Create and copy the key
Example API Key
sk_your_elevenlabs_api_key_here

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

Step 2: List Available Voices

curl command
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.)
Example response
{
  "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 command
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
Example response
{
  "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 command
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 number
  • abc123def.sip.vobiz.ai → Your Vobiz SIP domain
  • your_username → Your Vobiz username
  • your_password → Your Vobiz password
Example response
{
  "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 Outbound Call

Now you can make calls using your AI agent!

curl command
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
Example response
{
  "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 command
curl "https://api.elevenlabs.io/v1/convai/agents" \
  -H "xi-api-key: sk_your_elevenlabs_api_key_here"
Example response
[
  {
    "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 destination phone to ring
  3. Answer the call
  4. AI agent will greet and speak
  5. 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:

"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_message configured
  • Check agent has valid voice_id in 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

WhatWhere to GetExample
ElevenLabs API KeyElevenLabs Settings → API Keyssk_your_elevenlabs_api_key_here
Voice IDPart 2, Step 2: List Voicesvoice_id_here
Agent IDPart 2, Step 3: Create Agentagent_your_agent_id_here
Phone Number IDPart 3, Step 1: Import Phonephnum_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

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

Base URL: https://api.elevenlabs.io

All requests require: xi-api-key: YOUR_ELEVENLABS_API_KEY

Common Errors

ErrorCauseFix
401 UnauthorizedWrong API KeyCheck key in ElevenLabs Settings
404 Not FoundWrong Agent/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:

Step 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
Step 2: 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."
        },
        "first_message": "Hello! How can I help you today?",
        "language": "en"
      },
      "tts": {
        "voice_id": "voice_id_here"
      }
    }
  }'

# Response: Save agent_id
Step 3: Import 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 '{
    "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_id
Step 4: Make Outbound 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!

Additional Resources

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!