how to use livekit in terminal to remove a partici...
# ask-ai
b
how to use livekit in terminal to remove a participant from room
t
Thanks for reaching out, Mohammed. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Hi there! If you need to remove a participant from a room using LiveKit via the terminal, you can easily do this with the
livekit-cli
tool by running the following command:
Copy code
lk room participants remove <identity> --room <room_name>
Just to clarify: •
<identity>
is the unique identity of the participant you'd like to remove. •
<room_name>
is the name of the room where the participant is currently connected. When you run this command, it will forcibly disconnect the participant from the room and trigger a
Disconnected
event. One important thing to keep in mind is that removing a participant doesn’t invalidate their access token. So, if you want to make sure they can’t rejoin, it’s best to issue short-lived tokens or avoid giving them a new token from your backend. I hope this helps! If you have any more questions, feel free to ask. Sources: Managing participants | LiveKit Docs | README.md | packages/livekit-server-sdk/src/RoomServiceClient.ts | livekit-api/livekit/api/room_service.py