# List conversations for a user > Find one customer's conversations: keep their ids as you start them, filter by contact, or let the mobile SDKs list them The API has no tool that lists conversations by the `userId` you pass to the Chat API. A conversation's `userId` is fixed when it starts and comes back in every answer's metadata, so the reliable way to keep a customer's history together is to store each `conversationId` against your customer id as you start it. See [User Conversations](/docs/api-reference/v2/user-conversations). To look a customer up from QwryAI's side, filter [List conversations](/docs/api-reference/v2/conversations/list-conversations) by `contact`, which matches the name or email the customer gave, on every channel: ```http POST https://api.qwryai.com/public/v1/tools/query_conversations ``` ## Authentication Send your API key as `Authorization: Bearer `, or in an `x-api-key` header. The key needs **Manage conversations and helpdesk**. See [Authentication](/docs/api-reference/v2/authentication). ## Body parameters | Name | Type | Required | Description | | - | - | - | - | | `chatbotId` | `string` | Yes | The agent's id, from [List agents](/docs/api-reference/v2/agents/list-agents). | | `contact` | `string` | Yes, for this lookup | Part of the customer's name or email, 2 to 200 characters, matched as written and ignoring case. | | `startDate`, `endDate` | `string` | Yes | Creation dates, `YYYY-MM-DD` in UTC, both included, at most 184 days apart. | | `page` | `integer` | Yes | The page, from `1`. 20 conversations per page. | | `sources` | `string[]` | No | Limit to channels, such as `["api"]` or `["web", "whatsapp"]`. | Every other filter in [List conversations](/docs/api-reference/v2/conversations/list-conversations) works here too. ## Request example > [tab] cURL > > ```bash > curl -X POST 'https://api.qwryai.com/public/v1/tools/query_conversations' \ > -H 'Authorization: Bearer YOUR_API_KEY' \ > -H 'Content-Type: application/json' \ > -d '{ > "chatbotId": "YOUR_AGENT_ID", > "contact": "jane@example.com", > "startDate": "2026-09-01", > "endDate": "2026-11-30", > "page": 1 > }' > ``` > [tab] JavaScript > > ```javascript > const response = await fetch("https://api.qwryai.com/public/v1/tools/query_conversations", { > method: "POST", > headers: { > Authorization: "Bearer YOUR_API_KEY", > "Content-Type": "application/json", > }, > body: JSON.stringify({ > chatbotId: "YOUR_AGENT_ID", > contact: "jane@example.com", > startDate: "2026-09-01", > endDate: "2026-11-30", > page: 1, > }), > }); > const { data } = await response.json(); > ``` > [tab] Python > > ```python > import requests > > response = requests.post( > "https://api.qwryai.com/public/v1/tools/query_conversations", > headers={"Authorization": "Bearer YOUR_API_KEY"}, > json={ > "chatbotId": "YOUR_AGENT_ID", > "contact": "jane@example.com", > "startDate": "2026-09-01", > "endDate": "2026-11-30", > "page": 1, > }, > ) > data = response.json()["data"] > ``` ## Response ```json { "success": true, "data": { "items": [ { "_id": "CONVERSATION_RECORD_ID", "conversationId": "6e1b9d4a-3c7f-4a2e-9b58-0d4c2f7e1a93", "channel": "web", "lifecycle": "resolved", "metadata": { "aiSummary": "Customer asked whether the linen shirt runs true to size." }, "timestamps": { "created": "2026-11-12T08:41:19.502Z", "lastActivity": "2026-11-12T08:47:55.230Z" }, "metrics": { "messageCount": 6, "aiMessageCount": 3, "agentMessageCount": 0 }, "insights": { "sentiment": "positive" } } ], "total": 1, "page": 1, "hasMore": false, "range": { "startDate": "2026-09-01", "endDate": "2026-11-30", "page": 1, "contact": "jane@example.com" }, "timezone": "UTC" } } ``` The fields are described in [List conversations](/docs/api-reference/v2/conversations/list-conversations). Pass an item's `_id` to [Get a conversation](/docs/api-reference/v2/conversations/get-a-conversation) to read its messages. > [!WARNING] > > `contact` matches the name and email a customer gave, not the Chat API `userId`. A Chat API conversation only matches once the customer has shared their name or email in it. ## In mobile apps The [iOS](/docs/ios-sdk/conversations) and [Android](/docs/android-sdk/conversations) SDKs list a signed-in customer's own conversations, newest first, with no API key: the customer's identity token decides whose history comes back. See [User identity](/docs/ios-sdk/user-identity). ## Errors | HTTP status | Code | When | | - | - | - | | 400 | `INVALID_ARGUMENTS` | `contact` is under 2 characters, a date isn't `YYYY-MM-DD`, or `page` is missing. `issues` lists each one. | | 400 | `CHATBOT_ID_REQUIRED` | The body has no valid `chatbotId`. | | 401 | `API_KEY_REQUIRED` / `INVALID_API_KEY` | No credential, or an unknown, deleted or expired one. | | 403 | `INSUFFICIENT_PERMISSION` | The key doesn't hold **Manage conversations and helpdesk**. | | 404 | `CHATBOT_NOT_FOUND` | No agent with that `chatbotId` in your workspace. | | 409 | `VALIDATION_INVALID_BODY` | `endDate` is before `startDate`, or the range is longer than 184 days. | | 429 | `INTEGRATION_RATE_LIMIT_EXCEEDED` | More than 2,000 requests in 15 minutes. | See [Error Handling](/docs/api-reference/v2/error-handling) for every code.