How can I configure a room to automatically be des...
# ask-ai
i
How can I configure a room to automatically be destroyed immediately when empty?
t
Hi there! To make sure a room in LiveKit is automatically destroyed right after it becomes empty, you just need to set the
departure_timeout
parameter to 0 seconds when you create the room. This way, the room will close as soon as everyone leaves, keeping things neat and tidy. You can easily set this up through: • CreateRoom API: Just include
departure_timeout: 0
in your request payload. • Server SDK: Use the
CreateRoom
method and set the
departure_timeout
option to 0. • Configuration file: If you want this to apply to all rooms by default, set
departure_timeout: 0
in the default room config inside
config.yaml
. Here’s a quick example using the CreateRoomRequest:
Copy code
CreateRoomRequest {
  name: "my-room",
  departure_timeout: 0
}
If you have any questions or need a hand with this, feel free to reach out—I’m here to help! Sources: pkg/config/config.go | livekit/livekit_room.pb.go | Rooms, participants, and tracks | LiveKit docs