cuddly-cartoon-47334
08/05/2025, 11:45 PMtall-airline-16756
08/05/2025, 11:45 PMcuddly-cartoon-47334
08/05/2025, 11:46 PMtall-airline-16756
08/05/2025, 11:46 PMRoomServiceClient with your LiveKit host and API credentials.
2. Create a DeleteRoomRequest: Instantiate a DeleteRoomRequest object and set the room field to the name of the room you want to delete.
3. Call the DeleteRoom method: Use the DeleteRoom method of the RoomServiceClient to send the request and delete the room.
Here’s an example in Python:
from google.protobuf.empty_pb2 import Empty
from livekit import api
from livekit.protocol import room as room_proto
# Initialize the LiveKit API client
lkapi = api.LiveKitAPI(
session=aiohttp.ClientSession(),
url=BASE_API_URL, # Replace with your LiveKit host URL
api_key="your-api-key", # Replace with your API key
api_secret="your-api-secret" # Replace with your API secret
)
# Create a DeleteRoomRequest
delete_request = room_proto.DeleteRoomRequest(
room="your-room-name" # Replace with the name of the room to delete
)
# Delete the room
await lkapi.room.delete_room(delete_request)
Replace BASE_API_URL, "your-api-key", and "your-api-secret" with your actual LiveKit credentials and host URL. Replace "your-room-name" with the name of the room you want to delete.
Note: The DeleteRoom operation requires the roomCreate permission. This method will disconnect all participants and remove the room from the server.