This group combines protected representative API calls, phone-auth-aware audio upload, anonymous Twilio callbacks and OpenAI transcription/realtime handoff. Protected AnswerPal API endpoints use JWT Bearer authentication. The Twilio callback routes are anonymous because Twilio calls them directly.
GET /api/TwilioCalls/voice-token – Bearer JWTtwimlAppSidOverride can override the customer TwiML app SID. Response includes token, region and edge.POST /api/TwilioCalls/initiate-call – Bearer JWTfromNumber and toNumber, both normalized to +digits.GET /api/TwilioCalls/call-status – Bearer JWTcallSid. The service checks child calls first and falls back to the parent call status.POST /api/TwilioCalls/voice – Public Twilio callback<Dial> or <Connect><Stream> TwiML.POST /api/TwilioCalls/{repID}/recordingcallback – Public Twilio callbackGET /api/TwilioCalls/voice-token
Authorization: Bearer {token}
200 OK
{
"token": "twilio-jwt...",
"region": "ie1",
"edge": "dublin"
}POST /api/TwilioCalls/initiate-call
Authorization: Bearer {token}
Content-Type: application/json
{
"fromNumber": "+3225550100",
"toNumber": "+32470000000"
}fromNumber+digits.toNumber+digits.FromNumber, To, RepID, AccountSid, CallSidRecordTranslate<Connect><Stream> using configured PhoneStreamUrl before dialing.CallerLanguage, CallerVoice, ReceiverLanguage, ReceiverVoice, ForwardRawAudiorepIDcustomFrom, customToCallSid, AccountSid, RecordingSid, RecordingUrl, RecordingStartTime, RecordingDurationPOST /api/TwilioCalls/voice
Content-Type: application/x-www-form-urlencoded
FromNumber=+3225550100
To=+32470000000
RepID=42
Record=true
Translate=false
CallSid=CA...
AccountSid=AC...voice-token, initiate-call, call-status, /api/realtime/calls and /api/Transcriptions/file require a representative JWT./api/AudioChunks/uploadAndFinalize accepts either a ticket-access representative or a phone-auth context. Phone-auth requests are constrained to the token channel./api/TwilioCalls/voice and /api/TwilioCalls/{repID}/recordingcallback are anonymous Twilio callbacks. They validate Twilio Account SID, phone channel and representative ownership in application logic.GET /api/TwilioCalls/voice-token
Authorization: Bearer {token}
200 OK
{
"token": "twilio-jwt...",
"region": "ie1",
"edge": "dublin"
} POST /api/TwilioCalls/initiate-call
Authorization: Bearer {token}
Content-Type: application/json
{
"fromNumber": "+3225550100",
"toNumber": "+32470000000"
} POST /api/TwilioCalls/voice
Content-Type: application/x-www-form-urlencoded
FromNumber=+3225550100
To=+32470000000
RepID=42
Record=true
Translate=false
CallSid=CA...
AccountSid=AC... POST /api/AudioChunks/uploadAndFinalize
Authorization: Bearer {token}
Content-Type: application/json
[
{
"ticketID": 123,
"senderType": "EndUser",
"timestampMs": 0,
"base64AudioData": "/////w=="
}
] Audio and transcription endpoints handle uploaded call chunks, realtime SDP calls and standalone transcription file uploads.
POST /api/AudioChunks/uploadAndFinalize – Bearer JWT (TicketAccessOrPhoneAuth)POST /api/realtime/calls – Bearer JWTapplication/sdp.POST /api/Transcriptions/file – Bearer JWTfile and receive transcription text in { "text": "..." }. Request size limit is 1 GB.POST /api/AudioChunks/uploadAndFinalize
Authorization: Bearer {token}
Content-Type: application/json
[
{
"ticketID": 123,
"senderType": "EndUser",
"timestampMs": 0,
"base64AudioData": "/////w=="
}
]POST /api/realtime/calls
Authorization: Bearer {token}
Content-Type: multipart/form-data
sdp: application/sdp
session: application/jsonPOST /api/Transcriptions/file
Authorization: Bearer {token}
Content-Type: multipart/form-data
file: call-recording.mp3
200 OK
{ "text": "Transcribed audio text..." }fromNumber+digits.toNumber+digits.FromNumber, To, RepID, AccountSid, CallSidRecordTranslate<Connect><Stream> using configured PhoneStreamUrl before dialing.CallerLanguage, CallerVoice, ReceiverLanguage, ReceiverVoice, ForwardRawAudiorepIDcustomFrom, customToCallSid, AccountSid, RecordingSid, RecordingUrl, RecordingStartTime, RecordingDurationticketIDsenderTypeEndUser, AI or CustomerRep.timestampMsbase64AudioDatasdpapplication/sdp without filename.sessionapplication/json.filevoice-token, initiate-call, call-status, /api/realtime/calls and /api/Transcriptions/file require a representative JWT./api/AudioChunks/uploadAndFinalize accepts either a ticket-access representative or a phone-auth context. Phone-auth requests are constrained to the token channel./api/TwilioCalls/voice and /api/TwilioCalls/{repID}/recordingcallback are anonymous Twilio callbacks. They validate Twilio Account SID, phone channel and representative ownership in application logic.Related phone-auth tokens are issued by the Auth API through /api/Auth/phone-login. Phone tickets, messages, prompts, actions and attachments are documented on the Tickets and File endpoint pages.
POST /api/TwilioCalls/voice and POST /api/TwilioCalls/{repID}/recordingcallback are anonymous because Twilio calls them directly. They still validate Account SID, phone channel and representative/customer ownership.
Audio chunk payloads contain base64 mu-law audio. The API decodes 8 kHz mu-law to PCM, mixes caller and AI/representative audio into stereo, stores the recording and transcribes it when possible.
POST /api/Transcriptions/file returns { "text": "..." }. It requires the authenticated customer to have an OpenAI API key and an active transcription-capable model.
AnswerPal: AI-powered customer service solutions to elevate your support and communication effortlessly.
For all support, sales, and partnership inquiries, email us at info@answerpal.eu
AnswerPal
Bisschoppenhoflaan 380
2100 Antwerp
Belgium
+32.36416685
BE 0862.692.858