> For the complete documentation index, see [llms.txt](https://docs.cartat.net/cartat-api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cartat.net/cartat-api/whatsapp-api/chats/chats-chat_id.md).

# Chats/{chat\_id}

**if you need to get a specific chat on WhatsApp using chat ID ( mobile number )**

## get a specific chat with messages on WhatsApp using chat ID ( mobile number )

<mark style="color:blue;">`GET`</mark> `https://api.cartat.net/chats/9665xxxxxxx`

please make sure to pass the mobile number with the country code without + or 0 at the start of the number, eg.

&#x20;✅ 966500000000\
&#x20;❌ 0096650000000\
&#x20;❌ +96605000000

#### Headers

| Name                                            | Type             | Description                                                       |
| ----------------------------------------------- | ---------------- | ----------------------------------------------------------------- |
| Accept<mark style="color:red;">\*</mark>        | application/json |                                                                   |
| Content-Type<mark style="color:red;">\*</mark>  | application/json |                                                                   |
| Authorization<mark style="color:red;">\*</mark> | Bearer {{token}} | you can find your access token [here](/cartat-api/get-started.md) |

#### Request Body

| Name  | Type | Description                                                                                                                                                                                                                                                                                               |
| ----- | ---- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| limit | 50   | The amount of messages to return. If no limit is specified, the available messages will be returned. Note that the actual number of returned messages may be smaller if there aren't enough messages in the conversation. Set this to <mark style="color:blue;">**Infinity**</mark> to load all messages. |

{% tabs %}
{% tab title="200: OK Successful response" %}

```json
{
    "status": "success",
    "chat": {
        "id": {
            "server": "c.us",
            "user": "9665000000000",
            "_serialized": "9665000000000@c.us"
        },
        "name": "Jhone Due",
        "isGroup": false,
        "isReadOnly": false,
        "unreadCount": 0,
        "timestamp": 1698317263,
        "archived": false,
        "pinned": false,
        "isMuted": false,
        "muteExpiration": 0
    },
    "messages": [
        {
            "_data": {
                "id": {
                    "fromMe": false,
                    "remote": "9665000000000@c.us",
                    "id": "3A1F984EA234C4",
                    "_serialized": "false_9665000000000@c.us_3A1F984EA23D284164C4"
                },
                "rowId": 1001213641,
                "viewed": false,
                "body": "بوت",
                "type": "chat",
                "t": 1691347263,
                "from": {
                    "server": "c.us",
                    "user": "9665000000000",
                    "_serialized": "9665000000000@c.us"
                },
                "to": {
                    "server": "c.us",
                    "user": "966531896270",
                    "_serialized": "966531896270@c.us"
                },
                "self": "in",
                "ack": 3,
                "invis": true,
                "star": false,
                "kicNotified": false,
                "isFromTemplate": false,
                "pollOptions": [],
                "pollInvalidated": false,
                "latestEditMsgKey": null,
                "latestEditSenderTimestampMs": null,
                "mentionedJidList": [],
                "groupMentions": [],
                "isVcardOverMmsDocument": false,
                "isForwarded": false,
                "labels": [],
                "hasReaction": false,
                "productHeaderImageRejected": false,
                "lastPlaybackProgress": 0,
                "isDynamicReplyButtonsMsg": false,
                "isMdHistoryMsg": false,
                "stickerSentTs": 0,
                "isAvatar": false,
                "lastUpdateFromServerTs": 0,
                "requiresDirectConnection": false,
                "invokedBotWid": null,
                "links": []
            },
            "id": {
                "fromMe": false,
                "remote": "9665000000000@c.us",
                "id": "3A1F984EA23D284164C4",
                "_serialized": "false_9665000000000@c.us_3B1F982EA23184164C4"
            },
            "ack": 3,
            "hasMedia": false,
            "body": "بوت",
            "type": "chat",
            "timestamp": 16983472633,
            "from": "9665000000000@c.us",
            "to": "966531896270@c.us",
            "deviceType": "ios",
            "isForwarded": false,
            "forwardingScore": 0,
            "isStatus": false,
            "isStarred": false,
            "fromMe": false,
            "hasQuotedMsg": false,
            "hasReaction": false,
            "vCards": [],
            "mentionedIds": [],
            "isGif": false,
            "links": []
        }
    ]
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.cartat.net/cartat-api/whatsapp-api/chats/chats-chat_id.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
