# Get agent analytics > Conversations, messages, feedback, escalations, sentiment, channels, actions and countries for a date range `get_analytics_summary` returns the numbers on the agent's **Analytics** pages for **Chats** and **Sentiment**, per day and in total. Dates are whole days in UTC. Use the totals as they come rather than adding up the days. ```http POST https://api.qwryai.com/public/v1/tools/get_analytics_summary ``` ## 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). | | `startDate` | `string` | Yes | The first day, `YYYY-MM-DD`, in UTC. | | `endDate` | `string` | Yes | The last day, `YYYY-MM-DD`, in UTC, included. At most 184 days after `startDate`. | ## Request example > [tab] cURL > > ```bash > curl -X POST 'https://api.qwryai.com/public/v1/tools/get_analytics_summary' \ > -H 'Authorization: Bearer YOUR_API_KEY' \ > -H 'Content-Type: application/json' \ > -d '{ > "chatbotId": "YOUR_AGENT_ID", > "startDate": "2026-11-24", > "endDate": "2026-11-30" > }' > ``` > [tab] JavaScript > > ```javascript > const response = await fetch("https://api.qwryai.com/public/v1/tools/get_analytics_summary", { > method: "POST", > headers: { > Authorization: "Bearer YOUR_API_KEY", > "Content-Type": "application/json", > }, > body: JSON.stringify({ chatbotId: "YOUR_AGENT_ID", startDate: "2026-11-24", endDate: "2026-11-30" }), > }); > const { data } = await response.json(); > console.log(data.totals.conversations, data.totals.resolutionRate); > ``` > [tab] Python > > ```python > import requests > > response = requests.post( > "https://api.qwryai.com/public/v1/tools/get_analytics_summary", > headers={"Authorization": "Bearer YOUR_API_KEY"}, > json={"chatbotId": "YOUR_AGENT_ID", "startDate": "2026-11-24", "endDate": "2026-11-30"}, > ) > totals = response.json()["data"]["totals"] > print(totals["conversations"], totals["resolutionRate"]) > ``` ## Response ```json { "success": true, "data": { "daily": [ { "date": "2026-11-24", "conversations": 31, "messages": 214, "thumbsUp": 6, "thumbsDown": 1, "escalated": 3, "sentiment": { "positive": 14, "negative": 3, "neutral": 11, "unspecified": 3 } } ], "totals": { "conversations": 212, "messages": 1468, "thumbsUp": 41, "thumbsDown": 7, "escalated": 19, "sentiment": { "positive": 96, "negative": 22, "neutral": 79, "unspecified": 15 }, "resolutionRate": 91 }, "channels": [ { "channel": "web", "label": "Chat widget", "conversations": 154 }, { "channel": "whatsapp", "label": "WhatsApp", "conversations": 46 }, { "channel": "api", "label": "API", "conversations": 12 } ], "actions": [ { "action": "track_order", "label": "Track order", "conversations": 38 } ], "countries": [ { "country": "NZ", "conversations": 118 }, { "country": "AU", "conversations": 61 } ], "range": { "startDate": "2026-11-24", "endDate": "2026-11-30" }, "timezone": "UTC", "coverage": "The agent's Analytics Chats and Sentiment numbers for conversations started in this range. …" } } ``` | Field | Type | Description | | - | - | - | | `daily[]` | `array` | One row per day in the range, with that day's counts. | | `totals` | `object` | The same counts for the whole range, plus `resolutionRate`. | | `conversations` | `integer` | Conversations started that day or range. Spam isn't counted. | | `messages` | `integer` | Every message in those conversations, the welcome message included. | | `thumbsUp`, `thumbsDown` | `integer` | Agent answers by their current rating. | | `escalated` | `integer` | Conversations that created a ticket or were handed to a person. | | `sentiment` | `object \| null` | Conversations by sentiment, set once a conversation ends. `null` when the plan doesn't include advanced analytics. | | `totals.resolutionRate` | `integer \| null` | The whole-number percentage of conversations that weren't escalated, as **Chats** shows it. | | `channels[]` | `array` | Conversations per channel. | | `actions[]` | `array` | Conversations per action used; an action counts once per conversation. | | `countries[]` | `array` | Conversations per country code. | | `coverage` | `string` | How each number is counted. | ## More analytics tools These take the same `chatbotId`, `startDate` and `endDate`: | Tool | Returns | | - | - | | `get_resolution_rate` | The resolution rate per day and in total, with the same-length period before for comparison. | | `list_topics` | **Analytics › Topics**: each topic and subtopic with how many conversations it covered. Needs a plan with advanced analytics. | | `get_conversation_facets` | Conversation counts by `sentiment`, `source`, `activity_state`, `topics` and `feedback`. Takes `fields`. | > [!NOTE] > > Ticket numbers are in the Helpdesk tools, such as `get_helpdesk_overview` and `get_ticket_resolution_analytics`. Credit usage is in `billing_credit_usage`, which needs **View plan and credits**. ## Errors | HTTP status | Code | When | | - | - | - | | 400 | `INVALID_ARGUMENTS` | A date is missing or not `YYYY-MM-DD`. `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. | | 413 | `RESULT_TOO_LARGE` | The answer is over 40,000 bytes. Use a shorter range. | | 429 | `INTEGRATION_RATE_LIMIT_EXCEEDED` | More than 2,000 requests in 15 minutes. | | 500 | `TOOL_FAILED` | The tool failed on our side, or the plan doesn't include the analytics asked for. | See [Error Handling](/docs/api-reference/v2/error-handling) for every code.