Create Phone Call
Create a new outbound phone call.
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: process.env['RETELL_API_KEY'], // This is the default and can be omitted
});
const phoneCallResponse = await client.call.createPhoneCall({
from_number: '+14157774444',
to_number: '+12137774445',
});
console.log(phoneCallResponse.agent_id);import os
from retell import Retell
client = Retell(
api_key=os.environ.get("RETELL_API_KEY"), # This is the default and can be omitted
)
phone_call_response = client.call.create_phone_call(
from_number="+14157774444",
to_number="+12137774445",
)
print(phone_call_response.agent_id)curl --request POST \
--url https://api.retellai.com/v2/create-phone-call \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"from_number": "+14157774444",
"to_number": "+12137774445",
"idempotency_key": "<string>",
"override_agent_id": "oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD",
"override_agent_version": "latest_published",
"agent_override": {
"agent": {
"response_engine": {
"type": "retell-llm",
"llm_id": "llm_234sdertfsdsfsdf",
"version": 0
},
"agent_name": "Jarvis",
"version_description": "Customer support agent for handling product inquiries",
"version_title": "Production hotfix",
"voice_id": "retell-Cimo",
"fallback_voice_ids": [
"cartesia-Cimo",
"minimax-Cimo"
],
"voice_temperature": 1,
"voice_speed": 1,
"enable_dynamic_voice_speed": true,
"enable_dynamic_responsiveness": true,
"volume": 1,
"enable_expressive_mode": true,
"expressive_emotion_tags": [
"empathetic",
"excited",
"sigh",
"clear throat",
"emphasis"
],
"expressive_mode_prompt": "Use [sigh] for thoughtful pauses and [excited] for good news.",
"responsiveness": 1,
"interruption_sensitivity": 1,
"enable_backchannel": true,
"backchannel_frequency": 0.9,
"backchannel_words": [
"yeah",
"uh-huh"
],
"reminder_trigger_ms": 10000,
"reminder_max_count": 2,
"ambient_sound_volume": 1,
"language": "en-US",
"webhook_url": "https://webhook-url-here",
"webhook_events": [],
"webhook_timeout_ms": 10000,
"boosted_keywords": [
"retell",
"kroger"
],
"contact_memory_config": {
"enable_update": true,
"enable_read": true
},
"data_storage_setting": "everything",
"data_storage_retention_days": 30,
"opt_in_signed_url": true,
"signed_url_expiration_ms": 86400000,
"pronunciation_dictionary": [
{
"word": "actually",
"alphabet": "ipa",
"phoneme": "ˈæktʃuəli"
}
],
"enable_dnc_detection": false,
"end_call_after_silence_ms": 600000,
"max_call_duration_ms": 3600000,
"voicemail_option": {
"action": {
"type": "static_text",
"text": "Please give us a callback tomorrow at 10am."
}
},
"ivr_option": {
"action": {
"type": "hangup"
}
},
"call_screening_option": {
"agent_identity": "Acme Health scheduling team",
"call_purpose": "confirming your appointment for tomorrow"
},
"post_call_analysis_data": [
{
"type": "string",
"name": "customer_name",
"description": "The name of the customer.",
"examples": [
"John Doe",
"Jane Smith"
],
"required": true,
"conditional_prompt": "<string>"
}
],
"post_call_analysis_model": "gpt-4.1-mini",
"begin_message_delay_ms": 1000,
"ring_duration_ms": 30000,
"stt_mode": "fast",
"custom_stt_config": {
"endpointing_ms": 123
},
"vocab_specialization": "general",
"allow_user_dtmf": true,
"allow_dtmf_interruption": false,
"user_dtmf_options": {
"digit_limit": 25.5,
"termination_key": "#",
"timeout_ms": 8000
},
"denoising_mode": "noise-cancellation",
"denoising_enhancement_level": 0.8,
"guardrail_config": {
"output_topics": [],
"input_topics": [
"platform_integrity_jailbreaking"
]
},
"handbook_config": {
"customer_support": {
"custom_prompt": "<string>"
},
"conversational": {
"custom_prompt": "<string>"
},
"default_personality": true,
"conversational_personality": true,
"natural_filler_words": true,
"high_empathy": true,
"echo_verification": true,
"nato_phonetic_alphabet": true,
"speech_normalization": true,
"smart_matching": true,
"ai_disclosure": true,
"scope_boundaries": true
},
"enable_colloquial_model": true,
"timezone": "America/New_York",
"pre_session_tools": [
{
"type": "integration_app",
"name": "<string>",
"app_id": "<string>",
"provider": "<string>",
"app_tool_template_name": "<string>",
"parameters": [
{
"type": "object",
"properties": {},
"required": [
"<string>"
],
"additionalProperties": true
}
],
"execution_status_variable": "<string>",
"response_variables": {
"contact_first_name": "data.first_name"
},
"output_selection": {
"mode": "all",
"fields": [
"<string>"
]
},
"description": "<string>",
"speak_during_execution": true,
"speak_after_execution": true,
"execution_message_description": "<string>",
"enable_typing_sound": true,
"depends_on": [
"<string>"
]
}
],
"post_session_tools": [
{
"type": "integration_app",
"name": "<string>",
"app_id": "<string>",
"provider": "<string>",
"app_tool_template_name": "<string>",
"parameters": [
{
"type": "object",
"properties": {},
"required": [
"<string>"
],
"additionalProperties": true
}
],
"execution_status_variable": "<string>",
"response_variables": {
"contact_first_name": "data.first_name"
},
"output_selection": {
"mode": "all",
"fields": [
"<string>"
]
},
"description": "<string>",
"speak_during_execution": true,
"speak_after_execution": true,
"execution_message_description": "<string>",
"enable_typing_sound": true,
"depends_on": [
"<string>"
]
}
]
},
"retell_llm": {
"model_config": {
"type": "cascading",
"backup": {
"kick_in_timeout_ms": 30150
},
"temperature": 0
},
"backup_model": {
"type": "cascading",
"high_priority": true,
"ultrafast": true,
"backup_kick_in_timeout": 30150
},
"model": "gpt-5.6-terra",
"s2s_model": "gpt-realtime-1.5",
"model_temperature": 0,
"model_high_priority": true,
"model_ultrafast": true,
"knowledge_base_ids": [
"<string>"
],
"kb_config": {
"top_k": 3,
"filter_score": 0.6
},
"begin_after_user_silence_ms": 2000,
"begin_message": "Hey I am a virtual assistant calling from Retell Hospital."
},
"conversation_flow": {
"model_config": {
"type": "cascading",
"backup": {
"kick_in_timeout_ms": 30150
},
"temperature": 0
},
"backup_model": {
"type": "cascading",
"high_priority": true,
"ultrafast": true,
"backup_kick_in_timeout": 30150
},
"model_choice": {
"type": "cascading",
"high_priority": true,
"ultrafast": true
},
"model_temperature": 0.7,
"knowledge_base_ids": [
"kb_001",
"kb_002"
],
"kb_config": {
"top_k": 3,
"filter_score": 0.6
},
"start_speaker": "agent",
"begin_after_user_silence_ms": 2000
}
},
"metadata": {},
"retell_llm_dynamic_variables": {
"customer_name": "John Doe"
},
"custom_sip_headers": {
"X-Custom-Header": "Custom Value"
},
"ignore_e164_validation": true,
"honor_internal_dnc": true
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.retellai.com/v2/create-phone-call",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'from_number' => '+14157774444',
'to_number' => '+12137774445',
'idempotency_key' => '<string>',
'override_agent_id' => 'oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD',
'override_agent_version' => 'latest_published',
'agent_override' => [
'agent' => [
'response_engine' => [
'type' => 'retell-llm',
'llm_id' => 'llm_234sdertfsdsfsdf',
'version' => 0
],
'agent_name' => 'Jarvis',
'version_description' => 'Customer support agent for handling product inquiries',
'version_title' => 'Production hotfix',
'voice_id' => 'retell-Cimo',
'fallback_voice_ids' => [
'cartesia-Cimo',
'minimax-Cimo'
],
'voice_temperature' => 1,
'voice_speed' => 1,
'enable_dynamic_voice_speed' => true,
'enable_dynamic_responsiveness' => true,
'volume' => 1,
'enable_expressive_mode' => true,
'expressive_emotion_tags' => [
'empathetic',
'excited',
'sigh',
'clear throat',
'emphasis'
],
'expressive_mode_prompt' => 'Use [sigh] for thoughtful pauses and [excited] for good news.',
'responsiveness' => 1,
'interruption_sensitivity' => 1,
'enable_backchannel' => true,
'backchannel_frequency' => 0.9,
'backchannel_words' => [
'yeah',
'uh-huh'
],
'reminder_trigger_ms' => 10000,
'reminder_max_count' => 2,
'ambient_sound_volume' => 1,
'language' => 'en-US',
'webhook_url' => 'https://webhook-url-here',
'webhook_events' => [
],
'webhook_timeout_ms' => 10000,
'boosted_keywords' => [
'retell',
'kroger'
],
'contact_memory_config' => [
'enable_update' => true,
'enable_read' => true
],
'data_storage_setting' => 'everything',
'data_storage_retention_days' => 30,
'opt_in_signed_url' => true,
'signed_url_expiration_ms' => 86400000,
'pronunciation_dictionary' => [
[
'word' => 'actually',
'alphabet' => 'ipa',
'phoneme' => 'ˈæktʃuəli'
]
],
'enable_dnc_detection' => false,
'end_call_after_silence_ms' => 600000,
'max_call_duration_ms' => 3600000,
'voicemail_option' => [
'action' => [
'type' => 'static_text',
'text' => 'Please give us a callback tomorrow at 10am.'
]
],
'ivr_option' => [
'action' => [
'type' => 'hangup'
]
],
'call_screening_option' => [
'agent_identity' => 'Acme Health scheduling team',
'call_purpose' => 'confirming your appointment for tomorrow'
],
'post_call_analysis_data' => [
[
'type' => 'string',
'name' => 'customer_name',
'description' => 'The name of the customer.',
'examples' => [
'John Doe',
'Jane Smith'
],
'required' => true,
'conditional_prompt' => '<string>'
]
],
'post_call_analysis_model' => 'gpt-4.1-mini',
'begin_message_delay_ms' => 1000,
'ring_duration_ms' => 30000,
'stt_mode' => 'fast',
'custom_stt_config' => [
'endpointing_ms' => 123
],
'vocab_specialization' => 'general',
'allow_user_dtmf' => true,
'allow_dtmf_interruption' => false,
'user_dtmf_options' => [
'digit_limit' => 25.5,
'termination_key' => '#',
'timeout_ms' => 8000
],
'denoising_mode' => 'noise-cancellation',
'denoising_enhancement_level' => 0.8,
'guardrail_config' => [
'output_topics' => [
],
'input_topics' => [
'platform_integrity_jailbreaking'
]
],
'handbook_config' => [
'customer_support' => [
'custom_prompt' => '<string>'
],
'conversational' => [
'custom_prompt' => '<string>'
],
'default_personality' => true,
'conversational_personality' => true,
'natural_filler_words' => true,
'high_empathy' => true,
'echo_verification' => true,
'nato_phonetic_alphabet' => true,
'speech_normalization' => true,
'smart_matching' => true,
'ai_disclosure' => true,
'scope_boundaries' => true
],
'enable_colloquial_model' => true,
'timezone' => 'America/New_York',
'pre_session_tools' => [
[
'type' => 'integration_app',
'name' => '<string>',
'app_id' => '<string>',
'provider' => '<string>',
'app_tool_template_name' => '<string>',
'parameters' => [
[
'type' => 'object',
'properties' => [
],
'required' => [
'<string>'
],
'additionalProperties' => true
]
],
'execution_status_variable' => '<string>',
'response_variables' => [
'contact_first_name' => 'data.first_name'
],
'output_selection' => [
'mode' => 'all',
'fields' => [
'<string>'
]
],
'description' => '<string>',
'speak_during_execution' => true,
'speak_after_execution' => true,
'execution_message_description' => '<string>',
'enable_typing_sound' => true,
'depends_on' => [
'<string>'
]
]
],
'post_session_tools' => [
[
'type' => 'integration_app',
'name' => '<string>',
'app_id' => '<string>',
'provider' => '<string>',
'app_tool_template_name' => '<string>',
'parameters' => [
[
'type' => 'object',
'properties' => [
],
'required' => [
'<string>'
],
'additionalProperties' => true
]
],
'execution_status_variable' => '<string>',
'response_variables' => [
'contact_first_name' => 'data.first_name'
],
'output_selection' => [
'mode' => 'all',
'fields' => [
'<string>'
]
],
'description' => '<string>',
'speak_during_execution' => true,
'speak_after_execution' => true,
'execution_message_description' => '<string>',
'enable_typing_sound' => true,
'depends_on' => [
'<string>'
]
]
]
],
'retell_llm' => [
'model_config' => [
'type' => 'cascading',
'backup' => [
'kick_in_timeout_ms' => 30150
],
'temperature' => 0
],
'backup_model' => [
'type' => 'cascading',
'high_priority' => true,
'ultrafast' => true,
'backup_kick_in_timeout' => 30150
],
'model' => 'gpt-5.6-terra',
's2s_model' => 'gpt-realtime-1.5',
'model_temperature' => 0,
'model_high_priority' => true,
'model_ultrafast' => true,
'knowledge_base_ids' => [
'<string>'
],
'kb_config' => [
'top_k' => 3,
'filter_score' => 0.6
],
'begin_after_user_silence_ms' => 2000,
'begin_message' => 'Hey I am a virtual assistant calling from Retell Hospital.'
],
'conversation_flow' => [
'model_config' => [
'type' => 'cascading',
'backup' => [
'kick_in_timeout_ms' => 30150
],
'temperature' => 0
],
'backup_model' => [
'type' => 'cascading',
'high_priority' => true,
'ultrafast' => true,
'backup_kick_in_timeout' => 30150
],
'model_choice' => [
'type' => 'cascading',
'high_priority' => true,
'ultrafast' => true
],
'model_temperature' => 0.7,
'knowledge_base_ids' => [
'kb_001',
'kb_002'
],
'kb_config' => [
'top_k' => 3,
'filter_score' => 0.6
],
'start_speaker' => 'agent',
'begin_after_user_silence_ms' => 2000
]
],
'metadata' => [
],
'retell_llm_dynamic_variables' => [
'customer_name' => 'John Doe'
],
'custom_sip_headers' => [
'X-Custom-Header' => 'Custom Value'
],
'ignore_e164_validation' => true,
'honor_internal_dnc' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.retellai.com/v2/create-phone-call"
payload := strings.NewReader("{\n \"from_number\": \"+14157774444\",\n \"to_number\": \"+12137774445\",\n \"idempotency_key\": \"<string>\",\n \"override_agent_id\": \"oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD\",\n \"override_agent_version\": \"latest_published\",\n \"agent_override\": {\n \"agent\": {\n \"response_engine\": {\n \"type\": \"retell-llm\",\n \"llm_id\": \"llm_234sdertfsdsfsdf\",\n \"version\": 0\n },\n \"agent_name\": \"Jarvis\",\n \"version_description\": \"Customer support agent for handling product inquiries\",\n \"version_title\": \"Production hotfix\",\n \"voice_id\": \"retell-Cimo\",\n \"fallback_voice_ids\": [\n \"cartesia-Cimo\",\n \"minimax-Cimo\"\n ],\n \"voice_temperature\": 1,\n \"voice_speed\": 1,\n \"enable_dynamic_voice_speed\": true,\n \"enable_dynamic_responsiveness\": true,\n \"volume\": 1,\n \"enable_expressive_mode\": true,\n \"expressive_emotion_tags\": [\n \"empathetic\",\n \"excited\",\n \"sigh\",\n \"clear throat\",\n \"emphasis\"\n ],\n \"expressive_mode_prompt\": \"Use [sigh] for thoughtful pauses and [excited] for good news.\",\n \"responsiveness\": 1,\n \"interruption_sensitivity\": 1,\n \"enable_backchannel\": true,\n \"backchannel_frequency\": 0.9,\n \"backchannel_words\": [\n \"yeah\",\n \"uh-huh\"\n ],\n \"reminder_trigger_ms\": 10000,\n \"reminder_max_count\": 2,\n \"ambient_sound_volume\": 1,\n \"language\": \"en-US\",\n \"webhook_url\": \"https://webhook-url-here\",\n \"webhook_events\": [],\n \"webhook_timeout_ms\": 10000,\n \"boosted_keywords\": [\n \"retell\",\n \"kroger\"\n ],\n \"contact_memory_config\": {\n \"enable_update\": true,\n \"enable_read\": true\n },\n \"data_storage_setting\": \"everything\",\n \"data_storage_retention_days\": 30,\n \"opt_in_signed_url\": true,\n \"signed_url_expiration_ms\": 86400000,\n \"pronunciation_dictionary\": [\n {\n \"word\": \"actually\",\n \"alphabet\": \"ipa\",\n \"phoneme\": \"ˈæktʃuəli\"\n }\n ],\n \"enable_dnc_detection\": false,\n \"end_call_after_silence_ms\": 600000,\n \"max_call_duration_ms\": 3600000,\n \"voicemail_option\": {\n \"action\": {\n \"type\": \"static_text\",\n \"text\": \"Please give us a callback tomorrow at 10am.\"\n }\n },\n \"ivr_option\": {\n \"action\": {\n \"type\": \"hangup\"\n }\n },\n \"call_screening_option\": {\n \"agent_identity\": \"Acme Health scheduling team\",\n \"call_purpose\": \"confirming your appointment for tomorrow\"\n },\n \"post_call_analysis_data\": [\n {\n \"type\": \"string\",\n \"name\": \"customer_name\",\n \"description\": \"The name of the customer.\",\n \"examples\": [\n \"John Doe\",\n \"Jane Smith\"\n ],\n \"required\": true,\n \"conditional_prompt\": \"<string>\"\n }\n ],\n \"post_call_analysis_model\": \"gpt-4.1-mini\",\n \"begin_message_delay_ms\": 1000,\n \"ring_duration_ms\": 30000,\n \"stt_mode\": \"fast\",\n \"custom_stt_config\": {\n \"endpointing_ms\": 123\n },\n \"vocab_specialization\": \"general\",\n \"allow_user_dtmf\": true,\n \"allow_dtmf_interruption\": false,\n \"user_dtmf_options\": {\n \"digit_limit\": 25.5,\n \"termination_key\": \"#\",\n \"timeout_ms\": 8000\n },\n \"denoising_mode\": \"noise-cancellation\",\n \"denoising_enhancement_level\": 0.8,\n \"guardrail_config\": {\n \"output_topics\": [],\n \"input_topics\": [\n \"platform_integrity_jailbreaking\"\n ]\n },\n \"handbook_config\": {\n \"customer_support\": {\n \"custom_prompt\": \"<string>\"\n },\n \"conversational\": {\n \"custom_prompt\": \"<string>\"\n },\n \"default_personality\": true,\n \"conversational_personality\": true,\n \"natural_filler_words\": true,\n \"high_empathy\": true,\n \"echo_verification\": true,\n \"nato_phonetic_alphabet\": true,\n \"speech_normalization\": true,\n \"smart_matching\": true,\n \"ai_disclosure\": true,\n \"scope_boundaries\": true\n },\n \"enable_colloquial_model\": true,\n \"timezone\": \"America/New_York\",\n \"pre_session_tools\": [\n {\n \"type\": \"integration_app\",\n \"name\": \"<string>\",\n \"app_id\": \"<string>\",\n \"provider\": \"<string>\",\n \"app_tool_template_name\": \"<string>\",\n \"parameters\": [\n {\n \"type\": \"object\",\n \"properties\": {},\n \"required\": [\n \"<string>\"\n ],\n \"additionalProperties\": true\n }\n ],\n \"execution_status_variable\": \"<string>\",\n \"response_variables\": {\n \"contact_first_name\": \"data.first_name\"\n },\n \"output_selection\": {\n \"mode\": \"all\",\n \"fields\": [\n \"<string>\"\n ]\n },\n \"description\": \"<string>\",\n \"speak_during_execution\": true,\n \"speak_after_execution\": true,\n \"execution_message_description\": \"<string>\",\n \"enable_typing_sound\": true,\n \"depends_on\": [\n \"<string>\"\n ]\n }\n ],\n \"post_session_tools\": [\n {\n \"type\": \"integration_app\",\n \"name\": \"<string>\",\n \"app_id\": \"<string>\",\n \"provider\": \"<string>\",\n \"app_tool_template_name\": \"<string>\",\n \"parameters\": [\n {\n \"type\": \"object\",\n \"properties\": {},\n \"required\": [\n \"<string>\"\n ],\n \"additionalProperties\": true\n }\n ],\n \"execution_status_variable\": \"<string>\",\n \"response_variables\": {\n \"contact_first_name\": \"data.first_name\"\n },\n \"output_selection\": {\n \"mode\": \"all\",\n \"fields\": [\n \"<string>\"\n ]\n },\n \"description\": \"<string>\",\n \"speak_during_execution\": true,\n \"speak_after_execution\": true,\n \"execution_message_description\": \"<string>\",\n \"enable_typing_sound\": true,\n \"depends_on\": [\n \"<string>\"\n ]\n }\n ]\n },\n \"retell_llm\": {\n \"model_config\": {\n \"type\": \"cascading\",\n \"backup\": {\n \"kick_in_timeout_ms\": 30150\n },\n \"temperature\": 0\n },\n \"backup_model\": {\n \"type\": \"cascading\",\n \"high_priority\": true,\n \"ultrafast\": true,\n \"backup_kick_in_timeout\": 30150\n },\n \"model\": \"gpt-5.6-terra\",\n \"s2s_model\": \"gpt-realtime-1.5\",\n \"model_temperature\": 0,\n \"model_high_priority\": true,\n \"model_ultrafast\": true,\n \"knowledge_base_ids\": [\n \"<string>\"\n ],\n \"kb_config\": {\n \"top_k\": 3,\n \"filter_score\": 0.6\n },\n \"begin_after_user_silence_ms\": 2000,\n \"begin_message\": \"Hey I am a virtual assistant calling from Retell Hospital.\"\n },\n \"conversation_flow\": {\n \"model_config\": {\n \"type\": \"cascading\",\n \"backup\": {\n \"kick_in_timeout_ms\": 30150\n },\n \"temperature\": 0\n },\n \"backup_model\": {\n \"type\": \"cascading\",\n \"high_priority\": true,\n \"ultrafast\": true,\n \"backup_kick_in_timeout\": 30150\n },\n \"model_choice\": {\n \"type\": \"cascading\",\n \"high_priority\": true,\n \"ultrafast\": true\n },\n \"model_temperature\": 0.7,\n \"knowledge_base_ids\": [\n \"kb_001\",\n \"kb_002\"\n ],\n \"kb_config\": {\n \"top_k\": 3,\n \"filter_score\": 0.6\n },\n \"start_speaker\": \"agent\",\n \"begin_after_user_silence_ms\": 2000\n }\n },\n \"metadata\": {},\n \"retell_llm_dynamic_variables\": {\n \"customer_name\": \"John Doe\"\n },\n \"custom_sip_headers\": {\n \"X-Custom-Header\": \"Custom Value\"\n },\n \"ignore_e164_validation\": true,\n \"honor_internal_dnc\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.retellai.com/v2/create-phone-call")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"from_number\": \"+14157774444\",\n \"to_number\": \"+12137774445\",\n \"idempotency_key\": \"<string>\",\n \"override_agent_id\": \"oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD\",\n \"override_agent_version\": \"latest_published\",\n \"agent_override\": {\n \"agent\": {\n \"response_engine\": {\n \"type\": \"retell-llm\",\n \"llm_id\": \"llm_234sdertfsdsfsdf\",\n \"version\": 0\n },\n \"agent_name\": \"Jarvis\",\n \"version_description\": \"Customer support agent for handling product inquiries\",\n \"version_title\": \"Production hotfix\",\n \"voice_id\": \"retell-Cimo\",\n \"fallback_voice_ids\": [\n \"cartesia-Cimo\",\n \"minimax-Cimo\"\n ],\n \"voice_temperature\": 1,\n \"voice_speed\": 1,\n \"enable_dynamic_voice_speed\": true,\n \"enable_dynamic_responsiveness\": true,\n \"volume\": 1,\n \"enable_expressive_mode\": true,\n \"expressive_emotion_tags\": [\n \"empathetic\",\n \"excited\",\n \"sigh\",\n \"clear throat\",\n \"emphasis\"\n ],\n \"expressive_mode_prompt\": \"Use [sigh] for thoughtful pauses and [excited] for good news.\",\n \"responsiveness\": 1,\n \"interruption_sensitivity\": 1,\n \"enable_backchannel\": true,\n \"backchannel_frequency\": 0.9,\n \"backchannel_words\": [\n \"yeah\",\n \"uh-huh\"\n ],\n \"reminder_trigger_ms\": 10000,\n \"reminder_max_count\": 2,\n \"ambient_sound_volume\": 1,\n \"language\": \"en-US\",\n \"webhook_url\": \"https://webhook-url-here\",\n \"webhook_events\": [],\n \"webhook_timeout_ms\": 10000,\n \"boosted_keywords\": [\n \"retell\",\n \"kroger\"\n ],\n \"contact_memory_config\": {\n \"enable_update\": true,\n \"enable_read\": true\n },\n \"data_storage_setting\": \"everything\",\n \"data_storage_retention_days\": 30,\n \"opt_in_signed_url\": true,\n \"signed_url_expiration_ms\": 86400000,\n \"pronunciation_dictionary\": [\n {\n \"word\": \"actually\",\n \"alphabet\": \"ipa\",\n \"phoneme\": \"ˈæktʃuəli\"\n }\n ],\n \"enable_dnc_detection\": false,\n \"end_call_after_silence_ms\": 600000,\n \"max_call_duration_ms\": 3600000,\n \"voicemail_option\": {\n \"action\": {\n \"type\": \"static_text\",\n \"text\": \"Please give us a callback tomorrow at 10am.\"\n }\n },\n \"ivr_option\": {\n \"action\": {\n \"type\": \"hangup\"\n }\n },\n \"call_screening_option\": {\n \"agent_identity\": \"Acme Health scheduling team\",\n \"call_purpose\": \"confirming your appointment for tomorrow\"\n },\n \"post_call_analysis_data\": [\n {\n \"type\": \"string\",\n \"name\": \"customer_name\",\n \"description\": \"The name of the customer.\",\n \"examples\": [\n \"John Doe\",\n \"Jane Smith\"\n ],\n \"required\": true,\n \"conditional_prompt\": \"<string>\"\n }\n ],\n \"post_call_analysis_model\": \"gpt-4.1-mini\",\n \"begin_message_delay_ms\": 1000,\n \"ring_duration_ms\": 30000,\n \"stt_mode\": \"fast\",\n \"custom_stt_config\": {\n \"endpointing_ms\": 123\n },\n \"vocab_specialization\": \"general\",\n \"allow_user_dtmf\": true,\n \"allow_dtmf_interruption\": false,\n \"user_dtmf_options\": {\n \"digit_limit\": 25.5,\n \"termination_key\": \"#\",\n \"timeout_ms\": 8000\n },\n \"denoising_mode\": \"noise-cancellation\",\n \"denoising_enhancement_level\": 0.8,\n \"guardrail_config\": {\n \"output_topics\": [],\n \"input_topics\": [\n \"platform_integrity_jailbreaking\"\n ]\n },\n \"handbook_config\": {\n \"customer_support\": {\n \"custom_prompt\": \"<string>\"\n },\n \"conversational\": {\n \"custom_prompt\": \"<string>\"\n },\n \"default_personality\": true,\n \"conversational_personality\": true,\n \"natural_filler_words\": true,\n \"high_empathy\": true,\n \"echo_verification\": true,\n \"nato_phonetic_alphabet\": true,\n \"speech_normalization\": true,\n \"smart_matching\": true,\n \"ai_disclosure\": true,\n \"scope_boundaries\": true\n },\n \"enable_colloquial_model\": true,\n \"timezone\": \"America/New_York\",\n \"pre_session_tools\": [\n {\n \"type\": \"integration_app\",\n \"name\": \"<string>\",\n \"app_id\": \"<string>\",\n \"provider\": \"<string>\",\n \"app_tool_template_name\": \"<string>\",\n \"parameters\": [\n {\n \"type\": \"object\",\n \"properties\": {},\n \"required\": [\n \"<string>\"\n ],\n \"additionalProperties\": true\n }\n ],\n \"execution_status_variable\": \"<string>\",\n \"response_variables\": {\n \"contact_first_name\": \"data.first_name\"\n },\n \"output_selection\": {\n \"mode\": \"all\",\n \"fields\": [\n \"<string>\"\n ]\n },\n \"description\": \"<string>\",\n \"speak_during_execution\": true,\n \"speak_after_execution\": true,\n \"execution_message_description\": \"<string>\",\n \"enable_typing_sound\": true,\n \"depends_on\": [\n \"<string>\"\n ]\n }\n ],\n \"post_session_tools\": [\n {\n \"type\": \"integration_app\",\n \"name\": \"<string>\",\n \"app_id\": \"<string>\",\n \"provider\": \"<string>\",\n \"app_tool_template_name\": \"<string>\",\n \"parameters\": [\n {\n \"type\": \"object\",\n \"properties\": {},\n \"required\": [\n \"<string>\"\n ],\n \"additionalProperties\": true\n }\n ],\n \"execution_status_variable\": \"<string>\",\n \"response_variables\": {\n \"contact_first_name\": \"data.first_name\"\n },\n \"output_selection\": {\n \"mode\": \"all\",\n \"fields\": [\n \"<string>\"\n ]\n },\n \"description\": \"<string>\",\n \"speak_during_execution\": true,\n \"speak_after_execution\": true,\n \"execution_message_description\": \"<string>\",\n \"enable_typing_sound\": true,\n \"depends_on\": [\n \"<string>\"\n ]\n }\n ]\n },\n \"retell_llm\": {\n \"model_config\": {\n \"type\": \"cascading\",\n \"backup\": {\n \"kick_in_timeout_ms\": 30150\n },\n \"temperature\": 0\n },\n \"backup_model\": {\n \"type\": \"cascading\",\n \"high_priority\": true,\n \"ultrafast\": true,\n \"backup_kick_in_timeout\": 30150\n },\n \"model\": \"gpt-5.6-terra\",\n \"s2s_model\": \"gpt-realtime-1.5\",\n \"model_temperature\": 0,\n \"model_high_priority\": true,\n \"model_ultrafast\": true,\n \"knowledge_base_ids\": [\n \"<string>\"\n ],\n \"kb_config\": {\n \"top_k\": 3,\n \"filter_score\": 0.6\n },\n \"begin_after_user_silence_ms\": 2000,\n \"begin_message\": \"Hey I am a virtual assistant calling from Retell Hospital.\"\n },\n \"conversation_flow\": {\n \"model_config\": {\n \"type\": \"cascading\",\n \"backup\": {\n \"kick_in_timeout_ms\": 30150\n },\n \"temperature\": 0\n },\n \"backup_model\": {\n \"type\": \"cascading\",\n \"high_priority\": true,\n \"ultrafast\": true,\n \"backup_kick_in_timeout\": 30150\n },\n \"model_choice\": {\n \"type\": \"cascading\",\n \"high_priority\": true,\n \"ultrafast\": true\n },\n \"model_temperature\": 0.7,\n \"knowledge_base_ids\": [\n \"kb_001\",\n \"kb_002\"\n ],\n \"kb_config\": {\n \"top_k\": 3,\n \"filter_score\": 0.6\n },\n \"start_speaker\": \"agent\",\n \"begin_after_user_silence_ms\": 2000\n }\n },\n \"metadata\": {},\n \"retell_llm_dynamic_variables\": {\n \"customer_name\": \"John Doe\"\n },\n \"custom_sip_headers\": {\n \"X-Custom-Header\": \"Custom Value\"\n },\n \"ignore_e164_validation\": true,\n \"honor_internal_dnc\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.retellai.com/v2/create-phone-call")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"from_number\": \"+14157774444\",\n \"to_number\": \"+12137774445\",\n \"idempotency_key\": \"<string>\",\n \"override_agent_id\": \"oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD\",\n \"override_agent_version\": \"latest_published\",\n \"agent_override\": {\n \"agent\": {\n \"response_engine\": {\n \"type\": \"retell-llm\",\n \"llm_id\": \"llm_234sdertfsdsfsdf\",\n \"version\": 0\n },\n \"agent_name\": \"Jarvis\",\n \"version_description\": \"Customer support agent for handling product inquiries\",\n \"version_title\": \"Production hotfix\",\n \"voice_id\": \"retell-Cimo\",\n \"fallback_voice_ids\": [\n \"cartesia-Cimo\",\n \"minimax-Cimo\"\n ],\n \"voice_temperature\": 1,\n \"voice_speed\": 1,\n \"enable_dynamic_voice_speed\": true,\n \"enable_dynamic_responsiveness\": true,\n \"volume\": 1,\n \"enable_expressive_mode\": true,\n \"expressive_emotion_tags\": [\n \"empathetic\",\n \"excited\",\n \"sigh\",\n \"clear throat\",\n \"emphasis\"\n ],\n \"expressive_mode_prompt\": \"Use [sigh] for thoughtful pauses and [excited] for good news.\",\n \"responsiveness\": 1,\n \"interruption_sensitivity\": 1,\n \"enable_backchannel\": true,\n \"backchannel_frequency\": 0.9,\n \"backchannel_words\": [\n \"yeah\",\n \"uh-huh\"\n ],\n \"reminder_trigger_ms\": 10000,\n \"reminder_max_count\": 2,\n \"ambient_sound_volume\": 1,\n \"language\": \"en-US\",\n \"webhook_url\": \"https://webhook-url-here\",\n \"webhook_events\": [],\n \"webhook_timeout_ms\": 10000,\n \"boosted_keywords\": [\n \"retell\",\n \"kroger\"\n ],\n \"contact_memory_config\": {\n \"enable_update\": true,\n \"enable_read\": true\n },\n \"data_storage_setting\": \"everything\",\n \"data_storage_retention_days\": 30,\n \"opt_in_signed_url\": true,\n \"signed_url_expiration_ms\": 86400000,\n \"pronunciation_dictionary\": [\n {\n \"word\": \"actually\",\n \"alphabet\": \"ipa\",\n \"phoneme\": \"ˈæktʃuəli\"\n }\n ],\n \"enable_dnc_detection\": false,\n \"end_call_after_silence_ms\": 600000,\n \"max_call_duration_ms\": 3600000,\n \"voicemail_option\": {\n \"action\": {\n \"type\": \"static_text\",\n \"text\": \"Please give us a callback tomorrow at 10am.\"\n }\n },\n \"ivr_option\": {\n \"action\": {\n \"type\": \"hangup\"\n }\n },\n \"call_screening_option\": {\n \"agent_identity\": \"Acme Health scheduling team\",\n \"call_purpose\": \"confirming your appointment for tomorrow\"\n },\n \"post_call_analysis_data\": [\n {\n \"type\": \"string\",\n \"name\": \"customer_name\",\n \"description\": \"The name of the customer.\",\n \"examples\": [\n \"John Doe\",\n \"Jane Smith\"\n ],\n \"required\": true,\n \"conditional_prompt\": \"<string>\"\n }\n ],\n \"post_call_analysis_model\": \"gpt-4.1-mini\",\n \"begin_message_delay_ms\": 1000,\n \"ring_duration_ms\": 30000,\n \"stt_mode\": \"fast\",\n \"custom_stt_config\": {\n \"endpointing_ms\": 123\n },\n \"vocab_specialization\": \"general\",\n \"allow_user_dtmf\": true,\n \"allow_dtmf_interruption\": false,\n \"user_dtmf_options\": {\n \"digit_limit\": 25.5,\n \"termination_key\": \"#\",\n \"timeout_ms\": 8000\n },\n \"denoising_mode\": \"noise-cancellation\",\n \"denoising_enhancement_level\": 0.8,\n \"guardrail_config\": {\n \"output_topics\": [],\n \"input_topics\": [\n \"platform_integrity_jailbreaking\"\n ]\n },\n \"handbook_config\": {\n \"customer_support\": {\n \"custom_prompt\": \"<string>\"\n },\n \"conversational\": {\n \"custom_prompt\": \"<string>\"\n },\n \"default_personality\": true,\n \"conversational_personality\": true,\n \"natural_filler_words\": true,\n \"high_empathy\": true,\n \"echo_verification\": true,\n \"nato_phonetic_alphabet\": true,\n \"speech_normalization\": true,\n \"smart_matching\": true,\n \"ai_disclosure\": true,\n \"scope_boundaries\": true\n },\n \"enable_colloquial_model\": true,\n \"timezone\": \"America/New_York\",\n \"pre_session_tools\": [\n {\n \"type\": \"integration_app\",\n \"name\": \"<string>\",\n \"app_id\": \"<string>\",\n \"provider\": \"<string>\",\n \"app_tool_template_name\": \"<string>\",\n \"parameters\": [\n {\n \"type\": \"object\",\n \"properties\": {},\n \"required\": [\n \"<string>\"\n ],\n \"additionalProperties\": true\n }\n ],\n \"execution_status_variable\": \"<string>\",\n \"response_variables\": {\n \"contact_first_name\": \"data.first_name\"\n },\n \"output_selection\": {\n \"mode\": \"all\",\n \"fields\": [\n \"<string>\"\n ]\n },\n \"description\": \"<string>\",\n \"speak_during_execution\": true,\n \"speak_after_execution\": true,\n \"execution_message_description\": \"<string>\",\n \"enable_typing_sound\": true,\n \"depends_on\": [\n \"<string>\"\n ]\n }\n ],\n \"post_session_tools\": [\n {\n \"type\": \"integration_app\",\n \"name\": \"<string>\",\n \"app_id\": \"<string>\",\n \"provider\": \"<string>\",\n \"app_tool_template_name\": \"<string>\",\n \"parameters\": [\n {\n \"type\": \"object\",\n \"properties\": {},\n \"required\": [\n \"<string>\"\n ],\n \"additionalProperties\": true\n }\n ],\n \"execution_status_variable\": \"<string>\",\n \"response_variables\": {\n \"contact_first_name\": \"data.first_name\"\n },\n \"output_selection\": {\n \"mode\": \"all\",\n \"fields\": [\n \"<string>\"\n ]\n },\n \"description\": \"<string>\",\n \"speak_during_execution\": true,\n \"speak_after_execution\": true,\n \"execution_message_description\": \"<string>\",\n \"enable_typing_sound\": true,\n \"depends_on\": [\n \"<string>\"\n ]\n }\n ]\n },\n \"retell_llm\": {\n \"model_config\": {\n \"type\": \"cascading\",\n \"backup\": {\n \"kick_in_timeout_ms\": 30150\n },\n \"temperature\": 0\n },\n \"backup_model\": {\n \"type\": \"cascading\",\n \"high_priority\": true,\n \"ultrafast\": true,\n \"backup_kick_in_timeout\": 30150\n },\n \"model\": \"gpt-5.6-terra\",\n \"s2s_model\": \"gpt-realtime-1.5\",\n \"model_temperature\": 0,\n \"model_high_priority\": true,\n \"model_ultrafast\": true,\n \"knowledge_base_ids\": [\n \"<string>\"\n ],\n \"kb_config\": {\n \"top_k\": 3,\n \"filter_score\": 0.6\n },\n \"begin_after_user_silence_ms\": 2000,\n \"begin_message\": \"Hey I am a virtual assistant calling from Retell Hospital.\"\n },\n \"conversation_flow\": {\n \"model_config\": {\n \"type\": \"cascading\",\n \"backup\": {\n \"kick_in_timeout_ms\": 30150\n },\n \"temperature\": 0\n },\n \"backup_model\": {\n \"type\": \"cascading\",\n \"high_priority\": true,\n \"ultrafast\": true,\n \"backup_kick_in_timeout\": 30150\n },\n \"model_choice\": {\n \"type\": \"cascading\",\n \"high_priority\": true,\n \"ultrafast\": true\n },\n \"model_temperature\": 0.7,\n \"knowledge_base_ids\": [\n \"kb_001\",\n \"kb_002\"\n ],\n \"kb_config\": {\n \"top_k\": 3,\n \"filter_score\": 0.6\n },\n \"start_speaker\": \"agent\",\n \"begin_after_user_silence_ms\": 2000\n }\n },\n \"metadata\": {},\n \"retell_llm_dynamic_variables\": {\n \"customer_name\": \"John Doe\"\n },\n \"custom_sip_headers\": {\n \"X-Custom-Header\": \"Custom Value\"\n },\n \"ignore_e164_validation\": true,\n \"honor_internal_dnc\": true\n}"
response = http.request(request)
puts response.read_body{
"call_type": "phone_call",
"from_number": "+12137771234",
"to_number": "+12137771235",
"direction": "inbound",
"call_id": "Jabr9TXYYJHfvl6Syypi88rdAHYHmcq6",
"agent_id": "oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD",
"agent_version": 1,
"call_status": "registered",
"telephony_identifier": {
"twilio_call_sid": "CA5d0d0d8047bf685c3f0ff980fe62c123"
},
"agent_name": "My Agent",
"agent_tag": "prod",
"metadata": {},
"retell_llm_dynamic_variables": {
"customer_name": "John Doe"
},
"collected_dynamic_variables": {
"last_node_name": "Test node"
},
"custom_sip_headers": {
"X-Custom-Header": "Custom Value"
},
"data_storage_setting": "everything",
"opt_in_signed_url": true,
"start_timestamp": 1703302407333,
"end_timestamp": 1703302428855,
"transfer_end_timestamp": 1703302628855,
"duration_ms": 10000,
"transcript": "Agent: hi how are you doing?\nUser: Doing pretty well. How are you?\nAgent: That's great to hear! I'm doing well too, thanks! What's up?\nUser: I don't have anything in particular.\nAgent: Got it, just checking in!\nUser: Alright. See you.\nAgent: have a nice day\n",
"transcript_object": [
{
"role": "agent",
"content": "hi how are you doing?",
"words": [
{
"word": "hi",
"start": 0.7,
"end": 1.3
}
],
"metadata": {
"response_id": 123,
"interrupt_id": 123,
"is_backchannel": true,
"interrupted": true,
"backup_model_used": {
"model": "<string>",
"primary_model": "<string>",
"backup_model": "<string>",
"reason": "primary_failed",
"selection_latency_ms": 123,
"primary_ready_ms": 123,
"backup_ready_ms": 123
}
}
}
],
"transcript_with_tool_calls": [
{
"role": "agent",
"content": "hi how are you doing?",
"words": [
{
"word": "hi",
"start": 0.7,
"end": 1.3
}
],
"metadata": {
"response_id": 123,
"interrupt_id": 123,
"is_backchannel": true,
"interrupted": true,
"backup_model_used": {
"model": "<string>",
"primary_model": "<string>",
"backup_model": "<string>",
"reason": "primary_failed",
"selection_latency_ms": 123,
"primary_ready_ms": 123,
"backup_ready_ms": 123
}
}
}
],
"scrubbed_transcript_with_tool_calls": [
{
"role": "agent",
"content": "hi how are you doing?",
"words": [
{
"word": "hi",
"start": 0.7,
"end": 1.3
}
],
"metadata": {
"response_id": 123,
"interrupt_id": 123,
"is_backchannel": true,
"interrupted": true,
"backup_model_used": {
"model": "<string>",
"primary_model": "<string>",
"backup_model": "<string>",
"reason": "primary_failed",
"selection_latency_ms": 123,
"primary_ready_ms": 123,
"backup_ready_ms": 123
}
}
}
],
"pre_session_transcript_with_tool_calls": [
{
"role": "agent",
"content": "hi how are you doing?",
"words": [
{
"word": "hi",
"start": 0.7,
"end": 1.3
}
],
"metadata": {
"response_id": 123,
"interrupt_id": 123,
"is_backchannel": true,
"interrupted": true,
"backup_model_used": {
"model": "<string>",
"primary_model": "<string>",
"backup_model": "<string>",
"reason": "primary_failed",
"selection_latency_ms": 123,
"primary_ready_ms": 123,
"backup_ready_ms": 123
}
}
}
],
"scrubbed_pre_session_transcript_with_tool_calls": [
{
"role": "agent",
"content": "hi how are you doing?",
"words": [
{
"word": "hi",
"start": 0.7,
"end": 1.3
}
],
"metadata": {
"response_id": 123,
"interrupt_id": 123,
"is_backchannel": true,
"interrupted": true,
"backup_model_used": {
"model": "<string>",
"primary_model": "<string>",
"backup_model": "<string>",
"reason": "primary_failed",
"selection_latency_ms": 123,
"primary_ready_ms": 123,
"backup_ready_ms": 123
}
}
}
],
"post_session_transcript_with_tool_calls": [
{
"role": "agent",
"content": "hi how are you doing?",
"words": [
{
"word": "hi",
"start": 0.7,
"end": 1.3
}
],
"metadata": {
"response_id": 123,
"interrupt_id": 123,
"is_backchannel": true,
"interrupted": true,
"backup_model_used": {
"model": "<string>",
"primary_model": "<string>",
"backup_model": "<string>",
"reason": "primary_failed",
"selection_latency_ms": 123,
"primary_ready_ms": 123,
"backup_ready_ms": 123
}
}
}
],
"scrubbed_post_session_transcript_with_tool_calls": [
{
"role": "agent",
"content": "hi how are you doing?",
"words": [
{
"word": "hi",
"start": 0.7,
"end": 1.3
}
],
"metadata": {
"response_id": 123,
"interrupt_id": 123,
"is_backchannel": true,
"interrupted": true,
"backup_model_used": {
"model": "<string>",
"primary_model": "<string>",
"backup_model": "<string>",
"reason": "primary_failed",
"selection_latency_ms": 123,
"primary_ready_ms": 123,
"backup_ready_ms": 123
}
}
}
],
"recording_url": "https://retellai.s3.us-west-2.amazonaws.com/Jabr9TXYYJHfvl6Syypi88rdAHYHmcq6/recording.wav",
"recording_multi_channel_url": "https://retellai.s3.us-west-2.amazonaws.com/Jabr9TXYYJHfvl6Syypi88rdAHYHmcq6/recording_multichannel.wav",
"scrubbed_recording_url": "https://retellai.s3.us-west-2.amazonaws.com/Jabr9TXYYJHfvl6Syypi88rdAHYHmcq6/recording.wav",
"scrubbed_recording_multi_channel_url": "https://retellai.s3.us-west-2.amazonaws.com/Jabr9TXYYJHfvl6Syypi88rdAHYHmcq6/recording_multichannel.wav",
"public_log_url": "https://retellai.s3.us-west-2.amazonaws.com/Jabr9TXYYJHfvl6Syypi88rdAHYHmcq6/public_log.txt",
"knowledge_base_retrieved_contents_url": "https://retellai.s3.us-west-2.amazonaws.com/Jabr9TXYYJHfvl6Syypi88rdAHYHmcq6/kb_retrieved_contents.txt",
"latency": {
"e2e": {
"p50": 800,
"p90": 1200,
"p95": 1500,
"p99": 2500,
"max": 2700,
"min": 500,
"num": 10,
"values": [
123
]
},
"asr": {
"p50": 800,
"p90": 1200,
"p95": 1500,
"p99": 2500,
"max": 2700,
"min": 500,
"num": 10,
"values": [
123
]
},
"llm": {
"p50": 800,
"p90": 1200,
"p95": 1500,
"p99": 2500,
"max": 2700,
"min": 500,
"num": 10,
"values": [
123
]
},
"llm_websocket_network_rtt": {
"p50": 800,
"p90": 1200,
"p95": 1500,
"p99": 2500,
"max": 2700,
"min": 500,
"num": 10,
"values": [
123
]
},
"tts": {
"p50": 800,
"p90": 1200,
"p95": 1500,
"p99": 2500,
"max": 2700,
"min": 500,
"num": 10,
"values": [
123
]
},
"knowledge_base": {
"p50": 800,
"p90": 1200,
"p95": 1500,
"p99": 2500,
"max": 2700,
"min": 500,
"num": 10,
"values": [
123
]
},
"s2s": {
"p50": 800,
"p90": 1200,
"p95": 1500,
"p99": 2500,
"max": 2700,
"min": 500,
"num": 10,
"values": [
123
]
}
},
"disconnection_reason": "agent_hangup",
"transfer_destination": "+12137771234",
"call_analysis": {
"call_summary": "The agent called the user to ask question about his purchase inquiry. The agent asked several questions regarding his preference and asked if user would like to book an appointment. The user happily agreed and scheduled an appointment next Monday 10am.",
"in_voicemail": false,
"user_sentiment": "Positive",
"call_successful": true,
"custom_analysis_data": {}
},
"call_cost": {
"product_costs": [
{
"product": "elevenlabs_tts",
"cost": 60,
"unit_price": 1,
"is_transfer_leg_cost": true
}
],
"total_duration_seconds": 60,
"total_duration_unit_price": 1,
"combined_cost": 70
},
"llm_token_usage": {
"values": [
123
],
"average": 123,
"num_requests": 123
}
}{
"status": "error",
"message": "Invalid request format, please check API reference."
}{
"status": "error",
"message": "API key is missing or invalid."
}{
"status": "error",
"message": "Trial has ended, please add payment method."
}{
"status": "error",
"message": "Cannot find requested asset under given api key."
}{
"status": "error",
"message": "Account rate limited, please throttle your requests."
}{
"status": "error",
"message": "An unexpected server error occurred."
}Authorizations
Body
For this particular call, override the agent version used with this version. This does not bind the agent version to this number, this is for one time override.
1 - 20^(latest|latest_published|(?!(?:latest|latest_published|v\d+)$)[a-z][a-z0-9_-]{0,19})$"latest_published"
If true, the e.164 validation will be ignored for the from_number. This can be useful when you want to dial to internal pseudo numbers. This only applies when you are using custom telephony and does not apply when you are using Retell Telephony. If omitted, the default value is false.
true
Response
Successfully made an outbound call.
Status of call.
registered: Call id issued, starting to make a call using this id.ongoing: Call connected and ongoing.ended: The underlying websocket has ended for the call. Either user or agent hung up, or call transferred.error: Call encountered error.
registered, not_connected, ongoing, ended, error "registered"
Tag pointing at the agent version used for this call, captured at call creation time and frozen thereafter (unaffected by later tag reassignments). Populated whether the caller dispatched by tag, numeric version, "latest", or "latest_published" — when the caller specified a tag, that tag wins; otherwise the most-recently- assigned tag on the resolved version is used. Absent when no tag points at the resolved version (or for calls created before this field was introduced).
"prod"
Data storage setting for this call's agent. "everything" stores all data, "everything_except_pii" excludes PII when possible, "basic_attributes_only" stores only metadata.
everything, everything_except_pii, basic_attributes_only "everything"
Transcription of the call. Available after call ends.
"Agent: hi how are you doing?\nUser: Doing pretty well. How are you?\nAgent: That's great to hear! I'm doing well too, thanks! What's up?\nUser: I don't have anything in particular.\nAgent: Got it, just checking in!\nUser: Alright. See you.\nAgent: have a nice day\n"
Transcript of the call weaved with tool call invocation and results. It precisely captures when (at what utterance, which word) the tool was invoked and what was the result. Available after call ends.
- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
- Option 6
- Option 7
Show child attributes
Show child attributes
Transcript of the call weaved with tool call invocation and results, without PII. It precisely captures when (at what utterance, which word) the tool was invoked and what was the result. Available after call ends.
- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
- Option 6
- Option 7
Show child attributes
Show child attributes
Tool call invocations and results of integration tools run before the session started (pre-session). Stored separately from the main transcript. Available after call ends if pre-session integration tools ran.
- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
- Option 6
- Option 7
Show child attributes
Show child attributes
Tool call invocations and results of integration tools run after post-call analysis (post-session). Stored separately from the main transcript. Available after call ends if post-session integration tools ran.
- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
- Option 6
- Option 7
Show child attributes
Show child attributes
Public log of the call, containing details about all the requests and responses received in LLM WebSocket, latency tracking for each turntaking, helpful for debugging and tracing. Available after call ends.
"https://retellai.s3.us-west-2.amazonaws.com/Jabr9TXYYJHfvl6Syypi88rdAHYHmcq6/public_log.txt"
URL to the knowledge base retrieved contents of the call. Available after call ends if the call utilizes knowledge base feature. It consists of the respond id and the retrieved contents related to that response. It's already rendered in call history tab of dashboard, and you can also manually download and check against the transcript to view the knowledge base retrieval results.
"https://retellai.s3.us-west-2.amazonaws.com/Jabr9TXYYJHfvl6Syypi88rdAHYHmcq6/kb_retrieved_contents.txt"
The reason for the disconnection of the call. Read detailed description about reasons listed here at Disconnection Reason Doc.
user_hangup, agent_hangup, user_requested_dnc, user_requested_callback, call_transfer, voicemail_reached, ivr_reached, inactivity, max_duration_reached, concurrency_limit_reached, no_concurrency_fallback, no_valid_payment, credit_exhausted, budget_reached, scam_detected, dial_busy, dial_failed, dial_no_answer, invalid_destination, telephony_provider_permission_denied, telephony_provider_unavailable, sip_routing_error, marked_as_spam, network_blocked, user_declined, error_llm_websocket_open, error_llm_websocket_lost_connection, error_llm_websocket_runtime, error_llm_websocket_corrupt_payload, error_no_audio_received, error_asr, error_retell, error_unknown, error_user_not_joined, registered_call_timeout, transfer_bridged, transfer_cancelled, manual_stopped, call_take_over "agent_hangup"
The destination number or identifier where the call was transferred to. Only populated when the disconnection reason was call_transfer. Can be a phone number or a SIP URI. SIP URIs are prefixed with "sip:" and may include a ";transport=..." portion (if transport is known) where the transport type can be "tls", "tcp" or "udp".
"+12137771234"
Was this page helpful?
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: process.env['RETELL_API_KEY'], // This is the default and can be omitted
});
const phoneCallResponse = await client.call.createPhoneCall({
from_number: '+14157774444',
to_number: '+12137774445',
});
console.log(phoneCallResponse.agent_id);import os
from retell import Retell
client = Retell(
api_key=os.environ.get("RETELL_API_KEY"), # This is the default and can be omitted
)
phone_call_response = client.call.create_phone_call(
from_number="+14157774444",
to_number="+12137774445",
)
print(phone_call_response.agent_id)curl --request POST \
--url https://api.retellai.com/v2/create-phone-call \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"from_number": "+14157774444",
"to_number": "+12137774445",
"idempotency_key": "<string>",
"override_agent_id": "oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD",
"override_agent_version": "latest_published",
"agent_override": {
"agent": {
"response_engine": {
"type": "retell-llm",
"llm_id": "llm_234sdertfsdsfsdf",
"version": 0
},
"agent_name": "Jarvis",
"version_description": "Customer support agent for handling product inquiries",
"version_title": "Production hotfix",
"voice_id": "retell-Cimo",
"fallback_voice_ids": [
"cartesia-Cimo",
"minimax-Cimo"
],
"voice_temperature": 1,
"voice_speed": 1,
"enable_dynamic_voice_speed": true,
"enable_dynamic_responsiveness": true,
"volume": 1,
"enable_expressive_mode": true,
"expressive_emotion_tags": [
"empathetic",
"excited",
"sigh",
"clear throat",
"emphasis"
],
"expressive_mode_prompt": "Use [sigh] for thoughtful pauses and [excited] for good news.",
"responsiveness": 1,
"interruption_sensitivity": 1,
"enable_backchannel": true,
"backchannel_frequency": 0.9,
"backchannel_words": [
"yeah",
"uh-huh"
],
"reminder_trigger_ms": 10000,
"reminder_max_count": 2,
"ambient_sound_volume": 1,
"language": "en-US",
"webhook_url": "https://webhook-url-here",
"webhook_events": [],
"webhook_timeout_ms": 10000,
"boosted_keywords": [
"retell",
"kroger"
],
"contact_memory_config": {
"enable_update": true,
"enable_read": true
},
"data_storage_setting": "everything",
"data_storage_retention_days": 30,
"opt_in_signed_url": true,
"signed_url_expiration_ms": 86400000,
"pronunciation_dictionary": [
{
"word": "actually",
"alphabet": "ipa",
"phoneme": "ˈæktʃuəli"
}
],
"enable_dnc_detection": false,
"end_call_after_silence_ms": 600000,
"max_call_duration_ms": 3600000,
"voicemail_option": {
"action": {
"type": "static_text",
"text": "Please give us a callback tomorrow at 10am."
}
},
"ivr_option": {
"action": {
"type": "hangup"
}
},
"call_screening_option": {
"agent_identity": "Acme Health scheduling team",
"call_purpose": "confirming your appointment for tomorrow"
},
"post_call_analysis_data": [
{
"type": "string",
"name": "customer_name",
"description": "The name of the customer.",
"examples": [
"John Doe",
"Jane Smith"
],
"required": true,
"conditional_prompt": "<string>"
}
],
"post_call_analysis_model": "gpt-4.1-mini",
"begin_message_delay_ms": 1000,
"ring_duration_ms": 30000,
"stt_mode": "fast",
"custom_stt_config": {
"endpointing_ms": 123
},
"vocab_specialization": "general",
"allow_user_dtmf": true,
"allow_dtmf_interruption": false,
"user_dtmf_options": {
"digit_limit": 25.5,
"termination_key": "#",
"timeout_ms": 8000
},
"denoising_mode": "noise-cancellation",
"denoising_enhancement_level": 0.8,
"guardrail_config": {
"output_topics": [],
"input_topics": [
"platform_integrity_jailbreaking"
]
},
"handbook_config": {
"customer_support": {
"custom_prompt": "<string>"
},
"conversational": {
"custom_prompt": "<string>"
},
"default_personality": true,
"conversational_personality": true,
"natural_filler_words": true,
"high_empathy": true,
"echo_verification": true,
"nato_phonetic_alphabet": true,
"speech_normalization": true,
"smart_matching": true,
"ai_disclosure": true,
"scope_boundaries": true
},
"enable_colloquial_model": true,
"timezone": "America/New_York",
"pre_session_tools": [
{
"type": "integration_app",
"name": "<string>",
"app_id": "<string>",
"provider": "<string>",
"app_tool_template_name": "<string>",
"parameters": [
{
"type": "object",
"properties": {},
"required": [
"<string>"
],
"additionalProperties": true
}
],
"execution_status_variable": "<string>",
"response_variables": {
"contact_first_name": "data.first_name"
},
"output_selection": {
"mode": "all",
"fields": [
"<string>"
]
},
"description": "<string>",
"speak_during_execution": true,
"speak_after_execution": true,
"execution_message_description": "<string>",
"enable_typing_sound": true,
"depends_on": [
"<string>"
]
}
],
"post_session_tools": [
{
"type": "integration_app",
"name": "<string>",
"app_id": "<string>",
"provider": "<string>",
"app_tool_template_name": "<string>",
"parameters": [
{
"type": "object",
"properties": {},
"required": [
"<string>"
],
"additionalProperties": true
}
],
"execution_status_variable": "<string>",
"response_variables": {
"contact_first_name": "data.first_name"
},
"output_selection": {
"mode": "all",
"fields": [
"<string>"
]
},
"description": "<string>",
"speak_during_execution": true,
"speak_after_execution": true,
"execution_message_description": "<string>",
"enable_typing_sound": true,
"depends_on": [
"<string>"
]
}
]
},
"retell_llm": {
"model_config": {
"type": "cascading",
"backup": {
"kick_in_timeout_ms": 30150
},
"temperature": 0
},
"backup_model": {
"type": "cascading",
"high_priority": true,
"ultrafast": true,
"backup_kick_in_timeout": 30150
},
"model": "gpt-5.6-terra",
"s2s_model": "gpt-realtime-1.5",
"model_temperature": 0,
"model_high_priority": true,
"model_ultrafast": true,
"knowledge_base_ids": [
"<string>"
],
"kb_config": {
"top_k": 3,
"filter_score": 0.6
},
"begin_after_user_silence_ms": 2000,
"begin_message": "Hey I am a virtual assistant calling from Retell Hospital."
},
"conversation_flow": {
"model_config": {
"type": "cascading",
"backup": {
"kick_in_timeout_ms": 30150
},
"temperature": 0
},
"backup_model": {
"type": "cascading",
"high_priority": true,
"ultrafast": true,
"backup_kick_in_timeout": 30150
},
"model_choice": {
"type": "cascading",
"high_priority": true,
"ultrafast": true
},
"model_temperature": 0.7,
"knowledge_base_ids": [
"kb_001",
"kb_002"
],
"kb_config": {
"top_k": 3,
"filter_score": 0.6
},
"start_speaker": "agent",
"begin_after_user_silence_ms": 2000
}
},
"metadata": {},
"retell_llm_dynamic_variables": {
"customer_name": "John Doe"
},
"custom_sip_headers": {
"X-Custom-Header": "Custom Value"
},
"ignore_e164_validation": true,
"honor_internal_dnc": true
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.retellai.com/v2/create-phone-call",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'from_number' => '+14157774444',
'to_number' => '+12137774445',
'idempotency_key' => '<string>',
'override_agent_id' => 'oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD',
'override_agent_version' => 'latest_published',
'agent_override' => [
'agent' => [
'response_engine' => [
'type' => 'retell-llm',
'llm_id' => 'llm_234sdertfsdsfsdf',
'version' => 0
],
'agent_name' => 'Jarvis',
'version_description' => 'Customer support agent for handling product inquiries',
'version_title' => 'Production hotfix',
'voice_id' => 'retell-Cimo',
'fallback_voice_ids' => [
'cartesia-Cimo',
'minimax-Cimo'
],
'voice_temperature' => 1,
'voice_speed' => 1,
'enable_dynamic_voice_speed' => true,
'enable_dynamic_responsiveness' => true,
'volume' => 1,
'enable_expressive_mode' => true,
'expressive_emotion_tags' => [
'empathetic',
'excited',
'sigh',
'clear throat',
'emphasis'
],
'expressive_mode_prompt' => 'Use [sigh] for thoughtful pauses and [excited] for good news.',
'responsiveness' => 1,
'interruption_sensitivity' => 1,
'enable_backchannel' => true,
'backchannel_frequency' => 0.9,
'backchannel_words' => [
'yeah',
'uh-huh'
],
'reminder_trigger_ms' => 10000,
'reminder_max_count' => 2,
'ambient_sound_volume' => 1,
'language' => 'en-US',
'webhook_url' => 'https://webhook-url-here',
'webhook_events' => [
],
'webhook_timeout_ms' => 10000,
'boosted_keywords' => [
'retell',
'kroger'
],
'contact_memory_config' => [
'enable_update' => true,
'enable_read' => true
],
'data_storage_setting' => 'everything',
'data_storage_retention_days' => 30,
'opt_in_signed_url' => true,
'signed_url_expiration_ms' => 86400000,
'pronunciation_dictionary' => [
[
'word' => 'actually',
'alphabet' => 'ipa',
'phoneme' => 'ˈæktʃuəli'
]
],
'enable_dnc_detection' => false,
'end_call_after_silence_ms' => 600000,
'max_call_duration_ms' => 3600000,
'voicemail_option' => [
'action' => [
'type' => 'static_text',
'text' => 'Please give us a callback tomorrow at 10am.'
]
],
'ivr_option' => [
'action' => [
'type' => 'hangup'
]
],
'call_screening_option' => [
'agent_identity' => 'Acme Health scheduling team',
'call_purpose' => 'confirming your appointment for tomorrow'
],
'post_call_analysis_data' => [
[
'type' => 'string',
'name' => 'customer_name',
'description' => 'The name of the customer.',
'examples' => [
'John Doe',
'Jane Smith'
],
'required' => true,
'conditional_prompt' => '<string>'
]
],
'post_call_analysis_model' => 'gpt-4.1-mini',
'begin_message_delay_ms' => 1000,
'ring_duration_ms' => 30000,
'stt_mode' => 'fast',
'custom_stt_config' => [
'endpointing_ms' => 123
],
'vocab_specialization' => 'general',
'allow_user_dtmf' => true,
'allow_dtmf_interruption' => false,
'user_dtmf_options' => [
'digit_limit' => 25.5,
'termination_key' => '#',
'timeout_ms' => 8000
],
'denoising_mode' => 'noise-cancellation',
'denoising_enhancement_level' => 0.8,
'guardrail_config' => [
'output_topics' => [
],
'input_topics' => [
'platform_integrity_jailbreaking'
]
],
'handbook_config' => [
'customer_support' => [
'custom_prompt' => '<string>'
],
'conversational' => [
'custom_prompt' => '<string>'
],
'default_personality' => true,
'conversational_personality' => true,
'natural_filler_words' => true,
'high_empathy' => true,
'echo_verification' => true,
'nato_phonetic_alphabet' => true,
'speech_normalization' => true,
'smart_matching' => true,
'ai_disclosure' => true,
'scope_boundaries' => true
],
'enable_colloquial_model' => true,
'timezone' => 'America/New_York',
'pre_session_tools' => [
[
'type' => 'integration_app',
'name' => '<string>',
'app_id' => '<string>',
'provider' => '<string>',
'app_tool_template_name' => '<string>',
'parameters' => [
[
'type' => 'object',
'properties' => [
],
'required' => [
'<string>'
],
'additionalProperties' => true
]
],
'execution_status_variable' => '<string>',
'response_variables' => [
'contact_first_name' => 'data.first_name'
],
'output_selection' => [
'mode' => 'all',
'fields' => [
'<string>'
]
],
'description' => '<string>',
'speak_during_execution' => true,
'speak_after_execution' => true,
'execution_message_description' => '<string>',
'enable_typing_sound' => true,
'depends_on' => [
'<string>'
]
]
],
'post_session_tools' => [
[
'type' => 'integration_app',
'name' => '<string>',
'app_id' => '<string>',
'provider' => '<string>',
'app_tool_template_name' => '<string>',
'parameters' => [
[
'type' => 'object',
'properties' => [
],
'required' => [
'<string>'
],
'additionalProperties' => true
]
],
'execution_status_variable' => '<string>',
'response_variables' => [
'contact_first_name' => 'data.first_name'
],
'output_selection' => [
'mode' => 'all',
'fields' => [
'<string>'
]
],
'description' => '<string>',
'speak_during_execution' => true,
'speak_after_execution' => true,
'execution_message_description' => '<string>',
'enable_typing_sound' => true,
'depends_on' => [
'<string>'
]
]
]
],
'retell_llm' => [
'model_config' => [
'type' => 'cascading',
'backup' => [
'kick_in_timeout_ms' => 30150
],
'temperature' => 0
],
'backup_model' => [
'type' => 'cascading',
'high_priority' => true,
'ultrafast' => true,
'backup_kick_in_timeout' => 30150
],
'model' => 'gpt-5.6-terra',
's2s_model' => 'gpt-realtime-1.5',
'model_temperature' => 0,
'model_high_priority' => true,
'model_ultrafast' => true,
'knowledge_base_ids' => [
'<string>'
],
'kb_config' => [
'top_k' => 3,
'filter_score' => 0.6
],
'begin_after_user_silence_ms' => 2000,
'begin_message' => 'Hey I am a virtual assistant calling from Retell Hospital.'
],
'conversation_flow' => [
'model_config' => [
'type' => 'cascading',
'backup' => [
'kick_in_timeout_ms' => 30150
],
'temperature' => 0
],
'backup_model' => [
'type' => 'cascading',
'high_priority' => true,
'ultrafast' => true,
'backup_kick_in_timeout' => 30150
],
'model_choice' => [
'type' => 'cascading',
'high_priority' => true,
'ultrafast' => true
],
'model_temperature' => 0.7,
'knowledge_base_ids' => [
'kb_001',
'kb_002'
],
'kb_config' => [
'top_k' => 3,
'filter_score' => 0.6
],
'start_speaker' => 'agent',
'begin_after_user_silence_ms' => 2000
]
],
'metadata' => [
],
'retell_llm_dynamic_variables' => [
'customer_name' => 'John Doe'
],
'custom_sip_headers' => [
'X-Custom-Header' => 'Custom Value'
],
'ignore_e164_validation' => true,
'honor_internal_dnc' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.retellai.com/v2/create-phone-call"
payload := strings.NewReader("{\n \"from_number\": \"+14157774444\",\n \"to_number\": \"+12137774445\",\n \"idempotency_key\": \"<string>\",\n \"override_agent_id\": \"oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD\",\n \"override_agent_version\": \"latest_published\",\n \"agent_override\": {\n \"agent\": {\n \"response_engine\": {\n \"type\": \"retell-llm\",\n \"llm_id\": \"llm_234sdertfsdsfsdf\",\n \"version\": 0\n },\n \"agent_name\": \"Jarvis\",\n \"version_description\": \"Customer support agent for handling product inquiries\",\n \"version_title\": \"Production hotfix\",\n \"voice_id\": \"retell-Cimo\",\n \"fallback_voice_ids\": [\n \"cartesia-Cimo\",\n \"minimax-Cimo\"\n ],\n \"voice_temperature\": 1,\n \"voice_speed\": 1,\n \"enable_dynamic_voice_speed\": true,\n \"enable_dynamic_responsiveness\": true,\n \"volume\": 1,\n \"enable_expressive_mode\": true,\n \"expressive_emotion_tags\": [\n \"empathetic\",\n \"excited\",\n \"sigh\",\n \"clear throat\",\n \"emphasis\"\n ],\n \"expressive_mode_prompt\": \"Use [sigh] for thoughtful pauses and [excited] for good news.\",\n \"responsiveness\": 1,\n \"interruption_sensitivity\": 1,\n \"enable_backchannel\": true,\n \"backchannel_frequency\": 0.9,\n \"backchannel_words\": [\n \"yeah\",\n \"uh-huh\"\n ],\n \"reminder_trigger_ms\": 10000,\n \"reminder_max_count\": 2,\n \"ambient_sound_volume\": 1,\n \"language\": \"en-US\",\n \"webhook_url\": \"https://webhook-url-here\",\n \"webhook_events\": [],\n \"webhook_timeout_ms\": 10000,\n \"boosted_keywords\": [\n \"retell\",\n \"kroger\"\n ],\n \"contact_memory_config\": {\n \"enable_update\": true,\n \"enable_read\": true\n },\n \"data_storage_setting\": \"everything\",\n \"data_storage_retention_days\": 30,\n \"opt_in_signed_url\": true,\n \"signed_url_expiration_ms\": 86400000,\n \"pronunciation_dictionary\": [\n {\n \"word\": \"actually\",\n \"alphabet\": \"ipa\",\n \"phoneme\": \"ˈæktʃuəli\"\n }\n ],\n \"enable_dnc_detection\": false,\n \"end_call_after_silence_ms\": 600000,\n \"max_call_duration_ms\": 3600000,\n \"voicemail_option\": {\n \"action\": {\n \"type\": \"static_text\",\n \"text\": \"Please give us a callback tomorrow at 10am.\"\n }\n },\n \"ivr_option\": {\n \"action\": {\n \"type\": \"hangup\"\n }\n },\n \"call_screening_option\": {\n \"agent_identity\": \"Acme Health scheduling team\",\n \"call_purpose\": \"confirming your appointment for tomorrow\"\n },\n \"post_call_analysis_data\": [\n {\n \"type\": \"string\",\n \"name\": \"customer_name\",\n \"description\": \"The name of the customer.\",\n \"examples\": [\n \"John Doe\",\n \"Jane Smith\"\n ],\n \"required\": true,\n \"conditional_prompt\": \"<string>\"\n }\n ],\n \"post_call_analysis_model\": \"gpt-4.1-mini\",\n \"begin_message_delay_ms\": 1000,\n \"ring_duration_ms\": 30000,\n \"stt_mode\": \"fast\",\n \"custom_stt_config\": {\n \"endpointing_ms\": 123\n },\n \"vocab_specialization\": \"general\",\n \"allow_user_dtmf\": true,\n \"allow_dtmf_interruption\": false,\n \"user_dtmf_options\": {\n \"digit_limit\": 25.5,\n \"termination_key\": \"#\",\n \"timeout_ms\": 8000\n },\n \"denoising_mode\": \"noise-cancellation\",\n \"denoising_enhancement_level\": 0.8,\n \"guardrail_config\": {\n \"output_topics\": [],\n \"input_topics\": [\n \"platform_integrity_jailbreaking\"\n ]\n },\n \"handbook_config\": {\n \"customer_support\": {\n \"custom_prompt\": \"<string>\"\n },\n \"conversational\": {\n \"custom_prompt\": \"<string>\"\n },\n \"default_personality\": true,\n \"conversational_personality\": true,\n \"natural_filler_words\": true,\n \"high_empathy\": true,\n \"echo_verification\": true,\n \"nato_phonetic_alphabet\": true,\n \"speech_normalization\": true,\n \"smart_matching\": true,\n \"ai_disclosure\": true,\n \"scope_boundaries\": true\n },\n \"enable_colloquial_model\": true,\n \"timezone\": \"America/New_York\",\n \"pre_session_tools\": [\n {\n \"type\": \"integration_app\",\n \"name\": \"<string>\",\n \"app_id\": \"<string>\",\n \"provider\": \"<string>\",\n \"app_tool_template_name\": \"<string>\",\n \"parameters\": [\n {\n \"type\": \"object\",\n \"properties\": {},\n \"required\": [\n \"<string>\"\n ],\n \"additionalProperties\": true\n }\n ],\n \"execution_status_variable\": \"<string>\",\n \"response_variables\": {\n \"contact_first_name\": \"data.first_name\"\n },\n \"output_selection\": {\n \"mode\": \"all\",\n \"fields\": [\n \"<string>\"\n ]\n },\n \"description\": \"<string>\",\n \"speak_during_execution\": true,\n \"speak_after_execution\": true,\n \"execution_message_description\": \"<string>\",\n \"enable_typing_sound\": true,\n \"depends_on\": [\n \"<string>\"\n ]\n }\n ],\n \"post_session_tools\": [\n {\n \"type\": \"integration_app\",\n \"name\": \"<string>\",\n \"app_id\": \"<string>\",\n \"provider\": \"<string>\",\n \"app_tool_template_name\": \"<string>\",\n \"parameters\": [\n {\n \"type\": \"object\",\n \"properties\": {},\n \"required\": [\n \"<string>\"\n ],\n \"additionalProperties\": true\n }\n ],\n \"execution_status_variable\": \"<string>\",\n \"response_variables\": {\n \"contact_first_name\": \"data.first_name\"\n },\n \"output_selection\": {\n \"mode\": \"all\",\n \"fields\": [\n \"<string>\"\n ]\n },\n \"description\": \"<string>\",\n \"speak_during_execution\": true,\n \"speak_after_execution\": true,\n \"execution_message_description\": \"<string>\",\n \"enable_typing_sound\": true,\n \"depends_on\": [\n \"<string>\"\n ]\n }\n ]\n },\n \"retell_llm\": {\n \"model_config\": {\n \"type\": \"cascading\",\n \"backup\": {\n \"kick_in_timeout_ms\": 30150\n },\n \"temperature\": 0\n },\n \"backup_model\": {\n \"type\": \"cascading\",\n \"high_priority\": true,\n \"ultrafast\": true,\n \"backup_kick_in_timeout\": 30150\n },\n \"model\": \"gpt-5.6-terra\",\n \"s2s_model\": \"gpt-realtime-1.5\",\n \"model_temperature\": 0,\n \"model_high_priority\": true,\n \"model_ultrafast\": true,\n \"knowledge_base_ids\": [\n \"<string>\"\n ],\n \"kb_config\": {\n \"top_k\": 3,\n \"filter_score\": 0.6\n },\n \"begin_after_user_silence_ms\": 2000,\n \"begin_message\": \"Hey I am a virtual assistant calling from Retell Hospital.\"\n },\n \"conversation_flow\": {\n \"model_config\": {\n \"type\": \"cascading\",\n \"backup\": {\n \"kick_in_timeout_ms\": 30150\n },\n \"temperature\": 0\n },\n \"backup_model\": {\n \"type\": \"cascading\",\n \"high_priority\": true,\n \"ultrafast\": true,\n \"backup_kick_in_timeout\": 30150\n },\n \"model_choice\": {\n \"type\": \"cascading\",\n \"high_priority\": true,\n \"ultrafast\": true\n },\n \"model_temperature\": 0.7,\n \"knowledge_base_ids\": [\n \"kb_001\",\n \"kb_002\"\n ],\n \"kb_config\": {\n \"top_k\": 3,\n \"filter_score\": 0.6\n },\n \"start_speaker\": \"agent\",\n \"begin_after_user_silence_ms\": 2000\n }\n },\n \"metadata\": {},\n \"retell_llm_dynamic_variables\": {\n \"customer_name\": \"John Doe\"\n },\n \"custom_sip_headers\": {\n \"X-Custom-Header\": \"Custom Value\"\n },\n \"ignore_e164_validation\": true,\n \"honor_internal_dnc\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.retellai.com/v2/create-phone-call")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"from_number\": \"+14157774444\",\n \"to_number\": \"+12137774445\",\n \"idempotency_key\": \"<string>\",\n \"override_agent_id\": \"oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD\",\n \"override_agent_version\": \"latest_published\",\n \"agent_override\": {\n \"agent\": {\n \"response_engine\": {\n \"type\": \"retell-llm\",\n \"llm_id\": \"llm_234sdertfsdsfsdf\",\n \"version\": 0\n },\n \"agent_name\": \"Jarvis\",\n \"version_description\": \"Customer support agent for handling product inquiries\",\n \"version_title\": \"Production hotfix\",\n \"voice_id\": \"retell-Cimo\",\n \"fallback_voice_ids\": [\n \"cartesia-Cimo\",\n \"minimax-Cimo\"\n ],\n \"voice_temperature\": 1,\n \"voice_speed\": 1,\n \"enable_dynamic_voice_speed\": true,\n \"enable_dynamic_responsiveness\": true,\n \"volume\": 1,\n \"enable_expressive_mode\": true,\n \"expressive_emotion_tags\": [\n \"empathetic\",\n \"excited\",\n \"sigh\",\n \"clear throat\",\n \"emphasis\"\n ],\n \"expressive_mode_prompt\": \"Use [sigh] for thoughtful pauses and [excited] for good news.\",\n \"responsiveness\": 1,\n \"interruption_sensitivity\": 1,\n \"enable_backchannel\": true,\n \"backchannel_frequency\": 0.9,\n \"backchannel_words\": [\n \"yeah\",\n \"uh-huh\"\n ],\n \"reminder_trigger_ms\": 10000,\n \"reminder_max_count\": 2,\n \"ambient_sound_volume\": 1,\n \"language\": \"en-US\",\n \"webhook_url\": \"https://webhook-url-here\",\n \"webhook_events\": [],\n \"webhook_timeout_ms\": 10000,\n \"boosted_keywords\": [\n \"retell\",\n \"kroger\"\n ],\n \"contact_memory_config\": {\n \"enable_update\": true,\n \"enable_read\": true\n },\n \"data_storage_setting\": \"everything\",\n \"data_storage_retention_days\": 30,\n \"opt_in_signed_url\": true,\n \"signed_url_expiration_ms\": 86400000,\n \"pronunciation_dictionary\": [\n {\n \"word\": \"actually\",\n \"alphabet\": \"ipa\",\n \"phoneme\": \"ˈæktʃuəli\"\n }\n ],\n \"enable_dnc_detection\": false,\n \"end_call_after_silence_ms\": 600000,\n \"max_call_duration_ms\": 3600000,\n \"voicemail_option\": {\n \"action\": {\n \"type\": \"static_text\",\n \"text\": \"Please give us a callback tomorrow at 10am.\"\n }\n },\n \"ivr_option\": {\n \"action\": {\n \"type\": \"hangup\"\n }\n },\n \"call_screening_option\": {\n \"agent_identity\": \"Acme Health scheduling team\",\n \"call_purpose\": \"confirming your appointment for tomorrow\"\n },\n \"post_call_analysis_data\": [\n {\n \"type\": \"string\",\n \"name\": \"customer_name\",\n \"description\": \"The name of the customer.\",\n \"examples\": [\n \"John Doe\",\n \"Jane Smith\"\n ],\n \"required\": true,\n \"conditional_prompt\": \"<string>\"\n }\n ],\n \"post_call_analysis_model\": \"gpt-4.1-mini\",\n \"begin_message_delay_ms\": 1000,\n \"ring_duration_ms\": 30000,\n \"stt_mode\": \"fast\",\n \"custom_stt_config\": {\n \"endpointing_ms\": 123\n },\n \"vocab_specialization\": \"general\",\n \"allow_user_dtmf\": true,\n \"allow_dtmf_interruption\": false,\n \"user_dtmf_options\": {\n \"digit_limit\": 25.5,\n \"termination_key\": \"#\",\n \"timeout_ms\": 8000\n },\n \"denoising_mode\": \"noise-cancellation\",\n \"denoising_enhancement_level\": 0.8,\n \"guardrail_config\": {\n \"output_topics\": [],\n \"input_topics\": [\n \"platform_integrity_jailbreaking\"\n ]\n },\n \"handbook_config\": {\n \"customer_support\": {\n \"custom_prompt\": \"<string>\"\n },\n \"conversational\": {\n \"custom_prompt\": \"<string>\"\n },\n \"default_personality\": true,\n \"conversational_personality\": true,\n \"natural_filler_words\": true,\n \"high_empathy\": true,\n \"echo_verification\": true,\n \"nato_phonetic_alphabet\": true,\n \"speech_normalization\": true,\n \"smart_matching\": true,\n \"ai_disclosure\": true,\n \"scope_boundaries\": true\n },\n \"enable_colloquial_model\": true,\n \"timezone\": \"America/New_York\",\n \"pre_session_tools\": [\n {\n \"type\": \"integration_app\",\n \"name\": \"<string>\",\n \"app_id\": \"<string>\",\n \"provider\": \"<string>\",\n \"app_tool_template_name\": \"<string>\",\n \"parameters\": [\n {\n \"type\": \"object\",\n \"properties\": {},\n \"required\": [\n \"<string>\"\n ],\n \"additionalProperties\": true\n }\n ],\n \"execution_status_variable\": \"<string>\",\n \"response_variables\": {\n \"contact_first_name\": \"data.first_name\"\n },\n \"output_selection\": {\n \"mode\": \"all\",\n \"fields\": [\n \"<string>\"\n ]\n },\n \"description\": \"<string>\",\n \"speak_during_execution\": true,\n \"speak_after_execution\": true,\n \"execution_message_description\": \"<string>\",\n \"enable_typing_sound\": true,\n \"depends_on\": [\n \"<string>\"\n ]\n }\n ],\n \"post_session_tools\": [\n {\n \"type\": \"integration_app\",\n \"name\": \"<string>\",\n \"app_id\": \"<string>\",\n \"provider\": \"<string>\",\n \"app_tool_template_name\": \"<string>\",\n \"parameters\": [\n {\n \"type\": \"object\",\n \"properties\": {},\n \"required\": [\n \"<string>\"\n ],\n \"additionalProperties\": true\n }\n ],\n \"execution_status_variable\": \"<string>\",\n \"response_variables\": {\n \"contact_first_name\": \"data.first_name\"\n },\n \"output_selection\": {\n \"mode\": \"all\",\n \"fields\": [\n \"<string>\"\n ]\n },\n \"description\": \"<string>\",\n \"speak_during_execution\": true,\n \"speak_after_execution\": true,\n \"execution_message_description\": \"<string>\",\n \"enable_typing_sound\": true,\n \"depends_on\": [\n \"<string>\"\n ]\n }\n ]\n },\n \"retell_llm\": {\n \"model_config\": {\n \"type\": \"cascading\",\n \"backup\": {\n \"kick_in_timeout_ms\": 30150\n },\n \"temperature\": 0\n },\n \"backup_model\": {\n \"type\": \"cascading\",\n \"high_priority\": true,\n \"ultrafast\": true,\n \"backup_kick_in_timeout\": 30150\n },\n \"model\": \"gpt-5.6-terra\",\n \"s2s_model\": \"gpt-realtime-1.5\",\n \"model_temperature\": 0,\n \"model_high_priority\": true,\n \"model_ultrafast\": true,\n \"knowledge_base_ids\": [\n \"<string>\"\n ],\n \"kb_config\": {\n \"top_k\": 3,\n \"filter_score\": 0.6\n },\n \"begin_after_user_silence_ms\": 2000,\n \"begin_message\": \"Hey I am a virtual assistant calling from Retell Hospital.\"\n },\n \"conversation_flow\": {\n \"model_config\": {\n \"type\": \"cascading\",\n \"backup\": {\n \"kick_in_timeout_ms\": 30150\n },\n \"temperature\": 0\n },\n \"backup_model\": {\n \"type\": \"cascading\",\n \"high_priority\": true,\n \"ultrafast\": true,\n \"backup_kick_in_timeout\": 30150\n },\n \"model_choice\": {\n \"type\": \"cascading\",\n \"high_priority\": true,\n \"ultrafast\": true\n },\n \"model_temperature\": 0.7,\n \"knowledge_base_ids\": [\n \"kb_001\",\n \"kb_002\"\n ],\n \"kb_config\": {\n \"top_k\": 3,\n \"filter_score\": 0.6\n },\n \"start_speaker\": \"agent\",\n \"begin_after_user_silence_ms\": 2000\n }\n },\n \"metadata\": {},\n \"retell_llm_dynamic_variables\": {\n \"customer_name\": \"John Doe\"\n },\n \"custom_sip_headers\": {\n \"X-Custom-Header\": \"Custom Value\"\n },\n \"ignore_e164_validation\": true,\n \"honor_internal_dnc\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.retellai.com/v2/create-phone-call")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"from_number\": \"+14157774444\",\n \"to_number\": \"+12137774445\",\n \"idempotency_key\": \"<string>\",\n \"override_agent_id\": \"oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD\",\n \"override_agent_version\": \"latest_published\",\n \"agent_override\": {\n \"agent\": {\n \"response_engine\": {\n \"type\": \"retell-llm\",\n \"llm_id\": \"llm_234sdertfsdsfsdf\",\n \"version\": 0\n },\n \"agent_name\": \"Jarvis\",\n \"version_description\": \"Customer support agent for handling product inquiries\",\n \"version_title\": \"Production hotfix\",\n \"voice_id\": \"retell-Cimo\",\n \"fallback_voice_ids\": [\n \"cartesia-Cimo\",\n \"minimax-Cimo\"\n ],\n \"voice_temperature\": 1,\n \"voice_speed\": 1,\n \"enable_dynamic_voice_speed\": true,\n \"enable_dynamic_responsiveness\": true,\n \"volume\": 1,\n \"enable_expressive_mode\": true,\n \"expressive_emotion_tags\": [\n \"empathetic\",\n \"excited\",\n \"sigh\",\n \"clear throat\",\n \"emphasis\"\n ],\n \"expressive_mode_prompt\": \"Use [sigh] for thoughtful pauses and [excited] for good news.\",\n \"responsiveness\": 1,\n \"interruption_sensitivity\": 1,\n \"enable_backchannel\": true,\n \"backchannel_frequency\": 0.9,\n \"backchannel_words\": [\n \"yeah\",\n \"uh-huh\"\n ],\n \"reminder_trigger_ms\": 10000,\n \"reminder_max_count\": 2,\n \"ambient_sound_volume\": 1,\n \"language\": \"en-US\",\n \"webhook_url\": \"https://webhook-url-here\",\n \"webhook_events\": [],\n \"webhook_timeout_ms\": 10000,\n \"boosted_keywords\": [\n \"retell\",\n \"kroger\"\n ],\n \"contact_memory_config\": {\n \"enable_update\": true,\n \"enable_read\": true\n },\n \"data_storage_setting\": \"everything\",\n \"data_storage_retention_days\": 30,\n \"opt_in_signed_url\": true,\n \"signed_url_expiration_ms\": 86400000,\n \"pronunciation_dictionary\": [\n {\n \"word\": \"actually\",\n \"alphabet\": \"ipa\",\n \"phoneme\": \"ˈæktʃuəli\"\n }\n ],\n \"enable_dnc_detection\": false,\n \"end_call_after_silence_ms\": 600000,\n \"max_call_duration_ms\": 3600000,\n \"voicemail_option\": {\n \"action\": {\n \"type\": \"static_text\",\n \"text\": \"Please give us a callback tomorrow at 10am.\"\n }\n },\n \"ivr_option\": {\n \"action\": {\n \"type\": \"hangup\"\n }\n },\n \"call_screening_option\": {\n \"agent_identity\": \"Acme Health scheduling team\",\n \"call_purpose\": \"confirming your appointment for tomorrow\"\n },\n \"post_call_analysis_data\": [\n {\n \"type\": \"string\",\n \"name\": \"customer_name\",\n \"description\": \"The name of the customer.\",\n \"examples\": [\n \"John Doe\",\n \"Jane Smith\"\n ],\n \"required\": true,\n \"conditional_prompt\": \"<string>\"\n }\n ],\n \"post_call_analysis_model\": \"gpt-4.1-mini\",\n \"begin_message_delay_ms\": 1000,\n \"ring_duration_ms\": 30000,\n \"stt_mode\": \"fast\",\n \"custom_stt_config\": {\n \"endpointing_ms\": 123\n },\n \"vocab_specialization\": \"general\",\n \"allow_user_dtmf\": true,\n \"allow_dtmf_interruption\": false,\n \"user_dtmf_options\": {\n \"digit_limit\": 25.5,\n \"termination_key\": \"#\",\n \"timeout_ms\": 8000\n },\n \"denoising_mode\": \"noise-cancellation\",\n \"denoising_enhancement_level\": 0.8,\n \"guardrail_config\": {\n \"output_topics\": [],\n \"input_topics\": [\n \"platform_integrity_jailbreaking\"\n ]\n },\n \"handbook_config\": {\n \"customer_support\": {\n \"custom_prompt\": \"<string>\"\n },\n \"conversational\": {\n \"custom_prompt\": \"<string>\"\n },\n \"default_personality\": true,\n \"conversational_personality\": true,\n \"natural_filler_words\": true,\n \"high_empathy\": true,\n \"echo_verification\": true,\n \"nato_phonetic_alphabet\": true,\n \"speech_normalization\": true,\n \"smart_matching\": true,\n \"ai_disclosure\": true,\n \"scope_boundaries\": true\n },\n \"enable_colloquial_model\": true,\n \"timezone\": \"America/New_York\",\n \"pre_session_tools\": [\n {\n \"type\": \"integration_app\",\n \"name\": \"<string>\",\n \"app_id\": \"<string>\",\n \"provider\": \"<string>\",\n \"app_tool_template_name\": \"<string>\",\n \"parameters\": [\n {\n \"type\": \"object\",\n \"properties\": {},\n \"required\": [\n \"<string>\"\n ],\n \"additionalProperties\": true\n }\n ],\n \"execution_status_variable\": \"<string>\",\n \"response_variables\": {\n \"contact_first_name\": \"data.first_name\"\n },\n \"output_selection\": {\n \"mode\": \"all\",\n \"fields\": [\n \"<string>\"\n ]\n },\n \"description\": \"<string>\",\n \"speak_during_execution\": true,\n \"speak_after_execution\": true,\n \"execution_message_description\": \"<string>\",\n \"enable_typing_sound\": true,\n \"depends_on\": [\n \"<string>\"\n ]\n }\n ],\n \"post_session_tools\": [\n {\n \"type\": \"integration_app\",\n \"name\": \"<string>\",\n \"app_id\": \"<string>\",\n \"provider\": \"<string>\",\n \"app_tool_template_name\": \"<string>\",\n \"parameters\": [\n {\n \"type\": \"object\",\n \"properties\": {},\n \"required\": [\n \"<string>\"\n ],\n \"additionalProperties\": true\n }\n ],\n \"execution_status_variable\": \"<string>\",\n \"response_variables\": {\n \"contact_first_name\": \"data.first_name\"\n },\n \"output_selection\": {\n \"mode\": \"all\",\n \"fields\": [\n \"<string>\"\n ]\n },\n \"description\": \"<string>\",\n \"speak_during_execution\": true,\n \"speak_after_execution\": true,\n \"execution_message_description\": \"<string>\",\n \"enable_typing_sound\": true,\n \"depends_on\": [\n \"<string>\"\n ]\n }\n ]\n },\n \"retell_llm\": {\n \"model_config\": {\n \"type\": \"cascading\",\n \"backup\": {\n \"kick_in_timeout_ms\": 30150\n },\n \"temperature\": 0\n },\n \"backup_model\": {\n \"type\": \"cascading\",\n \"high_priority\": true,\n \"ultrafast\": true,\n \"backup_kick_in_timeout\": 30150\n },\n \"model\": \"gpt-5.6-terra\",\n \"s2s_model\": \"gpt-realtime-1.5\",\n \"model_temperature\": 0,\n \"model_high_priority\": true,\n \"model_ultrafast\": true,\n \"knowledge_base_ids\": [\n \"<string>\"\n ],\n \"kb_config\": {\n \"top_k\": 3,\n \"filter_score\": 0.6\n },\n \"begin_after_user_silence_ms\": 2000,\n \"begin_message\": \"Hey I am a virtual assistant calling from Retell Hospital.\"\n },\n \"conversation_flow\": {\n \"model_config\": {\n \"type\": \"cascading\",\n \"backup\": {\n \"kick_in_timeout_ms\": 30150\n },\n \"temperature\": 0\n },\n \"backup_model\": {\n \"type\": \"cascading\",\n \"high_priority\": true,\n \"ultrafast\": true,\n \"backup_kick_in_timeout\": 30150\n },\n \"model_choice\": {\n \"type\": \"cascading\",\n \"high_priority\": true,\n \"ultrafast\": true\n },\n \"model_temperature\": 0.7,\n \"knowledge_base_ids\": [\n \"kb_001\",\n \"kb_002\"\n ],\n \"kb_config\": {\n \"top_k\": 3,\n \"filter_score\": 0.6\n },\n \"start_speaker\": \"agent\",\n \"begin_after_user_silence_ms\": 2000\n }\n },\n \"metadata\": {},\n \"retell_llm_dynamic_variables\": {\n \"customer_name\": \"John Doe\"\n },\n \"custom_sip_headers\": {\n \"X-Custom-Header\": \"Custom Value\"\n },\n \"ignore_e164_validation\": true,\n \"honor_internal_dnc\": true\n}"
response = http.request(request)
puts response.read_body{
"call_type": "phone_call",
"from_number": "+12137771234",
"to_number": "+12137771235",
"direction": "inbound",
"call_id": "Jabr9TXYYJHfvl6Syypi88rdAHYHmcq6",
"agent_id": "oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD",
"agent_version": 1,
"call_status": "registered",
"telephony_identifier": {
"twilio_call_sid": "CA5d0d0d8047bf685c3f0ff980fe62c123"
},
"agent_name": "My Agent",
"agent_tag": "prod",
"metadata": {},
"retell_llm_dynamic_variables": {
"customer_name": "John Doe"
},
"collected_dynamic_variables": {
"last_node_name": "Test node"
},
"custom_sip_headers": {
"X-Custom-Header": "Custom Value"
},
"data_storage_setting": "everything",
"opt_in_signed_url": true,
"start_timestamp": 1703302407333,
"end_timestamp": 1703302428855,
"transfer_end_timestamp": 1703302628855,
"duration_ms": 10000,
"transcript": "Agent: hi how are you doing?\nUser: Doing pretty well. How are you?\nAgent: That's great to hear! I'm doing well too, thanks! What's up?\nUser: I don't have anything in particular.\nAgent: Got it, just checking in!\nUser: Alright. See you.\nAgent: have a nice day\n",
"transcript_object": [
{
"role": "agent",
"content": "hi how are you doing?",
"words": [
{
"word": "hi",
"start": 0.7,
"end": 1.3
}
],
"metadata": {
"response_id": 123,
"interrupt_id": 123,
"is_backchannel": true,
"interrupted": true,
"backup_model_used": {
"model": "<string>",
"primary_model": "<string>",
"backup_model": "<string>",
"reason": "primary_failed",
"selection_latency_ms": 123,
"primary_ready_ms": 123,
"backup_ready_ms": 123
}
}
}
],
"transcript_with_tool_calls": [
{
"role": "agent",
"content": "hi how are you doing?",
"words": [
{
"word": "hi",
"start": 0.7,
"end": 1.3
}
],
"metadata": {
"response_id": 123,
"interrupt_id": 123,
"is_backchannel": true,
"interrupted": true,
"backup_model_used": {
"model": "<string>",
"primary_model": "<string>",
"backup_model": "<string>",
"reason": "primary_failed",
"selection_latency_ms": 123,
"primary_ready_ms": 123,
"backup_ready_ms": 123
}
}
}
],
"scrubbed_transcript_with_tool_calls": [
{
"role": "agent",
"content": "hi how are you doing?",
"words": [
{
"word": "hi",
"start": 0.7,
"end": 1.3
}
],
"metadata": {
"response_id": 123,
"interrupt_id": 123,
"is_backchannel": true,
"interrupted": true,
"backup_model_used": {
"model": "<string>",
"primary_model": "<string>",
"backup_model": "<string>",
"reason": "primary_failed",
"selection_latency_ms": 123,
"primary_ready_ms": 123,
"backup_ready_ms": 123
}
}
}
],
"pre_session_transcript_with_tool_calls": [
{
"role": "agent",
"content": "hi how are you doing?",
"words": [
{
"word": "hi",
"start": 0.7,
"end": 1.3
}
],
"metadata": {
"response_id": 123,
"interrupt_id": 123,
"is_backchannel": true,
"interrupted": true,
"backup_model_used": {
"model": "<string>",
"primary_model": "<string>",
"backup_model": "<string>",
"reason": "primary_failed",
"selection_latency_ms": 123,
"primary_ready_ms": 123,
"backup_ready_ms": 123
}
}
}
],
"scrubbed_pre_session_transcript_with_tool_calls": [
{
"role": "agent",
"content": "hi how are you doing?",
"words": [
{
"word": "hi",
"start": 0.7,
"end": 1.3
}
],
"metadata": {
"response_id": 123,
"interrupt_id": 123,
"is_backchannel": true,
"interrupted": true,
"backup_model_used": {
"model": "<string>",
"primary_model": "<string>",
"backup_model": "<string>",
"reason": "primary_failed",
"selection_latency_ms": 123,
"primary_ready_ms": 123,
"backup_ready_ms": 123
}
}
}
],
"post_session_transcript_with_tool_calls": [
{
"role": "agent",
"content": "hi how are you doing?",
"words": [
{
"word": "hi",
"start": 0.7,
"end": 1.3
}
],
"metadata": {
"response_id": 123,
"interrupt_id": 123,
"is_backchannel": true,
"interrupted": true,
"backup_model_used": {
"model": "<string>",
"primary_model": "<string>",
"backup_model": "<string>",
"reason": "primary_failed",
"selection_latency_ms": 123,
"primary_ready_ms": 123,
"backup_ready_ms": 123
}
}
}
],
"scrubbed_post_session_transcript_with_tool_calls": [
{
"role": "agent",
"content": "hi how are you doing?",
"words": [
{
"word": "hi",
"start": 0.7,
"end": 1.3
}
],
"metadata": {
"response_id": 123,
"interrupt_id": 123,
"is_backchannel": true,
"interrupted": true,
"backup_model_used": {
"model": "<string>",
"primary_model": "<string>",
"backup_model": "<string>",
"reason": "primary_failed",
"selection_latency_ms": 123,
"primary_ready_ms": 123,
"backup_ready_ms": 123
}
}
}
],
"recording_url": "https://retellai.s3.us-west-2.amazonaws.com/Jabr9TXYYJHfvl6Syypi88rdAHYHmcq6/recording.wav",
"recording_multi_channel_url": "https://retellai.s3.us-west-2.amazonaws.com/Jabr9TXYYJHfvl6Syypi88rdAHYHmcq6/recording_multichannel.wav",
"scrubbed_recording_url": "https://retellai.s3.us-west-2.amazonaws.com/Jabr9TXYYJHfvl6Syypi88rdAHYHmcq6/recording.wav",
"scrubbed_recording_multi_channel_url": "https://retellai.s3.us-west-2.amazonaws.com/Jabr9TXYYJHfvl6Syypi88rdAHYHmcq6/recording_multichannel.wav",
"public_log_url": "https://retellai.s3.us-west-2.amazonaws.com/Jabr9TXYYJHfvl6Syypi88rdAHYHmcq6/public_log.txt",
"knowledge_base_retrieved_contents_url": "https://retellai.s3.us-west-2.amazonaws.com/Jabr9TXYYJHfvl6Syypi88rdAHYHmcq6/kb_retrieved_contents.txt",
"latency": {
"e2e": {
"p50": 800,
"p90": 1200,
"p95": 1500,
"p99": 2500,
"max": 2700,
"min": 500,
"num": 10,
"values": [
123
]
},
"asr": {
"p50": 800,
"p90": 1200,
"p95": 1500,
"p99": 2500,
"max": 2700,
"min": 500,
"num": 10,
"values": [
123
]
},
"llm": {
"p50": 800,
"p90": 1200,
"p95": 1500,
"p99": 2500,
"max": 2700,
"min": 500,
"num": 10,
"values": [
123
]
},
"llm_websocket_network_rtt": {
"p50": 800,
"p90": 1200,
"p95": 1500,
"p99": 2500,
"max": 2700,
"min": 500,
"num": 10,
"values": [
123
]
},
"tts": {
"p50": 800,
"p90": 1200,
"p95": 1500,
"p99": 2500,
"max": 2700,
"min": 500,
"num": 10,
"values": [
123
]
},
"knowledge_base": {
"p50": 800,
"p90": 1200,
"p95": 1500,
"p99": 2500,
"max": 2700,
"min": 500,
"num": 10,
"values": [
123
]
},
"s2s": {
"p50": 800,
"p90": 1200,
"p95": 1500,
"p99": 2500,
"max": 2700,
"min": 500,
"num": 10,
"values": [
123
]
}
},
"disconnection_reason": "agent_hangup",
"transfer_destination": "+12137771234",
"call_analysis": {
"call_summary": "The agent called the user to ask question about his purchase inquiry. The agent asked several questions regarding his preference and asked if user would like to book an appointment. The user happily agreed and scheduled an appointment next Monday 10am.",
"in_voicemail": false,
"user_sentiment": "Positive",
"call_successful": true,
"custom_analysis_data": {}
},
"call_cost": {
"product_costs": [
{
"product": "elevenlabs_tts",
"cost": 60,
"unit_price": 1,
"is_transfer_leg_cost": true
}
],
"total_duration_seconds": 60,
"total_duration_unit_price": 1,
"combined_cost": 70
},
"llm_token_usage": {
"values": [
123
],
"average": 123,
"num_requests": 123
}
}{
"status": "error",
"message": "Invalid request format, please check API reference."
}{
"status": "error",
"message": "API key is missing or invalid."
}{
"status": "error",
"message": "Trial has ended, please add payment method."
}{
"status": "error",
"message": "Cannot find requested asset under given api key."
}{
"status": "error",
"message": "Account rate limited, please throttle your requests."
}{
"status": "error",
"message": "An unexpected server error occurred."
}
