Skip to content
QwryAI
Documentation
Pages

Endpoints

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.

POSThttps://api.qwryai.com/public/v1/tools/get_analytics_summary

Authentication

Send your API key as Authorization: Bearer <api-key>, or in an x-api-key header. The key needs Manage conversations and helpdesk. See Authentication.

Body parameters

NameTypeRequiredDescription
chatbotIdstringYesThe agent's id, from List agents.
startDatestringYesThe first day, YYYY-MM-DD, in UTC.
endDatestringYesThe last day, YYYY-MM-DD, in UTC, included. At most 184 days after startDate.

Request example

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"
  }'

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. …"
  }
}
FieldTypeDescription
daily[]arrayOne row per day in the range, with that day's counts.
totalsobjectThe same counts for the whole range, plus resolutionRate.
conversationsintegerConversations started that day or range. Spam isn't counted.
messagesintegerEvery message in those conversations, the welcome message included.
thumbsUp, thumbsDownintegerAgent answers by their current rating.
escalatedintegerConversations that created a ticket or were handed to a person.
sentimentobject | nullConversations by sentiment, set once a conversation ends. null when the plan doesn't include advanced analytics.
totals.resolutionRateinteger | nullThe whole-number percentage of conversations that weren't escalated, as Chats shows it.
channels[]arrayConversations per channel.
actions[]arrayConversations per action used; an action counts once per conversation.
countries[]arrayConversations per country code.
coveragestringHow each number is counted.

More analytics tools

These take the same chatbotId, startDate and endDate:

ToolReturns
get_resolution_rateThe resolution rate per day and in total, with the same-length period before for comparison.
list_topicsAnalytics › Topics: each topic and subtopic with how many conversations it covered. Needs a plan with advanced analytics.
get_conversation_facetsConversation counts by sentiment, source, activity_state, topics and feedback. Takes fields.

Errors

HTTP statusCodeWhen
400INVALID_ARGUMENTSA date is missing or not YYYY-MM-DD. issues lists each one.
400CHATBOT_ID_REQUIREDThe body has no valid chatbotId.
401API_KEY_REQUIRED / INVALID_API_KEYNo credential, or an unknown, deleted or expired one.
403INSUFFICIENT_PERMISSIONThe key doesn't hold Manage conversations and helpdesk.
404CHATBOT_NOT_FOUNDNo agent with that chatbotId in your workspace.
409VALIDATION_INVALID_BODYendDate is before startDate, or the range is longer than 184 days.
413RESULT_TOO_LARGEThe answer is over 40,000 bytes. Use a shorter range.
429INTEGRATION_RATE_LIMIT_EXCEEDEDMore than 2,000 requests in 15 minutes.
500TOOL_FAILEDThe tool failed on our side, or the plan doesn't include the analytics asked for.

See Error Handling for every code.

Explore the documentation