hundreds-journalist-9108
09/07/2025, 9:13 AMtall-airline-16756
09/07/2025, 9:13 AMtall-airline-16756
09/07/2025, 9:14 AMhundreds-journalist-9108
09/07/2025, 9:14 AMtall-airline-16756
09/07/2025, 9:15 AMRemoveParticipant API from LiveKit's server-side SDKs. This handy method will remove a participant from a room and trigger a Disconnected event for them.
Here’s a quick example in Node.js:
import { RoomServiceClient } from "livekit-server-sdk";
const roomService = new RoomServiceClient(LIVEKIT_URL, API_KEY, API_SECRET);
await roomService.removeParticipant(roomName, participantIdentity);
And if you’re working with Python, here’s how you can do it:
from livekit.api import LiveKitAPI, RoomParticipantIdentity
api_client = LiveKitAPI(url=API_URL, api_key=API_KEY, api_secret=API_SECRET)
await api_client.room.remove_participant(
RoomParticipantIdentity(room=room_name, identity=participant_identity)
)
Just swap out roomName and participantIdentity with your actual room name and the participant’s identity. Also, make sure your service has the roomAdmin permission to make this work.
If you hit any bumps or have more questions, feel free to ask—I’m here to help!
Sources: packages/livekit-rtc/src/proto/room_pb.ts | livekit-api/livekit/api/room_service.py | Managing participants | LiveKit Docs | lib/src/core/room.dart | src/room/Room.tshundreds-journalist-9108
09/07/2025, 9:18 AMagent_session.output.audio = DataStreamAudioOutput(
room=room,
destination_identity=self._avatar_participant_identity,
sample_rate=SAMPLE_RATE,
wait_remote_track=rtc.TrackKind.KIND_VIDEO,
)tall-airline-16756
09/07/2025, 9:19 AMDataStreamAudioOutput automatically. Could you let me know if you’d like some help with stopping these outputs manually? Or are you noticing any particular problems with them sticking around after the disconnection?hundreds-journalist-9108
09/07/2025, 9:34 AMtall-airline-16756
09/07/2025, 9:34 AMhundreds-journalist-9108
09/07/2025, 10:59 AM