Skip to content
QwryAI
Documentation
Pages

Endpoints

List conversations

An agent's conversations from every channel in a date range, newest first, 20 per page

query_conversations lists the conversations an agent had in a date range, from the Chat bubble, the API, WhatsApp, email and every other channel. Each row carries the conversation's channel, state, message counts, sentiment and AI summary, but not its messages. Filters narrow the list by channel, state, sentiment, topic, feedback, contact and escalation.

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

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.
startDatestringYesConversations created from this day, YYYY-MM-DD in UTC.
endDatestringYesConversations created up to this day, included. At most 184 days after startDate.
pageintegerYesThe page, from 1.
sourcesstring[]NoChannels, such as web, api, whatsapp or email. get_conversation_facets lists the values in use.
activity_statesstring[]Noongoing, ended, taken_over or paused.
sentimentstring[]NoSentiment values, such as positive, neutral or negative.
topic, topicsstring, string[]NoAnalytics topic names. A topic includes its subtopics.
feedbackstringNogood or bad.
contactstringNoPart of the contact's name or email, matched as written.
escalatedbooleanNotrue for conversations handed to a person, as in the Inbox Escalated view.

Different filters must all match; several values in one list match any of them.

Request example

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",
    "startDate": "2026-11-01",
    "endDate": "2026-11-30",
    "page": 1,
    "activity_states": ["ongoing"]
  }'

Response

JSON
{
  "success": true,
  "data": {
    "items": [
      {
        "_id": "CONVERSATION_RECORD_ID",
        "conversationId": "fd5ae9e1-9b30-4503-b346-ccd4d7ef16a3",
        "channel": "api",
        "source": "api",
        "lifecycle": "open",
        "routingState": "none",
        "metadata": {
          "aiSummary": "Customer asked to change the delivery address on order 1042.",
          "aiSummaryUpdatedAt": "2026-11-30T19:26:02.118Z"
        },
        "timestamps": { "created": "2026-11-30T19:23:43.046Z", "lastActivity": "2026-11-30T19:24:45.362Z" },
        "metrics": { "messageCount": 4, "aiMessageCount": 2, "agentMessageCount": 0 },
        "insights": { "sentiment": "neutral" }
      }
    ],
    "total": 1,
    "page": 1,
    "hasMore": false,
    "range": { "startDate": "2026-11-01", "endDate": "2026-11-30", "page": 1, "activityStates": ["ongoing"] },
    "timezone": "UTC"
  }
}
FieldDescription
items[]._idThe id the conversation tools take as conversationId, such as Get a conversation.
items[].conversationIdThe id the Chat API uses.
items[].channelWhere the conversation happened, such as web, api or whatsapp.
items[].lifecycleopen while it's going on, resolved once it ends.
items[].routingStateWhether it's waiting for, or with, a person. none while the AI handles it.
items[].metadata.aiSummaryQwryAI's one-line summary, once it has one.
items[].timestampsWhen it started and when it was last active.
items[].metricsMessage counts in total, from the AI, and from your team.
items[].ratingThe customer's good or bad rating, when there is one.
items[].insightssentiment and topicIds, once analysed.
totalConversations that match, across all pages.
hasMoretrue when there's another page.

Rows come newest first. Raise page until hasMore is false; see Pagination.

Errors

HTTP statusCodeWhen
400INVALID_ARGUMENTSA required argument is missing, a date isn't YYYY-MM-DD, or a filter value isn't allowed. 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 page is over 40,000 bytes. Narrow the filters or the dates.
429INTEGRATION_RATE_LIMIT_EXCEEDEDMore than 2,000 requests in 15 minutes.

See Error Handling for every code.

Explore the documentation