Webhooks

Handle Twilio outbound browser call

POST
/api/webhook/calls/twilio/outbound

Outbound voice webhook hit when an agent's browser device.connect() places a call. Validates the from/to numbers, creates the outbound Call record, and returns TwiML that bridges the browser leg to the PSTN destination.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/xml

application/json

curl -X POST "https://example.com/api/webhook/calls/twilio/outbound" \  -H "Content-Type: application/json" \  -d '{    "To": "+14165550100",    "From": "+12362320246",    "CallSid": "CA5f7b1c2e8a1d4e0012c3b4a5"  }'
"<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response><Dial callerId=\"+12362320246\" record=\"record-from-answer\" recordingStatusCallback=\"/api/webhook/calls/twilio/recording\" recordingStatusCallbackMethod=\"POST\" answerOnBridge=\"true\"><Number statusCallback=\"/api/webhook/calls/twilio/status\" statusCallbackMethod=\"POST\" statusCallbackEvent=\"initiated,ringing,answered,completed\" machineDetection=\"Enable\" machineDetectionTimeout=\"30\" machineDetectionSpeechThreshold=\"2400\" machineDetectionSpeechEndThreshold=\"1200\" machineDetectionSilenceTimeout=\"5000\" amdStatusCallback=\"/api/webhook/calls/twilio/amd\" amdStatusCallbackMethod=\"POST\">+14165550100</Number></Dial></Response>"