> ## Documentation Index
> Fetch the complete documentation index at: https://developer.rocket.chat/llms.txt
> Use this file to discover all available pages before exploring further.

# Get List of Omnichannel Rooms

> Retrieves a list of Omnichannel rooms. You can use the available query parameters to filter the response.
At least one of the following permissions is required:
* `view-livechat-rooms`
* `view-l-room`

### Changelog
| Version      | Description |
| ---------------- | ------------|
|7.0.0             | Remove support of filtering by agent's username |
|2.4.0             | Added support to the parameter `roomName`|
|2.0.0             | Added       |

## OpenAPI

````json GET /api/v1/livechat/rooms
{
  "openapi": "3.0.0",
  "info": {
    "version": "1.0.0",
    "title": "Omnichannel"
  },
  "servers": [
    {
      "url": "https://apiexplorer.support.rocket.chat"
    }
  ],
  "tags": [
    {
      "name": "Omnichannel Users"
    },
    {
      "name": "Omnichannel Agents"
    },
    {
      "name": "Omnichannel Monitors"
    },
    {
      "name": "Omnichannel Visitors"
    },
    {
      "name": "Omnichannel Contacts"
    },
    {
      "name": "Omnichannel Rooms"
    },
    {
      "name": "Omnichannel Departments"
    },
    {
      "name": "Omnichannel Custom Fields"
    },
    {
      "name": "Omnichannel Business Hours"
    },
    {
      "name": "Omnichannel Priorities"
    },
    {
      "name": "Omnichannel Tags"
    },
    {
      "name": "Omnichannel Units"
    },
    {
      "name": "SLA Policies"
    },
    {
      "name": "Canned Responses"
    },
    {
      "name": "Omnichannel Transcript"
    },
    {
      "name": "Omnichannel Statistics"
    },
    {
      "name": "Omnichannel Agent Stats"
    },
    {
      "name": "Omnichannel Dashboards"
    },
    {
      "name": "Reports"
    },
    {
      "name": "Omnichannel Inquiries"
    },
    {
      "name": "Omnichannel Webhooks"
    },
    {
      "name": "Livechat"
    },
    {
      "name": "Livechat Appearance"
    },
    {
      "name": "Livechat Triggers"
    },
    {
      "name": "Livechat Messages"
    },
    {
      "name": "Livechat Page Visited"
    }
  ],
  "paths": {
    "/api/v1/livechat/rooms": {
      "get": {
        "summary": "Get List of Omnichannel Rooms",
        "description": "Retrieves a list of Omnichannel rooms. You can use the available query parameters to filter the response.\nAt least one of the following permissions is required:\n* `view-livechat-rooms`\n* `view-l-room`\n\n### Changelog\n| Version      | Description |\n| ---------------- | ------------|\n|7.0.0             | Remove support of filtering by agent's username |\n|2.4.0             | Added support to the parameter `roomName`|\n|2.0.0             | Added       |",
        "operationId": "get-api-v1-livechat-rooms",
        "parameters": [
          {
            "$ref": "#/components/parameters/AuthToken"
          },
          {
            "$ref": "#/components/parameters/UserId"
          },
          {
            "name": "agents",
            "in": "query",
            "description": "A list of agent IDs.",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "example": "['b32h3b2hhwb25d']"
          },
          {
            "name": "departmentId",
            "in": "query",
            "description": "The department ID. You can also enter multiple IDs as an array of string values.",
            "schema": {
              "type": "string"
            },
            "example": "AkzpHAvZpdnuchw2a"
          },
          {
            "name": "open",
            "in": "query",
            "description": "If it should filter by open/closed rooms.",
            "schema": {
              "type": "boolean"
            },
            "example": "true"
          },
          {
            "name": "createdAt",
            "in": "query",
            "description": "An object representing when the room was created (can also be filtered only with `start` or `end`).",
            "schema": {
              "type": "string"
            },
            "example": "{\"start\": \"2018-01-26T00:11:22.345Z\", \"end\": \"2018-01-26T00:11:22.345Z\"}"
          },
          {
            "name": "closedAt",
            "in": "query",
            "description": "An object representing when the room was closed (can also be filtered only with `start` or `end`).",
            "schema": {
              "type": "string"
            },
            "example": "{\"start\": \"2018-01-26T00:11:22.345Z\", \"end\": \"2018-01-26T00:11:22.345Z\"}"
          },
          {
            "name": "tags",
            "in": "query",
            "description": "A list of tags.",
            "schema": {
              "type": "string"
            },
            "example": "['rocket', 'chat']"
          },
          {
            "name": "customFields",
            "in": "query",
            "description": "An object with custom fields to be filtered (previously created and populated at custom fields endpoints)",
            "schema": {
              "type": "string"
            },
            "example": "{\"docId\": \"aobEdbYhXfu5hkeqG\"}"
          },
          {
            "name": "roomName",
            "in": "query",
            "description": "The room's name.",
            "schema": {
              "type": "string"
            },
            "example": "room-name"
          },
          {
            "schema": {
              "type": "boolean"
            },
            "in": "query",
            "name": "onhold",
            "description": "Whether you want to include rooms that are on hold or not."
          },
          {
            "schema": {
              "type": "string"
            },
            "in": "query",
            "name": "queued",
            "description": "Whether you want to include queued rooms or not."
          },
          {
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "example": "['b32h3b2hhwb25d', 'b32h3b2aaaa']",
            "in": "query",
            "name": "units",
            "description": "Enter the unit IDs you want to include as an array of string values."
          },
          {
            "$ref": "#/components/parameters/offset"
          },
          {
            "$ref": "#/components/parameters/count"
          },
          {
            "$ref": "#/components/parameters/sort"
          },
          {
            "$ref": "#/components/parameters/fields"
          },
          {
            "$ref": "#/components/parameters/query"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "rooms": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "_id": {
                            "type": "string"
                          },
                          "msgs": {
                            "type": "integer"
                          },
                          "usersCount": {
                            "type": "integer"
                          },
                          "lm": {
                            "type": "string"
                          },
                          "fname": {
                            "type": "string"
                          },
                          "t": {
                            "type": "string"
                          },
                          "ts": {
                            "type": "string"
                          },
                          "v": {
                            "type": "object",
                            "properties": {
                              "_id": {
                                "type": "string"
                              },
                              "username": {
                                "type": "string"
                              },
                              "token": {
                                "type": "string"
                              },
                              "status": {
                                "type": "string"
                              }
                            }
                          },
                          "servedBy": {
                            "type": "object",
                            "properties": {
                              "_id": {
                                "type": "string"
                              },
                              "username": {
                                "type": "string"
                              },
                              "ts": {
                                "type": "string"
                              }
                            }
                          },
                          "cl": {
                            "type": "boolean"
                          },
                          "open": {
                            "type": "boolean"
                          },
                          "waitingResponse": {
                            "type": "boolean"
                          },
                          "departmentId": {
                            "type": "string"
                          },
                          "_updatedAt": {
                            "type": "string"
                          },
                          "lastMessage": {
                            "type": "object",
                            "properties": {
                              "_id": {
                                "type": "string"
                              },
                              "rid": {
                                "type": "string"
                              },
                              "msg": {
                                "type": "string"
                              },
                              "token": {
                                "type": "string"
                              },
                              "alias": {
                                "type": "string"
                              },
                              "ts": {
                                "type": "string"
                              },
                              "u": {
                                "type": "object",
                                "properties": {
                                  "_id": {
                                    "type": "string"
                                  },
                                  "username": {
                                    "type": "string"
                                  },
                                  "name": {
                                    "type": "string"
                                  }
                                }
                              },
                              "_updatedAt": {
                                "type": "string"
                              },
                              "mentions": {
                                "type": "array",
                                "items": {
                                  "type": "object"
                                }
                              },
                              "channels": {
                                "type": "array",
                                "items": {
                                  "type": "object"
                                }
                              },
                              "newRoom": {
                                "type": "boolean"
                              },
                              "showConnecting": {
                                "type": "boolean"
                              }
                            }
                          },
                          "metrics": {
                            "type": "object",
                            "properties": {
                              "v": {
                                "type": "object",
                                "properties": {
                                  "lq": {
                                    "type": "string"
                                  }
                                }
                              }
                            }
                          },
                          "livechatData": {
                            "type": "object",
                            "properties": {
                              "docId": {
                                "type": "string"
                              }
                            }
                          },
                          "tags": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "name": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "count": {
                      "type": "integer"
                    },
                    "offset": {
                      "type": "integer"
                    },
                    "total": {
                      "type": "integer"
                    },
                    "success": {
                      "type": "boolean"
                    }
                  }
                },
                "examples": {
                  "Success Example": {
                    "value": {
                      "rooms": [
                        {
                          "_id": "9dQMveZhqxiDgCM3B",
                          "msgs": "1",
                          "usersCount": "1",
                          "lm": "2019-08-09T20:18:02.35Z",
                          "fname": "Marcos Defendi",
                          "t": "l",
                          "ts": "2019-08-09T20:18:02.108Z",
                          "v": {
                            "_id": "xh45w4y7oPW5SiMJu",
                            "username": "guest-4",
                            "token": "xn5hdkyptei11m07f3me",
                            "status": "online"
                          },
                          "servedBy": {
                            "_id": "3kyWm8PsmwhC7xgwg",
                            "username": "marcos",
                            "ts": "2019-08-09T20:18:02.109Z"
                          },
                          "cl": "false",
                          "open": "true",
                          "waitingResponse": "true",
                          "departmentId": "xnmXQmytuvxp2TuSC",
                          "_updatedAt": "2019-08-09T20:19:34.856Z",
                          "lastMessage": {
                            "_id": "TBEz7zSCBaKsfyrzc",
                            "rid": "9dQMveZhqxiDgCM3B",
                            "msg": "Hello",
                            "token": "xn5hdkyptei11m07f3me",
                            "alias": "Marcos Defendi",
                            "ts": "2019-08-09T20:18:02.35Z",
                            "u": {
                              "_id": "xh45w4y7oPW5SiMJu",
                              "username": "guest-4",
                              "name": "Marcos Defendi"
                            },
                            "_updatedAt": "2019-08-09T20:18:02.383Z",
                            "mentions": [],
                            "channels": [],
                            "newRoom": "false",
                            "showConnecting": "false"
                          },
                          "metrics": {
                            "v": {
                              "lq": "2019-08-09T20:18:02.35Z"
                            }
                          },
                          "livechatData": {
                            "docId": "0310584343112"
                          },
                          "tags": [
                            "rocket",
                            "chat"
                          ],
                          "name": "Marcos Defendi"
                        }
                      ],
                      "count": "1",
                      "offset": "1",
                      "total": "7",
                      "success": "true"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/authorizationError"
          },
          "403": {
            "$ref": "#/components/responses/permissionError"
          }
        },
        "tags": [
          "Omnichannel Rooms"
        ]
      }
    }
  },
  "components": {
    "parameters": {
      "AuthToken": {
        "name": "X-Auth-Token",
        "in": "header",
        "description": "The `authToken` of the authenticated user.",
        "required": "true",
        "schema": {
          "type": "string"
        },
        "example": "RScctEHSmLGZGywfIhWyRpyofhKOiMoUIpimhvheU3f"
      },
      "UserId": {
        "name": "X-User-Id",
        "in": "header",
        "description": "The `userId` of the authenticated user.",
        "required": "true",
        "schema": {
          "type": "string"
        },
        "example": "rbAXPnMktTFbNpwtJ"
      },
      "offset": {
        "name": "offset",
        "in": "query",
        "required": "false",
        "schema": {
          "type": "integer"
        },
        "example": "50",
        "description": "Number of items to \"skip\" in the query, i.e. requests return count items, skipping the first offset items. Refer to the [official documentation](https://developer.rocket.chat/apidocs/query-parameters#pagination) to learn more."
      },
      "count": {
        "name": "count",
        "in": "query",
        "required": "false",
        "schema": {
          "type": "integer"
        },
        "example": "25",
        "description": "The number of items to return. Refer to the [official documentation](https://developer.rocket.chat/apidocs/query-parameters#pagination) to learn more."
      },
      "sort": {
        "name": "sort",
        "in": "query",
        "required": "false",
        "schema": {
          "format": "object"
        },
        "description": "List of fields to order by, and in which direction. JSON object, with properties listed in desired order, with values of 1 for ascending, or -1 for descending. For example, sort = `{\"value\": -1, \"_id\": 1}`. Refer to the [official documentation](https://developer.rocket.chat/apidocs/query-parameters#pagination) to learn more."
      },
      "fields": {
        "name": "fields",
        "in": "query",
        "schema": {},
        "description": "This parameter accepts a JSON object with properties that have a value of 1 or 0 to include or exclude them in the response. For example, to only retrieve the usernames of users: fields = `{\"username\": 1}`. Refer to the [official documentation](https://developer.rocket.chat/apidocs/query-parameters#query-and-fields) to learn more."
      },
      "query": {
        "name": "query",
        "in": "query",
        "required": "false",
        "schema": {},
        "description": "This parameter allows you to use MongoDB query operators to search for specific data. For example, to query users with a name that contains the letter \"g\": query = `{ \"name\": { \"$regex\": \"g\" } }`. Refer to the [official documentation](https://developer.rocket.chat/apidocs/query-parameters#query-and-fields) to learn more. "
      }
    },
    "responses": {
      "authorizationError": {
        "description": "Unauthorized",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "status": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            },
            "examples": {
              "Authorization Error": {
                "value": {
                  "status": "error",
                  "message": "You must be logged in to do this."
                }
              }
            }
          }
        }
      },
      "permissionError": {
        "description": "Forbidden",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean"
                },
                "error": {
                  "type": "string"
                }
              }
            },
            "examples": {
              "Permission Error": {
                "value": {
                  "success": "false",
                  "error": "User does not have the permissions required for this action [error-unauthorized]"
                }
              },
              "Unauthorized": {
                "value": {
                  "success": "false",
                  "error": "unauthorized"
                }
              }
            }
          }
        }
      }
    }
  }
}
````

