red-television-3815
09/28/2025, 4:29 PMtall-airline-16756
09/28/2025, 4:29 PMtall-airline-16756
09/28/2025, 4:30 PMred-television-3815
09/28/2025, 4:33 PMtall-airline-16756
09/28/2025, 4:33 PMdeleteRoom API provided by LiveKit. This handy API will remove all participants and delete the room on the server side for you.
Here’s a simple way to approach it:
• Keep an eye on the user’s disconnection event on the frontend.
• Once the user disconnects, make a call from your backend to the deleteRoom API to close out the session and delete the room.
To make it clearer, here’s an example using Node.js:
const roomServiceClient = new RoomServiceClient(
process.env.LIVEKIT_URL,
process.env.LIVEKIT_API_KEY,
process.env.LIVEKIT_API_SECRET,
);
await roomServiceClient.deleteRoom('myroom');
If you prefer, you can also use the LiveKit CLI like this:
lk room delete myroom
Please feel free to reach out if you’d like help tailoring this to your specific setup—I’m here to support you!
Sources: Inside a session | LiveKit Docs | Job lifecycle | LiveKit Docs | Managing rooms | LiveKit Docs | Anatomy of an Agent | LiveKit Docs | Agents telephony integration | LiveKit Docsred-television-3815
09/28/2025, 4:34 PMtall-airline-16756
09/28/2025, 4:35 PM