Skip to main content

Search Available Numbers

Search for available phone numbers from a provider. GET /sip/search-numbers Authentication: JWT cookie (Developer+)
ParameterTypeRequiredDescription
country_codestringISO country code (e.g., “US”)
area_codestringArea code filter
providerstring“twilio” or “vonage”
curl -X GET "https://api.vaani.ai/sip/search-numbers?country_code=US&area_code=650&provider=twilio" \
  -H "Cookie: access_token=YOUR_TOKEN"

Purchase Number

Purchase an available number and auto-provision SIP trunks. POST /sip/purchase-number Authentication: JWT cookie (Admin)
curl -X POST "https://api.vaani.ai/sip/purchase-number" \
  -H "Content-Type: application/json" \
  -H "Cookie: access_token=YOUR_TOKEN" \
  -d '{
    "phone_number": "+16505551234",
    "provider": "twilio",
    "country_code": "US"
  }'
This endpoint automatically creates three LiveKit resources: inbound trunk, outbound trunk, and dispatch rule.

Register Custom SIP Trunk

Register an existing SIP trunk (not purchased through Vaani). POST /sip/register
curl -X POST "https://api.vaani.ai/sip/register" \
  -H "Content-Type: application/json" \
  -H "Cookie: access_token=YOUR_TOKEN" \
  -d '{
    "sip_address": "custom-sip.provider.com",
    "phone_number": "+442071234567",
    "sip_provider": "custom",
    "auth_username": "my_sip_user",
    "auth_password": "my_sip_pass",
    "krisp_enabled": true,
    "label": "UK Office Line"
  }'

List All Phone Numbers

GET /sip Authentication: JWT cookie or API key
curl -X GET "https://api.vaani.ai/sip" \
  -H "Cookie: access_token=YOUR_TOKEN"

Update SIP Trunk

PUT /sip/{sip_id}
Updating a SIP trunk deletes and recreates the LiveKit trunks, causing a brief service interruption.
curl -X PUT "https://api.vaani.ai/sip/sip_001" \
  -H "Content-Type: application/json" \
  -H "Cookie: access_token=YOUR_TOKEN" \
  -d '{
    "sip_address": "new-sip.provider.com",
    "krisp_enabled": true
  }'

Delete SIP Trunk

DELETE /sip/{sip_id} Authentication: JWT cookie (Admin) Deletes the database record and the associated LiveKit trunks/dispatch rule.
curl -X DELETE "https://api.vaani.ai/sip/sip_001" \
  -H "Cookie: access_token=YOUR_TOKEN"

Map Phone Number to Agent

PATCH /sip/{sip_id}/map-agent
curl -X PATCH "https://api.vaani.ai/sip/sip_001/map-agent" \
  -H "Content-Type: application/json" \
  -H "Cookie: access_token=YOUR_TOKEN" \
  -d '{"agent_id": "ag_550e8400"}'