I want to see the closed sessions/rooms from CLI, ...
# ask-ai
l
I want to see the closed sessions/rooms from CLI, so I can see historical data
t
Thanks for reaching out, David. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks for reaching out! I understand you're looking to view closed or historical rooms using the LiveKit CLI. While the CLI doesn’t support this directly, don’t worry—we have a great alternative. If you’re on a LiveKit Cloud Scale plan or higher, you can use the Analytics API to retrieve this data. Here’s a simple way to get started: 1. Generate an Access Token: Use the CLI to create a token with the
roomList
grant. For example:
lk token create --api-key $LIVEKIT_API_KEY --api-secret $LIVEKIT_SECRET_KEY --list --valid-for 24h
2. Find your Project ID: You can locate this in your project dashboard URL—it starts with
p_
. 3. Make an API Request: Use the Analytics API to query your closed sessions. Here’s an example cURL request:
curl -H "Authorization: Bearer $TOKEN" "<BASE_API_URL>/api/project/$PROJECT_ID/sessions?start=2024-10-01&end=2024-10-01&limit=100&page=0"
The response will give you useful details about past sessions, like session ID, room name, creation time, and participant count. If you’d like, I’m here to help you through any part of this process—just let me know! Sources: autocomplete/fish_autocomplete | Analytics API | LiveKit Docs