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": "+919148223344",
"numberE164CheckEnabled": false
},
"phoneNumberId": "91122039-9644-47fd-a545-d865075a6941"
}'Replace:
9fb6d4c5-9403-49ea-afeb-9b493d63b474→ Your Assistant ID+919148223344→ 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": "+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 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:
+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
| 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 +919148223344 or 09148223344 |
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": "+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:
Caller Dials Vobiz Number → Vobiz SIP → Vapi SIP Trunk → Vapi AI Assistant → ConversationStep 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.
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
}]
}'{
"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:
"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:
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:
- Go to Vobiz Console → SIP Trunks → Inbound Trunk
- Click Create New Trunk
- Set Name, Transport:
UDP - Set Primary URI to:
<TRUNK_ID>.sip.vapi.ai
Example:46deea29-645d-44a3-bf42-7c6ec2d4b65c.sip.vapi.ai - Link your Vobiz phone number to this trunk
- 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:
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 number46deea29-...→ Your Inbound Credential ID from Step 1YOUR_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
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!