A step-by-step guide to implementing chat functionality with Retell
Create a Chat Agent
Create a Chat Session
create-chat
API endpoint.The API will return a chat_id
that you’ll need for subsequent requests.For detailed API information, refer to the Create Chat API Reference.Create a Chat Completion
create-chat-completion
API endpoint.The API will return the agent’s response in the messages
array. All conversation history is automatically stored in Retell’s database, so you don’t need to manage conversation context yourself.For detailed API information, refer to the Create Chat Completion API Reference.Retrieve Chat Details
get-chat
API endpoint.You can also list all chat sessions using the list-chat
endpoint.For detailed API information, refer to the Get Chat API Reference and List Chat API Reference.End Chat Session
end-chat
API endpoint.If Auto-Close Inactive Chats is enabled, chat will automatically end when the timeout is triggered, or you can end them anytime with the end-chat
API.For detailed API information, refer to the End Chat API Reference.