i want api, or sdk TS, that get all livekit rooms,...
# ask-ai
s
i want api, or sdk TS, that get all livekit rooms, that already ended, not live only
t
Thanks for reaching out, Mostafa. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — you're asking for an API/TypeScript SDK that returns rooms that have already ended (not just live rooms). Short answer: LiveKit does not provide a method to list historical/ended rooms. What you can do: • Use
RoomServiceClient.listRooms()
to get currently active rooms. • Use webhooks to capture
room_finished
events and persist ended-room metadata (room SID, name, timestamps) in your own database so you can query them later. Would you like a Node.js/TypeScript webhook handler example that saves
room_finished
events to a database (and which DB do you use)? Sources: server-sdk-js | livekit/livekit_composite | DeepWiki | Server-side | livekit/livekit_composite | DeepWiki | server-sdk-ruby | livekit/livekit_composite | DeepWiki
s
what about Metrics export APIs ?
t
You're asking whether Metrics export APIs can give you a list of rooms that have already ended. Short answer: Metrics export APIs are not a replacement for listing ended rooms. They provide aggregated usage/metrics data (available on Scale/Enterprise plans) and do not serve as a historical room-listing API. What to use instead: • Use webhooks and handle the
room_finished
event, persisting room metadata (SID, name, timestamps) to your DB. • Continue to use
RoomServiceClient.listRooms()
for active rooms. Would you like: • a TypeScript webhook handler example that saves
room_finished
events, or • details on what metrics the Metrics export can provide and how to enable it on your plan? Sources: LiveKit Pricing | server-sdk-ruby | livekit/livekit_composite | DeepWiki | Announcing LiveKit Cloud | Server-side | livekit/livekit_composite | DeepWiki
s
from where can i access agent dispatch errors, that are hosted in my machine ?
t
You're asking where to find agent dispatch errors for an agent running on your machine. Short answer: check the agent's logs on the host where the agent process runs. For locally hosted agents those logs usually appear in the console where you started the agent, or in any log file you configured. What to check next: • Console where you run the agent (e.g., the terminal running
cli.run_app(server)
) — dispatch errors and stack traces are output there by default. • Any configured log file or logging framework your agent uses (check your agent startup/ config for file paths or a logging sink). • Agent code entrypoint for error handlers — add or extend logging around the dispatch handler to capture
job
context and
dispatch
errors (use
ctx.log_context_fields
or similar hooks to include job metadata). • If the agent is deployed to LiveKit Cloud, use
lk agent logs
to view logs remotely. If you want, tell me: • how you start the agent (command or script), • whether you already have a logging config or file path, • and which runtime/language you’re using, and I’ll give a concise code example to capture and persist dispatch errors to a file (or to the console with richer context). Sources: Simple Call Answering Agent | LiveKit docs | Job lifecycle | LiveKit docs | Deploying to production | LiveKit Docs | Agent dispatch | LiveKit docs