Room

Get active users

Changed on

This endpoint returns a list of users currently present in the requested room. Corresponds to liveblocks.getActiveUsers.

For optimal performance, we recommend calling this endpoint no more than once every 10 seconds. Duplicates can occur if a user is in the requested room with multiple browser tabs opened.

get/rooms/{roomId}/active-users

Request

  • Base URL: https://api.liveblocks.io/v2
  • URL: https://api.liveblocks.io/v2/rooms/{roomId}/active-users
  • Auth: none declared

Path parameters

roomIdstring required

ID of the room

Example:my-room-id

Response

Success. Returns the list of active users for the specified room.

Example response

{
  "data": [
    {
      "type": "user",
      "connectionId": 16,
      "id": "alice",
      "info": {}
    },
    {
      "type": "user",
      "connectionId": 20,
      "id": "bob",
      "info": {}
    }
  ]
}

Changes