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": "+919148223344",
      "numberE164CheckEnabled": false
    },
    "phoneNumberId": "91122039-9644-47fd-a545-d865075a6941"
  }'

Replace:

  • 9fb6d4c5-9403-49ea-afeb-9b493d63b474 → Your Assistant ID
  • +919148223344 → 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": "+919148223344"
  },
  "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: +919148223344 (with +)
  • Or local format: 09148223344 (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 +919148223344 or 09148223344

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": "+919148223344",
      "numberE164CheckEnabled": false
    },
    "phoneNumberId": "91122039-9644-47fd-a545-d865075a6941"
  }'

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

Inbound Call Setup

Receive inbound calls on your Vobiz number and route them to your Vapi AI assistant — all configured via API.

Inbound call flow:

Inbound Flow
Caller Dials Vobiz Number → Vobiz SIP → Vapi SIP Trunk → Vapi AI Assistant → Conversation

Step 1: Create Inbound SIP Credential in Vapi

Create a SIP trunk credential configured for inbound only — using the Vobiz gateway IP instead of a SIP domain.

Create Inbound 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 Inbound Trunk",
    "gateways": [{
      "ip": "13.233.44.61",
      "port": 5060,
      "netmask": 32,
      "inboundEnabled": true,
      "outboundEnabled": false
    }]
  }'
Response
{
  "id": "46deea29-645d-44a3-bf42-7c6ec2d4b65c",
  "provider": "byo-sip-trunk",
  "gateways": [{
    "ip": "13.233.44.61",
    "outboundEnabled": false
  }],
  "name": "Vobiz Inbound Trunk"
}

Save the id field — this is your Inbound Credential ID (also called Trunk ID).

Want both inbound and outbound on the same trunk? Add a second gateway entry for outbound with your Vobiz SIP domain and credentials:

Combined Inbound + Outbound
"gateways": [
  {
    "ip": "13.233.44.61",
    "inboundEnabled": true,
    "outboundEnabled": false
  },
  {
    "ip": "bfab10fb.sip.vobiz.ai",
    "inboundEnabled": false,
    "outboundEnabled": true
  }
]

Step 2: Get the Trunk ID

If you didn't save the ID from Step 1, retrieve it by listing all credentials:

List SIP Trunk Credentials
curl -X GET "https://api.vapi.ai/credential" \
  -H "Authorization: Bearer YOUR_VAPI_PRIVATE_KEY"

Find the entry with gateway IP: 13.233.44.61 and outboundEnabled: false. The id field is your Trunk ID.

Step 3: Configure Inbound Trunk in Vobiz

Create an inbound trunk in Vobiz Console that routes calls to Vapi:

  1. Go to Vobiz ConsoleSIP TrunksInbound Trunk
  2. Click Create New Trunk
  3. Set Name, Transport: UDP
  4. Set Primary URI to: <TRUNK_ID>.sip.vapi.ai
    Example: 46deea29-645d-44a3-bf42-7c6ec2d4b65c.sip.vapi.ai
  5. Link your Vobiz phone number to this trunk
  6. Click Save

Or use the Vobiz API to create the inbound trunk programmatically. See SIP Trunks Documentation.

Step 4: Register Inbound Phone Number in Vapi

Register your Vobiz number with the inbound credential, and assign your assistant:

Register Inbound 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 Inbound Line",
    "number": "+918071387376",
    "numberE164CheckEnabled": true,
    "credentialId": "46deea29-645d-44a3-bf42-7c6ec2d4b65c",
    "assistantId": "YOUR_ASSISTANT_ID"
  }'

Replace:

  • +918071387376 → Your Vobiz phone number
  • 46deea29-... → Your Inbound Credential ID from Step 1
  • YOUR_ASSISTANT_ID → Your Vapi Assistant ID

Inbound Setup Complete!

Dial your Vobiz number — the call will route through to your Vapi AI assistant automatically.

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!