what is the proper way to explicitly delete a room...
# ask-ai
f
what is the proper way to explicitly delete a room?
t
Thanks for reaching out, Taras. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
I'm happy to help you with deleting a room in LiveKit! You can use the
DeleteRoom
API method through the RoomServiceClient, which will disconnect all participants and remove the room entirely. Here are some options depending on the SDK or tool you prefer: • *Go SDK:*`_, _ = roomClient.DeleteRoom(context.Background(), &livekit.DeleteRoomRequest{ Room: "myroom", })` • *Node.js SDK:*`roomService.deleteRoom('myroom').then(() => { console.log('room deleted'); });` • *Python SDK:*`from livekit.api import DeleteRoomRequest await lkapi.room.delete_room(DeleteRoomRequest(room="myroom"))` • *Kotlin SDK:*`fun deleteRoom(roomName: String): Call<void?> { val request = LivekitRoom.DeleteRoomRequest.newBuilder() .setRoom(roomName) .build() val credentials = authHeader(RoomCreate(true)) return service.deleteRoom(request, credentials) }` • *Rust SDK:*`pub async fn delete_room(&self, room: &str) -> ServiceResult<()> { self.client .request( SVC, "DeleteRoom", proto::DeleteRoomRequest { room: room.to_owned() }, self.base .auth_header(VideoGrants { room_create: true, ..Default::default() }, None)?, ) .await .map_err(Into::into) }` • LiveKit CLI: You can simply run:
lk room delete myroom
Just a quick reminder to make sure you have the
roomCreate
permission before you proceed. If you have any questions or need a hand with anything else, please feel free to ask—I'm here to help! Sources: packages/livekit-server-sdk/src/RoomServiceClient.ts | livekit-api/livekit/api/room_service.py | src/main/kotlin/io/livekit/server/RoomServiceClient.kt | livekit-api/src/services/room.rs | protobufs/livekit_room.proto