Skip to main content
Pre-call initialization lets you dynamically select and configure the agent before a call starts — like Vapi’s call-init or ElevenLabs’ conversation-init. Works on all transports.

Supported Transports

TransportTriggercall.type value
Twilio voicerouting_target_type: "webhook" on phone numberinboundPhoneCall
WhatsApp voicerouting_target_type: "webhook" on phone numberinboundWhatsAppCall
WebRTCserver_url in POST /v1/webrtc/connect bodywebrtc

Setup

Phone numbers (Twilio / WhatsApp)

Bind with routing_target_type: "webhook":
curl -X POST http://localhost:8090/v1/phone-numbers \
  -H "Authorization: Bearer tc_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "e164_number": "+15551234567",
    "external_number_sid": "PNxxx",
    "routing_target_type": "webhook",
    "server_url": "https://your-server.com/turncall/init"
  }'

WebRTC

Pass server_url in requestData:
POST /v1/webrtc/connect
{
  "sdp": "v=0...",
  "type": "offer",
  "requestData": {
    "server_url": "https://your-server.com/turncall/init"
  }
}

Your Server Receives

{
  "message": {
    "type": "call-init",
    "call": {
      "id": "call-uuid",
      "provider_call_id": "CA...",
      "type": "inboundPhoneCall"
    },
    "phoneNumber": {"number": "+15551234567"},
    "customer": {"number": "+15559876543"},
    "timestamp": "2026-04-06T12:00:00Z"
  }
}

Response Options

{
  "agent_id": "agent-uuid-here"
}

Response Fields

FieldPurpose
agent_idLoad existing agent by UUID
agentInline agent config (alternative to agent_id)
variablesTemplate variables rendered into {{placeholders}} in prompts
metadataStored on call record for analytics
dynamic_data.knowledge_contextPrepended to system prompt as runtime context

What Happens

1

call.initializing webhook event fires (informational)

2

Template {{variables}} are rendered into the system prompt

3

knowledge_context is prepended to the system prompt

4

metadata is stored on the call record

5

call.started event fires

6

Pipeline starts with the resolved configuration

For persistent, searchable knowledge, use the Knowledge Base API instead of knowledge_context. Use knowledge_context for per-call dynamic data like CRM records or open tickets.