Room

This endpoint returns a list of your rooms. The rooms are returned sorted by creation date, from newest to oldest. You can filter rooms by room ID prefixes, metadata, users accesses, and groups accesses. Corresponds to liveblocks.getRooms.

There is a pagination system where the cursor to the next page is returned in the response as nextCursor, which can be combined with startingAfter. You can also limit the number of rooms by query.

Filtering by metadata works by giving key values like metadata.color=red. Of course you can combine multiple metadata clauses to refine the response like metadata.color=red&metadata.type=text. Notice here the operator AND is applied between each clauses.

Filtering by groups or userId works by giving a list of groups like groupIds=marketing,GZo7tQ,product or/and a userId like userId=user1. Notice here the operator OR is applied between each groupIds and the userId.

get/rooms

Request

  • Base URL: https://api.liveblocks.io/v2
  • URL: https://api.liveblocks.io/v2/rooms
  • Auth: none declared

Query parameters

limitinteger

A limit on the number of rooms to be returned. The limit can range between 1 and 100, and defaults to 20.

Example:20
startingAfterstring

A cursor used for pagination. Get the value from the nextCursor response of the previous page.

Example:eyJjcmVhdGVkQXQiOjE2NjAwMDA5ODgxMzd9
organizationIdstring

A filter on organization ID.

Example:org_123456789
querystring

Query to filter rooms. You can filter by roomId and metadata, for example, metadata["roomType"]:"whiteboard" AND roomId^"liveblocks:engineering". Learn more about filtering rooms with query language.

Example:metadata["color"]:"blue"
userIdstring

A filter on users accesses.

Example:user-123
groupIdsstring

A filter on groups accesses. Multiple groups can be used.

Example:group1,group2

Response

Success. Returns the list of rooms, the next page cursor, and the next page URL.

nextCursorstring nullable required

Example response

{
  "nextCursor": "eyJjcmVhdGVkQXQiOjE2NjAwMDA5ODgxMzd9",
  "data": [
    {
      "type": "room",
      "id": "my-room-id",
      "lastConnectionAt": "2022-08-08T23:23:15.281Z",
      "createdAt": "2022-08-08T23:23:15.281Z",
      "organizationId": "org_123456789",
      "metadata": {
        "color": "blue"
      },
      "defaultAccesses": [
        "*:write"
      ],
      "groupsAccesses": {
        "product": [
          "*:write"
        ]
      },
      "usersAccesses": {
        "alice": [
          "*:write"
        ]
      }
    }
  ]
}

Changes

    • warning

      added the new comments:private:none enum value to the /// response property for the response status

    • warning

      added the new comments:private:none enum value to the //// response property for the response status

    • warning

      added the new comments:private:none enum value to the //// response property for the response status

    • warning

      added the new comments:private:read enum value to the /// response property for the response status

    • warning

      added the new comments:private:read enum value to the //// response property for the response status

    • warning

      added the new comments:private:read enum value to the //// response property for the response status

    • warning

      added the new comments:private:write enum value to the /// response property for the response status

    • warning

      added the new comments:private:write enum value to the //// response property for the response status

    • warning

      added the new comments:private:write enum value to the //// response property for the response status

    • warning

      added the new comments:public:none enum value to the /// response property for the response status

    • warning

      added the new comments:public:none enum value to the //// response property for the response status

    • warning

      added the new comments:public:none enum value to the //// response property for the response status

    • warning

      added the new comments:public:read enum value to the /// response property for the response status

    • warning

      added the new comments:public:read enum value to the //// response property for the response status

    • warning

      added the new comments:public:read enum value to the //// response property for the response status

    • warning

      added the new comments:public:write enum value to the /// response property for the response status

    • warning

      added the new comments:public:write enum value to the //// response property for the response status

    • warning

      added the new comments:public:write enum value to the //// response property for the response status

    • warning

      added the new *:read enum value to the /// response property for the response status

    • warning

      added the new *:read enum value to the //// response property for the response status

    • warning

      added the new *:read enum value to the //// response property for the response status

    • warning

      added the new *:write enum value to the /// response property for the response status

    • warning

      added the new *:write enum value to the //// response property for the response status

    • warning

      added the new *:write enum value to the //// response property for the response status

    • warning

      added the new comments:none enum value to the /// response property for the response status

    • warning

      added the new comments:none enum value to the //// response property for the response status

    • warning

      added the new comments:none enum value to the //// response property for the response status

    • warning

      added the new comments:read enum value to the /// response property for the response status

    • warning

      added the new comments:read enum value to the //// response property for the response status

    • warning

      added the new comments:read enum value to the //// response property for the response status

    • warning

      added the new feeds:none enum value to the /// response property for the response status

    • warning

      added the new feeds:none enum value to the //// response property for the response status

    • warning

      added the new feeds:none enum value to the //// response property for the response status

    • warning

      added the new feeds:read enum value to the /// response property for the response status

    • warning

      added the new feeds:read enum value to the //// response property for the response status

    • warning

      added the new feeds:read enum value to the //// response property for the response status

    • warning

      added the new feeds:write enum value to the /// response property for the response status

    • warning

      added the new feeds:write enum value to the //// response property for the response status

    • warning

      added the new feeds:write enum value to the //// response property for the response status

    • warning

      added the new storage:none enum value to the /// response property for the response status

    • warning

      added the new storage:none enum value to the //// response property for the response status

    • warning

      added the new storage:none enum value to the //// response property for the response status

    • warning

      added the new storage:read enum value to the /// response property for the response status

    • warning

      added the new storage:read enum value to the //// response property for the response status

    • warning

      added the new storage:read enum value to the //// response property for the response status

    • warning

      added the new storage:write enum value to the /// response property for the response status

    • warning

      added the new storage:write enum value to the //// response property for the response status

    • warning

      added the new storage:write enum value to the //// response property for the response status