# CLI Conversations > Find, read and handle a QwryAI agent's conversations from every channel in the terminal Use the conversation tools to look through an agent's chat history, read transcripts, and act on conversations the way your team does in the **Inbox**. They cover every channel, from the chat widget to WhatsApp and the API, and need the **Manage conversations and helpdesk** permission. Sign in first (see [CLI Auth](/docs/cli/auth)) and keep the agent's id in `$AGENT` (see [CLI Agents](/docs/cli/agents)). ## List conversations List the conversations created in a date range (UTC), newest first, twenty per page, each with its AI summary: ```bash qwryai-cli tools:call query_conversations --args "{\"chatbotId\":\"$AGENT\",\"startDate\":\"2026-11-01\",\"endDate\":\"2026-11-30\",\"page\":1}" ``` ```json { "success": true, "data": { "items": [ { "_id": "", "conversationId": "", "channel": "web", "lifecycle": "open", "routingState": "none", "metadata": { "aiSummary": "Customer wants a human support ticket for order 1043 being two weeks late.", "aiSummaryUpdatedAt": "2026-11-30T18:15:01.177Z" }, "timestamps": { "created": "2026-11-30T18:14:52.697Z", "lastActivity": "2026-11-30T18:15:17.705Z" }, "metrics": { "messageCount": 5, "aiMessageCount": 2, "agentMessageCount": 0 }, "insights": { "sentiment": "negative", "topicIds": [""] } } ], "total": 391, "page": 1, "hasMore": true, "range": { "startDate": "2026-11-01", "endDate": "2026-11-30", "page": 1 }, "timezone": "UTC" } } ``` Pass an item's `_id` as `conversationId` to the other conversation tools. Narrow the list with any of these filters; they combine: | Filter | Matches | | - | - | | `activity_states` | `ongoing`, `ended`, `taken_over` or `paused` | | `escalated` | `true` for conversations escalated to a human | | `feedback` | `good` or `bad` ratings | | `sentiment`, `sources`, `topics` | The stored values `get_conversation_facets` lists | | `contact` | A contact's name or email | > [!NOTE] > > To find what customers actually said, use `search_conversations` with a `query` such as `"refund"`. It's a literal, case-insensitive text match over the 2,000 most recent conversations in the range; set `sender` to `customer`, `ai` or `agent` to search one side only. ## Get one conversation Show a conversation and its messages, twenty per page, oldest first: ```bash qwryai-cli tools:call get_conversation_detail --args "{\"chatbotId\":\"$AGENT\",\"conversationId\":\"\",\"page\":1}" ``` ```json { "success": true, "data": { "conversation": { "_id": "", "channel": "web", "lifecycle": "open", "routingState": "none" }, "page": 1, "order": "oldest_first", "messages": [ { "id": "", "sender": "user", "timestamp": "2026-11-30T18:14:52.931Z", "content": "I want to submit a complaint to a human: my delivery for order 1043 is two weeks late. Please create a support ticket.", "truncated": false }, { "id": "", "sender": "system", "timestamp": "2026-11-30T18:15:02.074Z", "content": "Ticket created: TKT-73", "truncated": false }, { "id": "", "sender": "ai", "timestamp": "2026-11-30T18:15:04.285Z", "content": "Thanks, Sam. Your complaint about the late delivery for order 1043 has been sent to our support team. Your ticket ID is **TKT-73**.", "truncated": false } ], "mayHaveMore": false } } ``` Messages are cut to 800 characters, marked `"truncated": true`. Add `"fullText":true` for the whole text, and `"newestFirst":true` to start from the latest message. ## Count conversations Break a date range down by `sentiment`, `source` (channel), `activity_state`, `topics` or `feedback`: ```bash qwryai-cli tools:call get_conversation_facets --args "{\"chatbotId\":\"$AGENT\",\"startDate\":\"2026-11-01\",\"endDate\":\"2026-11-30\",\"fields\":[\"source\",\"sentiment\"]}" ``` > [!TIP] > > To copy a whole month of transcripts, page through `query_conversations` and call `get_conversation_detail` with `"fullText":true` for each `_id`. A result that's too large fails with `RESULT_TOO_LARGE`, so keep date ranges short. ## Act on a conversation These tools act at once, as an agent in the **Inbox** would: ```bash qwryai-cli tools:call send_agent_message --args "{\"chatbotId\":\"$AGENT\",\"conversationId\":\"\",\"content\":\"Hi Sam, I've chased the courier for order 1043.\"}" ``` `send_agent_message` replies as a human agent. It takes the conversation over: it's assigned to you and the AI stops replying until it's resolved. Add a note only your team sees with `add_internal_note`, and hand back with `resolve_conversation`, optionally with a `reason`. `mark_conversation_read` and `mark_conversation_unread` set the conversation's unread state in your Inbox. To stop or restart AI replies in an open conversation that no human is handling, prepare a review with `toggle_conversation_pause` (`"paused":true` or `false`) and apply it. ## Commands | Tool | Purpose | | - | - | | `query_conversations` | List conversations in a date range, with filters | | `search_conversations` | Find conversations whose messages contain some text | | `get_conversation_detail` | Show one conversation and its messages | | `get_conversation_facets` | Count conversations by sentiment, channel, state, topic or rating | | `send_agent_message` | Reply as a human agent and take the conversation over | | `add_internal_note` | Add a private note for your team | | `resolve_conversation` | Resolve a conversation a human handled | | `mark_conversation_read` / `mark_conversation_unread` | Set the conversation's unread state for you | | `toggle_conversation_pause` | Pause or resume AI replies (reviewed) | > [!WARNING] > > `send_agent_message` reaches the customer straight away and isn't reviewed. Test it on a conversation you started yourself with [CLI Chat](/docs/cli/chat).