Vapi Integration - API Setup

Connect your Vapi AI assistants to Vobiz SIP infrastructure using API/CLI commands.

Prefer using the Dashboard?

Check out the Dashboard Setup Guide for a visual step-by-step walkthrough.

Overview

This guide shows how to integrate Vapi with Vobiz programmatically to enable outbound calling - your AI assistants can call any phone number.

Call flow:

Integration Flow
Your App → Vapi API → Vobiz SIP → Phone Network → Person Answers → AI Assistant Speaks

Prerequisites

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., 5f3a607b.sip.vobiz.ai)
  • username
  • password

You'll need them for Vapi configuration.

Get Phone Number

Purchase a phone number for outbound caller ID or inbound calls.

See: Vobiz Phone Numbers Documentation

Part 2: Vapi Setup

Get Vapi Private Key

  1. Log in to Vapi Dashboard
  2. Click your profile icon (top right)
  3. Go to SettingsAPI Keys
  4. Click Create new key
  5. Copy the key
Example Private Key
c07947df-6ba2-4e58-92f5-35e92849f6c2

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

Get Assistant ID

  1. In Vapi Dashboard, go to Assistants
  2. Select your assistant (or create one)
  3. Copy the Assistant ID
Example Assistant ID
9fb6d4c5-9403-49ea-afeb-9b493d63b474

Or list via API:

List Assistants
curl "https://api.vapi.ai/assistant" \
  -H "Authorization: Bearer YOUR_VAPI_PRIVATE_KEY"

Part 3: Connect Vobiz to Vapi (3 Steps)

Step 1: Create SIP Credential in Vapi

This registers your Vobiz SIP trunk with Vapi for outbound calling.

Create SIP Credential
curl -X POST "https://api.vapi.ai/credential" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_VAPI_PRIVATE_KEY" \
  -d '{
    "provider": "byo-sip-trunk",
    "name": "Vobiz Trunk",
    "gateways": [{
      "ip": "bfab10fb.sip.vobiz.ai",
      "inboundEnabled": false
    }],
    "outboundLeadingPlusEnabled": true,
    "outboundAuthenticationPlan": {
      "authUsername": "Vapi_user",
      "authPassword": "Password@123"
    }
  }'

Replace:

  • bfab10fb.sip.vobiz.ai → Your Vobiz SIP domain
  • Vapi_user → Your Vobiz username
  • Password@123 → Your Vobiz password
Response
{
  "id": "65a79bd2-c1b9-4c83-8e55-97c22c092b48",
  "provider": "byo-sip-trunk",
  "gateways": [{
    "ip": "bfab10fb.sip.vobiz.ai",
    "inboundEnabled": false
  }],
  ...
}

Save the `id` field - this is your Credential ID.

Step 2: Register Phone Number

This associates your phone number with the SIP credential for caller ID.

Register Phone Number
curl -X POST "https://api.vapi.ai/phone-number" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_VAPI_PRIVATE_KEY" \
  -d '{
    "provider": "byo-phone-number",
    "name": "Vobiz Line",
    "number": "08071387149",
    "numberE164CheckEnabled": false,
    "credentialId": "65a79bd2-c1b9-4c83-8e55-97c22c092b48"
  }'

Replace:

  • 08071387149 → Your Vobiz phone number
  • 65a79bd2-c1b9-4c83-8e55-97c22c092b48 → Your Credential ID from Step 1
Response
{
  "id": "91122039-9644-47fd-a545-d865075a6941",
  "number": "08071387149",
  "status": "active",
  "credentialId": "65a79bd2-c1b9-4c83-8e55-97c22c092b48",
  ...
}

Save the `id` field - this is your Phone Number ID.

Step 3: Make Outbound Call

Now you can make calls using your AI assistant!

Initiate Outbound Call
curl -X POST "https://api.vapi.ai/call/phone" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_VAPI_PRIVATE_KEY" \
  -d '{
    "assistantId": "9fb6d4c5-9403-49ea-afeb-9b493d63b474",
    "customer": {
      "number": "+919148227303",
      "numberE164CheckEnabled": false
    },
    "phoneNumberId": "91122039-9644-47fd-a545-d865075a6941"
  }'

Replace:

  • 9fb6d4c5-9403-49ea-afeb-9b493d63b474 → Your Assistant ID
  • +919148227303 → Destination number to call
  • 91122039-9644-47fd-a545-d865075a6941 → Your Phone Number ID from Step 2
Response
{
  "id": "019a0bce-0cf3-7337-a253-f65f4e9c68f4",
  "status": "queued",
  "type": "outboundPhoneCall",
  "assistantId": "9fb6d4c5-9403-49ea-afeb-9b493d63b474",
  "customer": {
    "number": "+919148227303"
  },
  "phoneNumberId": "91122039-9644-47fd-a545-d865075a6941",
  ...
}

Call initiated! The phone will ring, and when answered, your AI assistant will speak.

Verification

Check Call Status

View your call logs in Vapi DashboardCalls

Or via API:

Get Call Details
curl "https://api.vapi.ai/call/019a0bce-0cf3-7337-a253-f65f4e9c68f4" \
  -H "Authorization: Bearer YOUR_VAPI_PRIVATE_KEY"

Test Call Flow

  1. Run Step 3 to initiate a call
  2. Wait for destination phone to ring
  3. Answer the call
  4. AI assistant will greet and speak
  5. Check call transcript in Vapi Dashboard

