Skip to content
QwryAI
Documentation
Pages

Endpoints

Get a conversation

One conversation and its messages, 20 per page

get_conversation_detail returns a conversation from any channel with its messages. Messages come 20 per page, oldest first, as 800-character excerpts; ask for full text or start from the newest when you need to. Find the conversation first with List conversations or Search conversations, and pass its _id.

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

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.
conversationIdstringYesThe conversation's _id from query_conversations or search_conversations. Not the Chat API's conversationId.
pageintegerYesThe page of messages, from 1.
newestFirstbooleanNotrue starts from the most recent message. Defaults to oldest first.
fullTextbooleanNotrue returns whole messages instead of 800-character excerpts.

Request example

Bash
curl -X POST 'https://api.qwryai.com/public/v1/tools/get_conversation_detail' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "chatbotId": "YOUR_AGENT_ID",
    "conversationId": "CONVERSATION_RECORD_ID",
    "page": 1,
    "fullText": true
  }'

Response

JSON
{
  "success": true,
  "data": {
    "conversation": {
      "_id": "CONVERSATION_RECORD_ID",
      "conversationId": "fd5ae9e1-9b30-4503-b346-ccd4d7ef16a3",
      "channel": "api",
      "lifecycle": "open",
      "routingState": "none",
      "metadata": { "aiSummary": "Customer asked to change the delivery address on order 1042." },
      "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" }
    },
    "page": 1,
    "order": "oldest_first",
    "messages": [
      {
        "id": "0c4f6a2e-8d13-4b7a-b0e9-1a2c3d4e5f60",
        "sender": "user",
        "timestamp": "2026-11-30T19:23:43.112Z",
        "content": "Hi, I'd like to change my delivery address.",
        "truncated": false
      },
      {
        "id": "5b0e7c1a-2f4d-4c55-9a51-6d8e3f2b9c10",
        "sender": "ai",
        "timestamp": "2026-11-30T19:23:46.904Z",
        "content": "Of course. What's the order number and the new address?",
        "truncated": false
      }
    ],
    "mayHaveMore": false
  }
}
FieldDescription
conversationThe conversation, with the same fields as List conversations.
orderoldest_first or newest_first.
messages[].idThe message's id.
messages[].senderuser for the customer, ai for the agent, agent for a teammate.
messages[].timestampWhen it was sent.
messages[].contentThe message text: up to 800 characters, or all of it with fullText.
messages[].truncatedtrue when content was cut to 800 characters.
mayHaveMoretrue when this page is full, so there may be another.

To read the whole conversation, raise page while mayHaveMore is true. See List conversation messages.

Errors

HTTP statusCodeWhen
400INVALID_ARGUMENTSconversationId isn't a conversation _id, or page is missing. 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.
413RESULT_TOO_LARGEThe page is over 40,000 bytes. Leave out fullText.
429INTEGRATION_RATE_LIMIT_EXCEEDEDMore than 2,000 requests in 15 minutes.
500TOOL_FAILEDThe conversation isn't on this agent, or the tool failed on our side.

See Error Handling for every code.

Explore the documentation