API Command: leave_session

The leave_session operation removes a customer or representative from a session. It is the opposite of the join_session operation, except it also works on customers. This operation is necessary to remove the end user from the Remote Support session, when the end user disconnects from the chat bot at any time.

The command API is an authenticated API. For instructions on using authenticated APIs using OAuth, see Authenticate to the Remote Support API. The API account must have read-only or full access to the command API.

Parameters for leave_session

lsid This is the unique Logging Session ID (LSID) of the session in which the chat message will be sent.
rep_id (optional, see note) The unique ID of the representative to remove from the session.
rep_username (optional, see note) The username of the representative to remove from the session.
customer (optional, see note) Must be have a value of1. If 1, the customer will be removed from the session.

You must provide one of the optional parameters listed (rep_id, rep_username, customer). If none of these parameters is provided, an error is returned.

Query Examples: leave_session




If you experience a high volume of support requests, repeatedly calling a command such as get_logged_in_reps or get_support_teams might bottleneck your system. Therefore, a best practice is to not request a list of representatives or teams with each support request. Instead, if making the same API call in succession, consider caching the results for a period of time and reusing them. New sessions requests should reference the cached list instead of calling for the list each time.