Call (V2)
Phone Number
Agent
Retell LLM Response Engine (for single / multi prompt agent)
Knowledge Base
Batch call
Account
Custom Telephony
Custom LLM
Chat
Create Chat
Create a chat session
POST
/
create-chat
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
});
async function main() {
const chatResponse = await client.chat.create({ agent_id: 'oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD' });
console.log(chatResponse.agent_id);
}
main();
{
"chat_id": "Jabr9TXYYJHfvl6Syypi88rdAHYHmcq6",
"agent_id": "oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD",
"retell_llm_dynamic_variables": {
"customer_name": "John Doe"
},
"chat_status": "ongoing",
"start_timestamp": 1703302407333,
"end_timestamp": 1703302428855,
"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",
"message_with_tool_calls": [
{
"message_id": "Jabr9TXYYJHfvl6Syypi88rdAHYHmcq6",
"role": "agent",
"content": "hi how are you doing?",
"created_timestamp": 1703302428855
}
],
"metadata": {},
"chat_cost": {
"product_costs": [
{
"product": "elevenlabs_tts",
"unitPrice": 1,
"cost": 60
}
],
"combined_cost": 70
},
"chat_analysis": {
"chat_summary": "The agent messages 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.",
"user_sentiment": "Positive",
"chat_successful": true,
"custom_analysis_data": {}
}
}
Authorizations
Authentication header containing API key (find it in dashboard). The format is "Bearer YOUR_API_KEY"
Body
application/json
Response
201
application/json
Successfully registered a phone call.
The response is of type object
.
Was this page helpful?
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
});
async function main() {
const chatResponse = await client.chat.create({ agent_id: 'oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD' });
console.log(chatResponse.agent_id);
}
main();
{
"chat_id": "Jabr9TXYYJHfvl6Syypi88rdAHYHmcq6",
"agent_id": "oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD",
"retell_llm_dynamic_variables": {
"customer_name": "John Doe"
},
"chat_status": "ongoing",
"start_timestamp": 1703302407333,
"end_timestamp": 1703302428855,
"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",
"message_with_tool_calls": [
{
"message_id": "Jabr9TXYYJHfvl6Syypi88rdAHYHmcq6",
"role": "agent",
"content": "hi how are you doing?",
"created_timestamp": 1703302428855
}
],
"metadata": {},
"chat_cost": {
"product_costs": [
{
"product": "elevenlabs_tts",
"unitPrice": 1,
"cost": 60
}
],
"combined_cost": 70
},
"chat_analysis": {
"chat_summary": "The agent messages 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.",
"user_sentiment": "Positive",
"chat_successful": true,
"custom_analysis_data": {}
}
}
Assistant
Responses are generated using AI and may contain mistakes.