# Retrieve a list of messages

## Get message list

<mark style="color:blue;">`GET`</mark> `https://{{account_id}}.acquire.io/api/v1/crm/messenger/chat/messages?contactId={{contactId}}&threadId={{threadId}}`

Retrieve a list of messages. The following query parameters must be present: **threadId** and **contactId**.

#### Query Parameters

| Name         | Type    | Description                                                               |
| ------------ | ------- | ------------------------------------------------------------------------- |
| -x-user-type | string  | Send this parameter with a value of "contact" to send messages to Acquire |
| threadId     | integer | ID of the thread.                                                         |
| contactId    | integer | ID of the customer/contact.                                               |

#### Headers

| Name                                            | Type   | Description         |
| ----------------------------------------------- | ------ | ------------------- |
| Authorization<mark style="color:red;">\*</mark> | string | Bearer {{API\_KEY}} |

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

```
{
    "data": [
        {
            "dateCreated": "2021-04-13T05:22:19.000Z",
            "dateUpdated": "2021-04-13T12:17:02.000Z",
            "id": 854,
            "contactId": 750940,
            "closedBy": null,
            "visitId": 222,
            "title": "#750940  : hi",
            "description": "lk",
            "channel": "chat",
            "status": "active",
            "closingState": "handled",
            "dateQueue": "2021-04-13T05:22:19.000Z",
            "datePending": "2021-04-13T05:22:19.000Z",
            "dateActive": "2021-04-13T05:22:23.000Z",
            "dateClosed": null,
            "queueId": null,
            "queueOrder": 0,
            "parentId": null,
            "userId": null,
            "waitTime": 4,
            "cases": [],
            "users": [
                {
                    "id": 2126,
                    "caseId": 854,
                    "type": "user",
                    "userId": 12,
                    "role": "owner",
                    "status": "active",
                    "dateCreated": "2021-04-13T05:22:18.000Z",
                    "dateLastAssigned": "2021-04-13T05:22:19.000Z",
                    "closed": "no",
                    "meta": null,
                    "user": {
                        "roles": [],
                        "id": 12,
                        "name": "vivek",
                        "firstName": "vivek",
                        "lastName": "",
                        "photo": "",
                        "email": "vivek@acquire.io",
                        "clientId": "",
                        "parentId": 0,
                        "type": "user",
                        "accessLevel": null
                    }
                },
                {
                    "id": 2125,
                    "caseId": 854,
                    "type": "contact",
                    "userId": 750940,
                    "role": "owner",
                    "status": "active",
                    "dateCreated": "2021-04-13T05:22:18.000Z",
                    "dateLastAssigned": "2021-04-13T05:22:18.000Z",
                    "closed": "no",
                    "meta": null,
                    "user": {
                        "type": "contact",
                        "id": 750940,
                        "name": "#750940",
                        "photo": null
                    }
                }
            ],
            "threadId": 854,
            "lastMessage": {
                "id": 3391,
                "caseId": 854,
                "channel": "chat",
                "senderId": 12,
                "senderType": "user",
                "type": "message",
                "message": "lk",
                "dateCreated": "2021-04-13T12:17:02.000Z",
                "dateUpdated": null,
                "seen": "no",
                "meta": {}
            }
        }
    ]
}
```

{% 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://developer.acquire.io/rest-apis/conversation/conversation-or-cases/messages-1/list-messages.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.
