https://retellai.com/?utm_source=discord&utm_medium=seo logo
how to close an ongoing chat session with an agent
# ❓・ai-evy-support
m
@AI Evy how to close an ongoing chat session with an agent
a
Thanks for tagging me @moustaphalchemist. I'll look through relevant sources and get back to you shortly.
### Answer To close an ongoing chat session, you can use the
end-chat
API endpoint [(1) ]() . The documentation mentions that when the conversation is complete, you should end the chat session using the
end-chat
API endpoint . If Auto-Close Inactive Chats is enabled, chat sessions will automatically end when the timeout is triggered, or you can end them anytime with the
end-chat
API . You can check the current status of your chat session using the Get Chat API to see if it's still "ongoing" [(2) ]() . The chat status can be one of:
ongoing
(chat session is ongoing and can receive new messages) ,
ended
(chat session has ended and cannot generate new responses) , or
error
(chat encountered an error) .
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
​ To learn more, see the sources I considered: [[1] Create Chat Completion](https://docs.retellai.com/deploy/create-chat-completion) [[2] Get Chat](https://docs.retellai.com/api-references/get-chat) ​