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
- Node.js
- Go
- Rust
const room = await client.rooms.create({ geoFence: "us002" });
room.roomId; // "abcd-efgh-ijkl"
room, err := client.Rooms.Create(ctx, videosdk.RoomCreateParams{
GeoFence: videosdk.String(videosdk.RegionUS002),
})
let room = client.rooms().create(videosdk::RoomCreateParams {
geo_fence: Some(videosdk::Region::US002),
..Default::default()
}).await?;
room.room_id; // "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.
| Option | Type | Description |
|---|---|---|
customRoomId | string | Your own id. Creation is idempotent on it. |
geoFence | string | Region to pin the room to (us002, eu001, in002, …). |
webhook | object | Webhook for this room's session events (url, events). |
autoCloseConfig | object | Close the session automatically after inactivity. |
autoStartConfig | object | Start recording or HLS automatically when the session begins. |
allowedParticipantIds | string[] | Restrict who may join. |
To start recording on the first join, pass autoStartConfig:
- Node.js
- Go
- Rust
await client.rooms.create({
autoStartConfig: {
recording: {
config: { layout: { type: "GRID" } },
transcription: { enabled: true },
},
},
});
room, err := client.Rooms.Create(ctx, videosdk.RoomCreateParams{
AutoStartConfig: &videosdk.AutoStartConfig{
Recording: map[string]any{
"config": map[string]any{"layout": map[string]any{"type": "GRID"}},
"transcription": map[string]any{"enabled": true},
},
},
})
use serde_json::json;
client.rooms().create(videosdk::RoomCreateParams {
auto_start_config: Some(videosdk::AutoStartConfig {
recording: Some(json!({
"config": { "layout": { "type": "GRID" } },
"transcription": { "enabled": true },
})),
..Default::default()
}),
..Default::default()
}).await?;
List rooms
Returns a page you can iterate across all pages.
- Node.js
- Go
- Rust
for await (const room of await client.rooms.list()) {
console.log(room.roomId, room.createdAt);
}
for room, err := range client.Rooms.ListAutoPaging(ctx, videosdk.RoomListParams{}) {
if err != nil {
return err
}
fmt.Println(room.RoomID, room.CreatedAt)
}
use futures_util::StreamExt;
let mut rooms = Box::pin(client.rooms().list_stream(videosdk::RoomListParams::default()));
while let Some(room) = rooms.next().await {
let room = room?;
println!("{} {:?}", room.room_id, room.created_at);
}
Filters: query (an exact roomId or customRoomId), plus pagination.
Get a room
- Node.js
- Go
- Rust
const room = await client.rooms.get("abcd-efgh-ijkl");
room, err := client.Rooms.Get(ctx, "abcd-efgh-ijkl")
let room = client.rooms().get("abcd-efgh-ijkl").await?;
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.
- Node.js
- Go
- Rust
const { valid, room } = await client.rooms.validate(roomId);
result, err := client.Rooms.Validate(ctx, roomID)
if result.Valid {
// result.Room is the resolved room
}
let result = client.rooms().validate(room_id).await?;
if result.valid {
// result.room is the resolved room
}
End a room
Deactivates the room and ends its live session. Accepts the VideoSDK roomId, not a customRoomId.
- Node.js
- Go
- Rust
await client.rooms.end("abcd-efgh-ijkl");
room, err := client.Rooms.End(ctx, "abcd-efgh-ijkl")
let room = client.rooms().end("abcd-efgh-ijkl").await?;
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.
| Field | Type | Description |
|---|---|---|
roomId | string | VideoSDK room id (xxxx-xxxx-xxxx). |
customRoomId | string | Your id, if set. |
geoFence | string | Region. |
disabled | boolean | Whether the room has been ended. |
createdAt / updatedAt | string | ISO timestamps. |
Got a Question? Ask us on discord

