steep-shampoo-86436
12/29/2025, 10:30 AMtall-airline-16756
12/29/2025, 10:31 AMtall-airline-16756
12/29/2025, 10:31 AMParticipant left (CONNECTION_TIMEOUT) webhook is sent and why.
• Timing: LiveKit sends the participant_left webhook with reason CONNECTION_TIMEOUT after the server stops receiving ICE/STUN keep‑alive packets from the client's WebRTC peer connection for about 20 seconds.
• Typical cases that trigger it:
◦ Participant closes their browser tab or window abruptly.
◦ Participant loses internet connectivity (network drop).
◦ The media path is otherwise interrupted so ICE/STUN keep‑alives stop arriving.
This reason specifically means the media connection timed out (the media path is dead), not that there was a signaling/state mismatch. If you want, I can help you handle this webhook in your app (reconnection UI, grace window, or logging) — which option would you like?
Sources: Understanding the STATE_MISMATCH Disconnect Reasonsteep-shampoo-86436
12/29/2025, 10:36 AMtall-airline-16756
12/29/2025, 10:36 AMroom_finished webhook is emitted.
• Manual/API closure: Calling the deleteRoom API immediately closes the room and disconnects all participants.
• Agent/server-triggered closure: Rooms can be programmatically deleted by agent workflows or server-side logic (e.g., using the API client), which also closes the room immediately.
If you want, tell me which scenario you care about (automatic vs API vs agent workflows) and I’ll provide exact API calls or sample webhook handling.
Sources: Avoiding Room ID Reuse When Re-Creating Rooms With the Same Name | server-sdk-js | livekit/livekit_composite | DeepWiki | Job lifecycle | LiveKit docs | Agents telephony integration | LiveKit docssteep-shampoo-86436
12/29/2025, 10:37 AMtall-airline-16756
12/29/2025, 10:37 AMdeleteRoom API to terminate the room and disconnect any remaining participants. This ensures immediate and clean server-side cleanup.
5. Handle webhooks and post-close tasks: Listen for room_finished and participant_left webhooks to trigger recordings, archives, analytics, or other cleanup.
When to use alternatives
• If you want automatic closure after everyone leaves: rely on the default behavior (room closes after the departure timeout, ~20s, if no one rejoins).
• If you must forcibly stop a room now (e.g., abuse): call deleteRoom immediately without waiting for client disconnects.
Need code samples or SDK-specific calls? Tell me which language/SDK you use (JavaScript, TypeScript, Python, or server SDK), and I’ll give the exact API/SDK calls and a short example.steep-shampoo-86436
12/29/2025, 10:38 AMtall-airline-16756
12/29/2025, 10:38 AMroom_finished (a webhook event).
• When it's sent: after the room is shut down — typically when the last participant has left and the departure grace period (~20 seconds) expires, or when the room is explicitly closed via the deleteRoom API or programmatic deletion.
• What it indicates: the room has been fully terminated (useful for stopping recordings, cleanup, billing, etc.).
If you want, I can show a short webhook handler example or confirm how to enable webhooks for your server — which would you prefer?
Sources: Server-side | livekit/livekit_composite | DeepWikisteep-shampoo-86436
12/29/2025, 10:40 AMtall-airline-16756
12/29/2025, 10:41 AMdeleteRoom affects egress.
• Effect on participants/room: Calling deleteRoom immediately disconnects all participants and marks the room closed.
• Effect on egress (recording/composing): Egress processes are not terminated instantly. Active egress (composite recording, MP4 finalization, uploads, RTMP sessions finishing segments, etc.) will continue briefly after the room is deleted so they can finalize output (preventing corrupted files).
• Best practices:
◦ If you need deterministic timing, explicitly stop egress first (call the egress stop API) and wait for confirmation, then call deleteRoom.
◦ If you prefer server-side finalization, you can call deleteRoom and allow LiveKit to finish composing/finishing egress; expect a short delay until egress fully stops.
Would you like the exact API calls/snippets for stopping egress before deleting the room (Node, Python, or JS)?
Sources: server-sdk-js | livekit/livekit_composite | DeepWiki | Job lifecycle | LiveKit docs