var conversation;
// ...
// Here we choose which conversation we want to end.
// ...
if(conversation.capabilities.canEnd)
{
// End conversation.
conversation.end();
}
Once the conversations has ended it no longer exists and calling any of the conversation's API will fail with
InvalidConversation error.