endChat() for Lightning Experience

Ends a chat in which an agent is currently engaged. This method works only in Lightning console apps.

NameTypeDescription
argumentObjObjectAn object containing all the arguments to be passed into this method.
NameTypeDescription
recordIdStringThe ID of the chat that you want to end.

This example ends the chat and logs the result.

Component Code:

Controller Code:

Returns a Promise. Success resolves to true. The Promise is rejected if there’s an error.