Skip to content
QwryAI
Documentation
Pages

Endpoints

List conversation messages

Page through a conversation's messages, oldest or newest first

A conversation's messages come from the same tool as the conversation itself, get_conversation_detail, 20 per page. Page forward from the start of the conversation, or send newestFirst to read backward from the latest message, for example to show the last few messages of a long conversation.

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.
pageintegerYesThe page of messages, from 1. Each page holds 20.
newestFirstbooleanNotrue makes page 1 the 20 most recent messages, newest 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,
    "newestFirst": true
  }'

Response

JSON
{
  "success": true,
  "data": {
    "conversation": {
      "_id": "CONVERSATION_RECORD_ID",
      "conversationId": "fd5ae9e1-9b30-4503-b346-ccd4d7ef16a3",
      "channel": "api",
      "lifecycle": "open"
    },
    "page": 1,
    "order": "newest_first",
    "messages": [
      {
        "id": "9e2d4b7c-61a3-4f0e-8c5d-2b7a9f1e3c48",
        "sender": "ai",
        "timestamp": "2026-11-30T19:24:45.362Z",
        "content": "Done! Order 1042 will now go to 14 Harbour Street, Wellington.",
        "truncated": false
      },
      {
        "id": "7a1c3e5f-2b4d-4f6a-8c9e-0d1f3a5b7c92",
        "sender": "user",
        "timestamp": "2026-11-30T19:24:40.018Z",
        "content": "It's 14 Harbour Street, Wellington.",
        "truncated": false
      }
    ],
    "mayHaveMore": false
  }
}

The conversation object is shortened above; it has every field shown in Get a conversation.

FieldDescription
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 text, cut to 800 characters unless you send fullText.
messages[].truncatedtrue when content was cut.
mayHaveMoretrue when the page is full, so there may be another.

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