type: object
description: |
    Real-time view of a room — `LiveRoom` from
    [`cloud/src/Schemas.ts`](../../../../cloud/src/Schemas.ts). The
    Redis-backed snapshot tracking participants, server assignment,
    screens, and instance state.

    Note that **most cloud-api routes that look like they return a
    `LiveRoom` actually return a [`PublicRoom`](./PublicRoom.yaml)** —
    the sanitised projection built for VR clients. `LiveRoom` is the
    internal storage shape used by admin endpoints
    (`/admin/rooms/live`, `/admin/room/{id}/live`).
required: [roomId]
properties:
    roomId: { type: string }
    createdAt:
        type: integer
        description: |
            `createdAt` of the underlying `StoredRoom` — Unix milliseconds.
    instanceCreatedAt:
        type: integer
        description: When this `LiveRoom` instance was bootstrapped — Unix milliseconds.
    visibility:
        type: string
        description: "`RoomVisibility` — `Public`, `Private`, `FriendsOnly`. Deprecated; check `legacyVisibility` too."
    roomType:
        type: string
        description: "`RoomType` — `Room`, `Channel`, `Lobby`, etc."
    inviteCode:
        type: string
        description: Deprecated — prefer `storedRoomSnapshot.inviteCode`.
    ownerSocialProfile:
        description: |
            `SocialProfile` of the room owner — unset for unowned rooms
            (lobbies, TV channels).
        oneOf:
            - $ref: "./SocialProfile.yaml"
            - type: "null"
    storedRoomSnapshot:
        $ref: "./StoredRoom.yaml"
        description: Snapshot of the underlying `StoredRoom` (or generated for lobby / TV rooms).
    environment:
        type: object
        description: "`Environment` instance — the loaded room theme / scene."
        additionalProperties: true
    status:
        type: string
        description: "`LiveRoomStatus` — used by the client to detect migrations or room errors."
    adminUserIds:
        type: array
        items: { type: string }
    mediaServer:
        type: object
        description: "`MediaServer` instance currently hosting the room — admin shape (full data)."
        additionalProperties: true
    participantsIndex:
        type: object
        description: |
            Map from `userSessionId` to `roomInstanceId` — fast lookup of
            the instance a given participant is in.
        additionalProperties: { type: string }
    roomInstanceParticipantsIndex:
        type: object
        description: |
            Map from `roomInstanceId` to `RoomInstanceParticipantsInfo` —
            the inverse index, used to enumerate who is in a given
            instance.
        additionalProperties:
            type: object
            additionalProperties: true
    screens:
        type: array
        description: Screens currently in the room (admin shape — raw `Screen`).
        items:
            type: object
            additionalProperties: true
    primaryScreenIndex: { type: integer }
    legacyVisibility:
        type: string
        description: "Old-style `RoomVisibility`. Some legacy clients read this instead of `visibility`."
    contextAppName:
        type: string
        description: App-name of the bearer token that originally created the room.
    contextAppVersion:
        type: string
        description: Minimum app version a joiner must have (the app version of the bearer that created the room).
example:
    roomId: "room:abc1234567"
    createdAt: 1761127240000
    instanceCreatedAt: 1762462000000
    visibility: "FriendsOnly"
    roomType: "Room"
    inviteCode: "BLUE-LION-9421"
    adminUserIds: ["sess_01HZP12345"]
    participantsIndex:
        sess_01HZP12345: "inst_01HZP67890"
    roomInstanceParticipantsIndex: {}
    screens: []
    primaryScreenIndex: 0
    legacyVisibility: "Public"
    contextAppName: "bigscreen-unity"
    contextAppVersion: "1.42.0"
