# Retrieve list of all chat rooms

## Get the list of all chat rooms

<mark style="color:green;">`POST`</mark> `https://api.iflychat.com/api/1.1/rooms/list`

You can use iFlyChat API to programmatically retrieve the list of all chat rooms.

#### Path Parameters

| Name     | Type   | Description                         |
| -------- | ------ | ----------------------------------- |
| api\_key | string | The private API key of your website |

{% tabs %}
{% tab title="200 It would contain room\_id, room\_name, room\_role and room\_private for all rooms of your website. It also contains length (count) of the total chat rooms." %}

```
{
  "rooms": [
    {
      "room_id": 1,
      "room_name": "test1",
      "room_role": "1",
      "room_private": "0",
      "room_moderate": "0"
    },
    {
      "room_id": 2,
      "room_name": "test2",
      "room_role": "1",
      "room_private": "0",
      "room_moderate": "0"
    },
    {
      "room_id": 3,
      "room_name": "test3",
      "room_role": "1",
      "room_private": "0",
      "room_moderate": "0"
    }
  ],
  "length": 3
}
```

{% endtab %}
{% endtabs %}

### Curl Command

This the sample curl command required to make HTTP request:

```bash
curl -H "Content-Type: application/json" -X POST https://api.iflychat.com/api/1.1/rooms/list -d "{\"api_key\":\"Wr4vpoJ_ET3lpBdX9E9TutUic4Dgb-gc7RGzuZvKqZgW5\"}"
```
