how can i check if there a livekit room with id x,...
# ask-ai
s
how can i check if there a livekit room with id x, and if there recording for it or not?
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 how to (1) check if a LiveKit room with ID X exists, and (2) check if there's a recording for it. Here are the practical ways to do both. 1) Check if a room exists • Use the Server SDK ListRooms API to list active rooms and look for the room SID (or name). ListRooms only returns currently active rooms, so a room that has already ended will not appear. • Example flow: a. Call ListRooms. b. Search the returned rooms for
room.Sid == "X"
(or match by name if you only have the name). c. If found → the room is active; if not found → the room is not currently active. 2) Check if a recording exists for that room • Use the ListEgress API to list egress (recording/stream) sessions and filter by the room SID or room name. • Check egress items where
egress.RoomSid == "X"
(or matching name) and
egress.Status
is
EGRESS_ENDED
(or
EGRESS_ENDING
depending on timing). The
Output
field contains the recording location (e.g., S3 path) when the egress has finished. • Alternatively, subscribe to the
egress_ended
webhook to be notified when a recording completes; the webhook includes
egress_info
with recording details. If you want, tell me: • Which Server SDK/language you’re using (Go, Node, Ruby, Python), and • Whether you have the room SID or only the room name. I can then provide a concise code snippet for your SDK or exact request payloads. Sources: Server-side | livekit/livekit_composite | DeepWiki | server-sdk-js | livekit/livekit_composite | DeepWiki | server-sdk-ruby | livekit/livekit_composite | DeepWiki | Python SDKs | livekit/livekit_composite | DeepWiki