big-controller-60015
09/22/2025, 1:59 PMtall-airline-16756
09/22/2025, 1:59 PMtall-airline-16756
09/22/2025, 2:00 PMcurl or Python. I’ve shared examples for both below to make it easier for you:
Using curl:
curl -X POST "<https://your-project.livekit.cloud/twirp/livekit.RoomService/ListRooms>" \
-H "Content-Type: application/json" \
-H "Authorization: Basic $(echo -n "api-key:api-secret" | base64)" \
-d '{}'
Just remember to replace api-key, api-secret, and your-project.livekit.cloud with your actual project details.
Using Python:
from livekit import api
import asyncio
async def list_rooms():
lkapi = api.LiveKitAPI()
try:
response = await lkapi.room.list_rooms(api.ListRoomsRequest())
for room in response.rooms:
print(f"Room: {room.name}, SID: {room.sid}, Participants: {room.num_participants}, Metadata: {room.metadata}")
except Exception as e:
print(f"Error: {e}")
finally:
await lkapi.aclose()
asyncio.run(list_rooms())
For the Python example, please make sure you have set the environment variables LIVEKIT_URL, LIVEKIT_API_KEY, and LIVEKIT_API_SECRET. This will help everything run smoothly.
If you have any questions or need more help, just let me know—I’m here for you!
Sources: livekit-api/livekit/api/livekit_api.py | Managing participants | LiveKit Docs | test/lktest/livekit.go | livekit/livekit_room.twirp.go | Managing rooms | LiveKit Docs