# List chats

## Request <a href="#request" id="request"></a>

### Url

```
GET 
https://wilson.40mat.com/apif/v2/chat
```

### Headers

<pre><code><strong>AUTH
</strong>Bearer "eyJ0eXAiOiJKV1QiLCJub25jZSI6IndUZXphSTNjdTNVYj..."
</code></pre>

### Parameters

* `archived` (boolean): Indicate if request for active or archived chats. \
  Default = false.&#x20;
* `offset` (integer) (Optional): Indicate offset index to start query on list. \
  Default = 0.
* `limit` (integer) (Optional): Indicate max number of results to return. \
  Default = 20.

### Body

```
No body is required for this endpoint.
```

***

## Response&#x20;

The response will be a JSON array containing `chat` conversation objects with the following properties:

* `company_id` (string): The ID of the company associated with the chat conversation.&#x20;
* `create_at` (string): The timestamp of the chat conversation creation.&#x20;
* `id` (string): The unique identifier of the chat conversation.&#x20;
* `members` (array): An array of member IDs participating in the chat conversation.&#x20;
* `title` (string): The title of the chat conversation.&#x20;
* `update_at` (string): The timestamp of the chat conversation update.

```json
[
    {
        "archived": false,
        "company_id": "40factory",
        "create_at": "Tue, 18 Jun 2024 14:45:02 GMT",
        "id": "66719d6ee7b5d65398...",
        "members": [
            "6564c3d7532e41a123..."
        ],
        "title": "Previous chats",
        "update_at": "Tue, 18 Jun 2024 14:45:02 GMT"
    }
]
```

***

## Code example

{% tabs %}
{% tab title="Python" %}

```python
import requests

url = "https://wilson.40mat.com/apif/v2/chat?archived=false"

payload = {}

headers = {
  'Authorization': '••••••'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)
```

{% endtab %}

{% tab title="cURL" %}

```powershell
curl --location 'https://wilson.40mat.com/apif/v2/chat?archived=false' \
--header 'Authorization: ••••••'
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://40factory.gitbook.io/wilson/3.10/rest-api/chat/list-chats.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
