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:
Your App → Vapi API → Vobiz SIP → Phone Network → Person Answers → AI Assistant SpeaksPrerequisites
- ✓Vobiz Account with SIP trunk → Create account
- ✓Vapi Account with private key → Sign up
- ✓Vapi Assistant created → Create in dashboard
- ✓Phone number from Vobiz (optional, 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.,5f3a607b.sip.vobiz.ai)usernamepassword
You'll need them for Vapi configuration.
Get Phone Number
Purchase a phone number for outbound caller ID or inbound calls.
Part 2: Vapi Setup
Get Vapi Private Key
- Log in to Vapi Dashboard
- Click your profile icon (top right)
- Go to Settings → API Keys
- Click Create new key
- Copy the key
c07947df-6ba2-4e58-92f5-35e92849f6c2Save this key - you'll use it in all API requests.
Get Assistant ID
- In Vapi Dashboard, go to Assistants
- Select your assistant (or create one)
- Copy the Assistant ID
9fb6d4c5-9403-49ea-afeb-9b493d63b474Or list via API:
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.
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 domainVapi_user→ Your Vobiz usernamePassword@123→ Your Vobiz password
{
"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.
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 number65a79bd2-c1b9-4c83-8e55-97c22c092b48→ Your Credential ID from Step 1
{
"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!
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 call91122039-9644-47fd-a545-d865075a6941→ Your Phone Number ID from Step 2
{
"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 Dashboard → Calls
Or via API:
curl "https://api.vapi.ai/call/019a0bce-0cf3-7337-a253-f65f4e9c68f4" \
-H "Authorization: Bearer YOUR_VAPI_PRIVATE_KEY"Test Call Flow
- Run Step 3 to initiate a call
- Wait for destination phone to ring
- Answer the call
- AI assistant will greet and speak
- 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
idfrom 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
| What | Where to Get | Used In |
|---|---|---|
| Vapi Private Key | Vapi Dashboard → Settings → API Keys | All API requests |
| Vobiz SIP Domain | Vobiz Console → Trunks → sip_domain | Step 1: gateways[0].ip |
| Vobiz Username | Vobiz Console → Trunks → Username | Step 1: authUsername |
| Vobiz Password | Vobiz Console → Trunks → Password | Step 1: authPassword |
| Phone Number | Vobiz Console → Numbers | Step 2: number |
| Credential ID | Step 1 response → id | Step 2: credentialId |
| Phone Number ID | Step 2 response → id | Step 3: phoneNumberId |
| Assistant ID | Vapi Dashboard → Assistants → Assistant ID | Step 3: assistantId |
Field Mapping: Vobiz → Vapi
| Vobiz Field | → | Vapi Field | Step |
|---|---|---|---|
| sip_domain | → | gateways[0].ip | 1 |
| username | → | outboundAuthenticationPlan.authUsername | 1 |
| password | → | outboundAuthenticationPlan.authPassword | 1 |
| Phone number | → | number | 2 |
API Endpoints
| Action | Method | Endpoint |
|---|---|---|
| Create SIP Credential | POST | https://api.vapi.ai/credential |
| Register Phone Number | POST | https://api.vapi.ai/phone-number |
| Make Outbound Call | POST | https://api.vapi.ai/call/phone |
| List Assistants | GET | https://api.vapi.ai/assistant |
| Get Call Details | GET | https://api.vapi.ai/call/{callId} |
All requests require:
Authorization: Bearer YOUR_VAPI_PRIVATE_KEYCommon Errors
| Error | Cause | Fix |
|---|---|---|
| 401 Unauthorized | Wrong Vapi Private Key | Verify key in dashboard |
| Assistant Does Not Exist | Wrong Assistant ID | List assistants via API |
| SIP auth failed | Wrong Vobiz credentials | Check Vobiz Console → Trunks |
| Insufficient balance | Low Vobiz credits | Add funds in Vobiz Console |
| Phone format error | Missing + or country code | Use +919148227303 or 09148227303 |
Complete Example
Here's a complete working example with real values from our setup:
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", ...}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", ...}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
Vobiz Documentation
Vapi Documentation
Support
- Vobiz: support@vobiz.ai
- Vapi: Vapi Discord or support@vapi.ai
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!