tencent cloud

APIs

DescribeConversationMessageList

下载
聚焦模式
字号
最后更新时间: 2026-11-04 21:50:28

1. API Description

Domain name for API request: adp.intl.tencentcloudapi.com.

Get historical messages of a conversation.

A maximum of 20 requests can be initiated per second for this API.

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters

The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

Parameter Name Required Type Description
Action Yes String Common Params. The value used for this API: DescribeConversationMessageList.
Version Yes String Common Params. The value used for this API: 2026-05-20.
Region Yes String Common Params. For more information, please see the list of regions supported by the product.
ConversationId Yes String

Session ID.

Type Yes Integer

Session type enumeration values: 0-CONVERSATION_TYPE_UNSPECIFIED (unspecified; means all in list query), 1-CONVERSATION_TYPE_VISITOR (visitor trial), 2-CONVERSATION_TYPE_EVALUATION (evaluation), 5-CONVERSATION_TYPE_API (API integration), 10-CONVERSATION_TYPE_WORKFLOW (workflow debugging), 20-CONVERSATION_TYPE_SHARE (share link)

AppKey No String

Required when Type=CONVERSATION_TYPE_API. Application key

Limit No Integer

Total number of returned records. Default: 10. Maximum: 50. When querying forward or backward, messages of the record specified by record_id are excluded. When querying from the center in both directions, the message of the record specified by record_id is included. The number of returned records is limit / 2 for each direction, rounded up.

LoginSubAccountUin No String

Sub-user Uin.

LoginUin No String

Root user Uin.

RecordId No String

Query anchor record ID

RecordQueryDirection No Integer

Query direction relative to record_id. Enumeration values: 0-RECORD_QUERY_DIRECTION_UNSPECIFIED (not specified, compatible with legacy logic, query forward by default), 1-RECORD_QUERY_DIRECTION_BACKWARD (query earlier messages forward from record_id), 2-RECORD_QUERY_DIRECTION_FORWARD (query newer messages backward from record_id), 3-RECORD_QUERY_DIRECTION_BIDIRECTIONAL (query both forward and backward from record_id as the center)

ShareCode No String

Required when Type is CONVERSATION_TYPE_SHARE. Share code

UserId No String

Required when Type=CONVERSATION_TYPE_API. Visitor ID

3. Output Parameters

Parameter Name Type Description
FirstRecordId String

First record ID

HasMoreAfter Boolean

Whether there are more update message directions

HasMoreBefore Boolean

Earlier message orientation whether there is more

LastRecordId String

Last record ID

MessageList Array of ConversationMessage

Message list

RecordSummaryList Array of ConversationRecordSummary

Statistics list of records in a single dialogue, associated with message_list via record_id / related_record_id

ResetInfo ConversationResetInfo

Last reset information

RequestId String The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.

4. Example

Example1 Query session historical message records

Input Example

POST / HTTP/1.1
Host: adp.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: DescribeConversationMessageList
<Common request parameters>

{
    "ConversationId": "27fe97d2-b9a7-457f-b2a2-73dc901f2959",
    "Type": 2,
    "RecordQueryDirection": 1
}

Output Example

{
    "Response": {
        "FirstRecordId": "req_65faffa4-0d6f-402d-8511-60eb472880ae",
        "HasMoreAfter": false,
        "HasMoreBefore": false,
        "LastRecordId": "rcd_70b72a39-b7fc-405f-a0b9-32f786a3effc",
        "MessageList": [
            {
                "ContentList": [
                    {
                        "CustomParamList": [],
                        "OptionCardList": [],
                        "QuoteInfoList": [],
                        "ReferenceList": [],
                        "TaskList": [],
                        "Tasks": [],
"Text": "Hello",
                        "Type": "text"
                    }
                ],
                "ConversationId": "27fe97d2-b9a7-457f-b2a2-73dc901f2959",
                "ExtraInfo": {
                    "AgentIcon": "",
                    "AgentName": "",
                    "CanFeedback": false,
                    "CanRate": false,
                    "Elapsed": "0",
                    "EndTime": "1785296272074",
                    "HasRead": true,
                    "IsModelGenerated": false,
                    "IsSubAgent": false,
                    "IsTeammate": false,
                    "ParentMessageId": "",
                    "ReasonList": [],
                    "RelatedRecordId": "rcd_65faffa4-0d6f-402d-8511-60eb472880ae",
                    "ReplyMethod": 0,
                    "Score": 0,
                    "StartTime": "1785296270837",
                    "SubAgentRunId": "",
                    "SubAgentThreadId": "",
                    "TeammateName": "",
                    "ToolIcon": "",
                    "ToolName": "",
                    "TraceId": "d6cb723baa9549a79db0c40e908720f2"
                },
                "Icon": "",
                "MessageId": "user_65faffa4-0d6f-402d-8511-60eb472880ae_turn_65faffa4-0d6f-402d-8511-60eb472880ae_content",
                "Name": "question",
                "RecordId": "req_65faffa4-0d6f-402d-8511-60eb472880ae",
                "Role": "user",
                "Status": "success",
"StatusDesc": "Reply completed"
"Title": "User question",
                "Type": "question"
            }
        ],
        "RecordSummaryList": [
            {
                "ErrorInfo": null,
                "RecordId": "rcd_65faffa4-0d6f-402d-8511-60eb472880ae",
                "RelatedRecordId": "req_65faffa4-0d6f-402d-8511-60eb472880ae",
                "Status": "success",
                "TimeUsage": {
                    "Elapsed": "3139",
                    "FirstTokenCost": "3397",
                    "TotalCost": "3139"
                },
                "TokenUsage": {
                    "CachedTokens": "0",
                    "InputTokens": "17190",
                    "OutputTokens": "29",
                    "ReasoningTokens": "20",
                    "TotalTokens": "17219"
                }
            }
        ],
        "ResetInfo": {
            "ResetThroughRecordId": "",
            "ResetTime": "0"
        },
        "RequestId": "a36c0228-248b-4b38-8e5b-396aaf89ab41"
    }
}

5. Developer Resources

SDK

TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

Command Line Interface

6. Error Code

There is no error code related to the API business logic. For other error codes, please see Common Error Codes.

帮助和支持

本页内容是否解决了您的问题?

填写满意度调查问卷,共创更好文档体验。

文档反馈