narrow-hairdresser-82835
11/03/2025, 3:50 PMtall-airline-16756
11/03/2025, 3:51 PMtall-airline-16756
11/03/2025, 3:51 PMPOST https://your-project.livekit.cloud/room/delete
Authorization: Bearer <your_server_generated_token>
Content-Type: application/json
{
"room": "room_name_to_delete"
}
To get the server token you need, just use your API Key and Secret. Make sure the token has the roomCreate permission included in the grants. If you’d like, I’m here to help you with generating the token or anything else related to the API—just let me know!
Sources: README.md | mcp/server.py | lib/livekit/room_service_client.rb | src/main/kotlin/io/livekit/server/RoomServiceClient.kt | README.mdnarrow-hairdresser-82835
11/03/2025, 3:52 PMtall-airline-16756
11/03/2025, 3:53 PMfrom livekit import api
import os
# Initialize the LiveKit API client
lkapi = api.LiveKitAPI(
os.getenv("LIVEKIT_API_KEY"),
os.getenv("LIVEKIT_API_SECRET"),
api_url=os.getenv("LIVEKIT_URL") # e.g., "https://your-project.livekit.cloud"
)
# Delete a room by name
async def delete_room(room_name: str):
await lkapi.room.delete_room(
room=room_name
)
print(f"Room {room_name} deleted successfully")
# Run the deletion (example)
import asyncio
asyncio.run(delete_room("my-room"))
Just be sure to replace LIVEKIT_API_KEY, LIVEKIT_API_SECRET, and LIVEKIT_URL with your own LiveKit credentials and server URL. This approach uses your API credentials directly to perform administrative tasks like deleting a room. If you have any questions or need a hand with anything else, please feel free to ask—I'm here to help!
Sources: Managing rooms | LiveKit docs | Generating tokens | LiveKit docs | examples/agent_dispatch.py