Skip to main content
Phone numbers connect your Twilio numbers to TurnCall agents. Each number can route to a specific agent or to a webhook for dynamic routing.

Bind a Phone Number

Static routing (to an agent)

curl -X POST http://localhost:8090/v1/phone-numbers \
  -H "Authorization: Bearer tc_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "external_number_sid": "PNxxxxxxxx",
    "e164_number": "+15551234567",
    "routing_target_type": "agent",
    "routing_target_id": "AGENT_UUID"
  }'

Dynamic routing (server URL)

Route calls to a webhook that decides which agent to use:
curl -X POST http://localhost:8090/v1/phone-numbers \
  -H "Authorization: Bearer tc_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "external_number_sid": "PNxxxxxxxx",
    "e164_number": "+15551234567",
    "routing_target_type": "webhook",
    "server_url": "https://your-server.com/turncall-events"
  }'
See Call Init for details on how dynamic routing works.

Configure Twilio

After binding a number in TurnCall, set the Twilio webhook URLs:
  • Voice URL: https://your-host/webhooks/twilio/voice/inbound (POST)
  • Status URL: https://your-host/webhooks/twilio/status (POST)

SMS Support

Enable SMS on a phone number to handle both voice calls and text messages:
{
  "sms_enabled": true
}
When sms_enabled: true is set on bind, TurnCall auto-configures the Twilio SMS webhook. See SMS / Chat for details.

WhatsApp Support

Enable WhatsApp on a phone number:
{
  "whatsapp_enabled": true
}
See WhatsApp for full setup instructions.