Bind a Phone Number
Static routing (to an agent)
Dynamic routing (server URL)
Route calls to a webhook that decides which agent to use:Bring your own Twilio account
A number can run on its own Twilio account instead of the platform’sTWILIO_ACCOUNT_SID / TWILIO_AUTH_TOKEN. Send the pair — both or neither —
and external_number_sid becomes optional: TurnCall looks the number up on that
account, which is also what proves the account owns it.
- Credentials that Twilio rejects, or that do not own the number, are a
422— nothing is bound. - The token is stored encrypted under
CREDENTIAL_ENCRYPTION_KEYand never returned. Reads carrytwilio_account_sidandtwilio_credentials(numberorplatform). - Every Twilio operation for that number uses its account: webhook
configuration, outbound calls, hang-up, transfer, DTMF, recording download,
and the signature check on its inbound webhooks (matched by the webhook’s
AccountSid). PUT /v1/phone-numbers/{id}with a new pair replaces it — rotating a token. Omitting the pair keeps the stored one.
With no platform Twilio account configured, an inbound webhook TurnCall cannot
verify passes only while no number carries its own account (a development
setup). Once any does, an unverifiable webhook is refused.
server_url returns a server_url_secret — TurnCall signs each call-init request with it so your endpoint can verify the source.
Update a Binding
Re-route a number in place — the phone id and itsserver_url_secret stay stable, so a call-init endpoint keeps verifying with the same secret across edits:
server_url appears on a number that never had one; it is never rotated implicitly.
Configure Twilio
TurnCall sets these on bind whenPUBLIC_BASE_URL is configured (the response
says so in twilio_webhooks_configured). To set them by hand:
- 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 is set on bind, TurnCall auto-configures the Twilio SMS webhook. See SMS / Chat for details.