> For the complete documentation index, see [llms.txt](https://docs.360dialog.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.360dialog.com/docs/inbox/inbox-api/reading-conversations.md).

# Reading conversations

List your conversations and read their history.

Two endpoints cover it: [`/chats/`](/docs/inbox/inbox-api/api-ref/chats.md#get-api-v1-chats) for the list of conversations, and [`/messages/`](/docs/inbox/inbox-api/api-ref/messages.md#get-api-v1-messages) for what was said in each one.

{% stepper %}
{% step %}
**List your chats**

```bash
curl -H "Authorization: Token $SERVICE_TOKEN" $INBOX/api/v1/chats/
```

Chats come back with the most recent conversation first. Each one has the `contact` you are talking to, its `wa_id`, and `new_messages` — how many messages this user has not yet received.

To get only chats with something new, add `?unread=true`.

Reference: [List chats](/docs/inbox/inbox-api/api-ref/chats.md#get-api-v1-chats)
{% endstep %}

{% step %}
**Read a conversation**

```bash
curl -H "Authorization: Token $SERVICE_TOKEN" "$INBOX/api/v1/messages/?wa_id=$WA_ID&limit=20"
```

You get the 20 most recent messages, newest first. Each message has:

* `waba_payload` — the message exactly as WhatsApp sent it: `type`, `text`, `timestamp`, media and so on
* `from_us` — `false` if the customer sent it, `true` if you did
* `sender` — which user sent it, for messages from you

Reference: [List messages](/docs/inbox/inbox-api/api-ref/messages.md#get-api-v1-messages)
{% endstep %}

{% step %}
**Load older messages**

Take `waba_payload.timestamp` of the oldest message you have, and ask for the ones before it:

```bash
curl -H "Authorization: Token $SERVICE_TOKEN" "$INBOX/api/v1/messages/?wa_id=$WA_ID&limit=20&before_time=1759150800"
```

Use `before_time` rather than `offset`: new messages can arrive while you page, which shifts offsets but not timestamps.
{% endstep %}
{% endstepper %}


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.360dialog.com/docs/inbox/inbox-api/reading-conversations.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