Troubleshooting

"Unauthorized" / "Invalid API Key"

Problem: Vapi Private Key is incorrect.

Fix:

  • Verify you copied the entire key
  • Generate new key at Vapi Dashboard → Settings → API Keys

"Couldn't Get Assistant"

Problem: Wrong Assistant ID or doesn't exist.

Fix:

  • Run: curl "https://api.vapi.ai/assistant" -H "Authorization: Bearer YOUR_KEY"
  • Use the correct id from the response
  • Don't confuse Credential ID with Assistant ID

"SIP Authentication Failed"

Problem: Vobiz credentials are incorrect.

Fix:

  • Verify SIP domain, username, password in Vobiz Console
  • Ensure you're using the exact sip_domain (e.g., bfab10fb.sip.vobiz.ai)
  • Don't use generic sip.vobiz.ai

"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: Assistant configuration issue.

Fix:

  • Verify assistant has "First Message" configured in Vapi dashboard
  • Check assistant has voice provider set up
  • View call logs in Vapi Dashboard → Calls

Call Doesn't Connect

Problem: Wrong phone number format or trunk configuration.

Fix:

  • Use E.164 format: +919148227303 (with +)
  • Or local format: 09148227303 (without +)
  • Verify Vobiz trunk is active in Vobiz Console
  • Check Vobiz CDR logs for call attempts

Quick Reference

Required Credentials

WhatWhere to GetUsed In
Vapi Private KeyVapi Dashboard → Settings → API KeysAll API requests
Vobiz SIP DomainVobiz Console → Trunks → sip_domainStep 1: gateways[0].ip
Vobiz UsernameVobiz Console → Trunks → UsernameStep 1: authUsername
Vobiz PasswordVobiz Console → Trunks → PasswordStep 1: authPassword
Phone NumberVobiz Console → NumbersStep 2: number
Credential IDStep 1 response → idStep 2: credentialId
Phone Number IDStep 2 response → idStep 3: phoneNumberId
Assistant IDVapi Dashboard → Assistants → Assistant IDStep 3: assistantId

Field Mapping: Vobiz → Vapi

Vobiz FieldVapi FieldStep
sip_domaingateways[0].ip1
usernameoutboundAuthenticationPlan.authUsername1
passwordoutboundAuthenticationPlan.authPassword1
Phone numbernumber2

API Endpoints

ActionMethodEndpoint
Create SIP CredentialPOSThttps://api.vapi.ai/credential
Register Phone NumberPOSThttps://api.vapi.ai/phone-number
Make Outbound CallPOSThttps://api.vapi.ai/call/phone
List AssistantsGEThttps://api.vapi.ai/assistant
Get Call DetailsGEThttps://api.vapi.ai/call/{callId}

All requests require:

Authorization: Bearer YOUR_VAPI_PRIVATE_KEY

Common Errors

ErrorCauseFix
401 UnauthorizedWrong Vapi Private KeyVerify key in dashboard
Assistant Does Not ExistWrong Assistant IDList assistants via API
SIP auth failedWrong Vobiz credentialsCheck Vobiz Console → Trunks
Insufficient balanceLow Vobiz creditsAdd funds in Vobiz Console
Phone format errorMissing + or country codeUse +919148227303 or 09148227303

Complete Example

Here's a complete working example with real values from our setup:

Step 1: Create SIP Credential
curl -X POST "https://api.vapi.ai/credential" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer c07947df-6ba2-4e58-92f5-35e92849f6c2" \
  -d '{
    "provider": "byo-sip-trunk",
    "name": "Vobiz Trunk 2",
    "gateways": [{
      "ip": "bfab10fb.sip.vobiz.ai",
      "inboundEnabled": false
    }],
    "outboundLeadingPlusEnabled": true,
    "outboundAuthenticationPlan": {
      "authUsername": "Vapi_user",
      "authPassword": "Password@123"
    }
  }'

# Response: Save credential ID
# {"id": "65a79bd2-c1b9-4c83-8e55-97c22c092b48", ...}
Step 2: Register Phone Number
curl -X POST "https://api.vapi.ai/phone-number" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer c07947df-6ba2-4e58-92f5-35e92849f6c2" \
  -d '{
    "provider": "byo-phone-number",
    "name": "Vobiz Line 2",
    "number": "08071387149",
    "numberE164CheckEnabled": false,
    "credentialId": "65a79bd2-c1b9-4c83-8e55-97c22c092b48"
  }'

# Response: Save phone number ID
# {"id": "91122039-9644-47fd-a545-d865075a6941", ...}
Step 3: Make Outbound Call
curl -X POST "https://api.vapi.ai/call/phone" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer c07947df-6ba2-4e58-92f5-35e92849f6c2" \
  -d '{
    "assistantId": "9fb6d4c5-9403-49ea-afeb-9b493d63b474",
    "customer": {
      "number": "+919148227303",
      "numberE164CheckEnabled": false
    },
    "phoneNumberId": "91122039-9644-47fd-a545-d865075a6941"
  }'

# Response: Call initiated!
# {"id": "019a0bce-0cf3-7337-a253-f65f4e9c68f4", "status": "queued", ...}

Additional Resources

Support

Integration complete!

Your Vapi assistants can now make outbound calls through Vobiz.

Next Steps:

  • Customize your assistant in Vapi Dashboard
  • View call logs and analytics in Vapi Dashboard
  • Build your voice AI application!