alonsobrena_26588
11/12/2025, 6:47 PMAI Evy
11/12/2025, 6:47 PMAI Evy
11/12/2025, 6:47 PMAI Evy
11/12/2025, 6:47 PMAI Evy
11/12/2025, 6:47 PMalonsobrena_26588
11/12/2025, 6:48 PMalonsobrena_26588
11/12/2025, 6:48 PMAI Evy
11/12/2025, 6:48 PMAI Evy
11/12/2025, 6:48 PMAI Evy
11/12/2025, 6:48 PMAI Evy
11/12/2025, 6:48 PMalonsobrena_26588
11/12/2025, 6:49 PMAI Evy
11/12/2025, 6:49 PMAI Evy
11/12/2025, 6:49 PMAI Evy
11/12/2025, 6:49 PMAI Evy
11/12/2025, 6:49 PMalonsobrena_26588
11/12/2025, 6:50 PMAI Evy
11/12/2025, 6:50 PMAI Evy
11/12/2025, 6:50 PMAI Evy
11/12/2025, 6:50 PMAI Evy
11/12/2025, 6:50 PMalonsobrena_26588
11/12/2025, 6:50 PMAI Evy
11/12/2025, 6:50 PMAI Evy
11/12/2025, 6:51 PMAI Evy
11/12/2025, 6:51 PMAI Evy
11/12/2025, 6:51 PMalonsobrena_26588
11/13/2025, 12:11 AMAI Evy
11/13/2025, 12:11 AMalonsobrena_26588
11/13/2025, 12:11 AMAI Evy
11/13/2025, 12:11 AMAI Evy
11/13/2025, 12:11 AMAI Evy
11/13/2025, 12:11 AMalonsobrena_26588
11/13/2025, 12:13 AMAI Evy
11/13/2025, 12:13 AMAI Evy
11/13/2025, 12:13 AMAI Evy
11/13/2025, 12:13 AMAI Evy
11/13/2025, 12:13 AMalonsobrena_26588
11/13/2025, 12:41 AMAI Evy
11/13/2025, 12:41 AMAI Evy
11/13/2025, 12:41 AMAI Evy
11/13/2025, 12:41 AMAI Evy
11/13/2025, 12:42 AMalonsobrena_26588
11/13/2025, 11:45 PMAI Evy
11/13/2025, 11:45 PMAI Evy
11/13/2025, 11:45 PMchat_id of an existing chat session and the user's message content
2. The agent processes the message and generates a response
3. The API returns new messages generated by the agent, including any tool call invocations and their results
Example using the TypeScript SDK:
typescript
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const response = await client.chat.createChatCompletion({
chat_id: 'oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD',
content: 'hi how are you doing?',
}) ;
console.log(response.messages) ;
This endpoint is essential for maintaining back-and-forth conversations with your chat agent [(1) ]() [(3) ]() .
**AI Evy
11/13/2025, 11:45 PMAI Evy
11/13/2025, 11:45 PMalonsobrena_26588
11/13/2025, 11:46 PMAI Evy
11/13/2025, 11:46 PMAI Evy
11/13/2025, 11:47 PM{{variable_name}} syntax, you can create agents that adapt to different contexts while maintaining consistent conversation flows .
### Common Use Cases
- **Personalized greetings**: "Hello {{customer_name}}, thanks for calling!"
- **Context-aware responses**: "I see you're calling about order `{{order_id}}`"
- **Dynamic routing**: Transfer to different numbers based on {{department}}
- **Time-sensitive information**: Reference {{appointment_date}} or {{deadline}}
### Where Dynamic Variables Work
Dynamic variables can be used in :
- **Prompts**: Agent instructions and personality
- **Begin message**: Opening greeting
- **Tool configurations**: Custom function URLs, tool descriptions, property descriptions
- **Call handling**: Voicemail prompts and messages, transfer call phone numbers, warm transfer instructions
- Webhook URL
### How to Use Them
For Outbound Calls:
When using the Create Phone Call API, set your variables in the retell_llm_dynamic_variables field (all values must be strings) :
json
{
"user_name": "John Smith",
"product_name": "Premium Plan",
"account_status": "active"
}AI Evy
11/13/2025, 11:47 PMAmerica/Los_Angeles
- `{{session_type}}`: Session type, voice or chat
- `{{user_number}}`: User's phone number (for phone calls)
- `{{call_id}}`: Current call session id
### Extracting Variables During Conversations
You can also extract values from a user's response and save them as dynamic variables in real-time using the Extract Dynamic Variables tool [(2) ]() [(3) ]() . This lets your agent automatically save names, emails, budgets, and preferences, then reference them anytime during the call [(3) ]() .
**AI Evy
11/13/2025, 11:47 PMAI Evy
11/13/2025, 11:47 PMalonsobrena_26588
11/13/2025, 11:58 PMalonsobrena_26588
11/13/2025, 11:58 PMAI Evy
11/13/2025, 11:58 PMAI Evy
11/13/2025, 11:58 PMAI Evy
11/14/2025, 12:03 AMAI Evy
11/14/2025, 12:03 AM