Skip to main content

Leave Community

The Leave Community method allows users to gracefully exit a community by handling the necessary backend processes, such as updating membership records and adjusting access permissions. This function ensures a smooth user experience while departing from a community, maintaining data integrity and security.

Leaving a community

  1. For an user to leave a community, use the leaveCommunity() method of the client you initialised.
  2. Pass in the required parameter uuids which is a list of string.
  3. Process the response as per your requirement.
const payload: any = {
uuids: [89899], // pass in user's uuids.
};
const response = await lmChatClient.leaveCommunity(payload);

if (response.success) {
// your function to process the response data
processResponse(response);
} else {
// your function to process error message
processError(response);
}

Leave Community Payload

List of parameters supported.

VariableTypeDescriptionOptional
uuidsstrings[]List of uuids of user who want to leave the community✔️

Leave Community Response

List of parameters in the response.

VariableTypeDescription
successbooleanAPI success status
error_messagestringError message in case of failure