Skip to main content

Rooms

A room is the container for a meeting. Create a room, then provide its room id and a participant token to your client application to join. All room operations are performed on the rooms resource.

Some VideoSDK APIs call this a meeting. A roomId and a meetingId are the same value, and methods that mention both accept either.

Create a room

const room = await client.rooms.create({ geoFence: "us002" });
room.roomId; // "abcd-efgh-ijkl"

Reusing a customRoomId returns the existing room instead of creating a new one, which lets you map rooms to records in your own database.

OptionTypeDescription
customRoomIdstringYour own id. Creation is idempotent on it.
geoFencestringRegion to pin the room to (us002, eu001, in002, …).
webhookobjectWebhook for this room's session events (url, events).
autoCloseConfigobjectClose the session automatically after inactivity.
autoStartConfigobjectStart recording or HLS automatically when the session begins.
allowedParticipantIdsstring[]Restrict who may join.

To start recording on the first join, pass autoStartConfig:

await client.rooms.create({
autoStartConfig: {
recording: {
config: { layout: { type: "GRID" } },
transcription: { enabled: true },
},
},
});

List rooms

Returns a page you can iterate across all pages.

for await (const room of await client.rooms.list()) {
console.log(room.roomId, room.createdAt);
}

Filters: query (an exact roomId or customRoomId), plus pagination.

Get a room

const room = await client.rooms.get("abcd-efgh-ijkl");

Accepts a roomId or customRoomId, and returns an error if the room does not exist.

Validate a room

This performs the same lookup as get but never raises an error on an unknown id. Instead, it returns a result you can inspect. Use it for ids that come from user input.

const { valid, room } = await client.rooms.validate(roomId);

End a room

Deactivates the room and ends its live session. Accepts the VideoSDK roomId, not a customRoomId.

await client.rooms.end("abcd-efgh-ijkl");

The Room object

Returned by rooms.create, rooms.get, and rooms.end, as the items of a rooms.list page, and wrapped in the result of rooms.validate.

FieldTypeDescription
roomIdstringVideoSDK room id (xxxx-xxxx-xxxx).
customRoomIdstringYour id, if set.
geoFencestringRegion.
disabledbooleanWhether the room has been ended.
createdAt / updatedAtstringISO timestamps.

Got a Question? Ask us on discord