logo
Development
Search
Get Conversation List

Get Conversation List

Retrieves information about all conversations for an Agent within specified filter criteria, including conversation_id, user_id, recent chat time, conversation subject, conversation type, total message count, and credit consumption.

Request Method

GET

Request URL

https://api-${endpoint}.gptbots.ai/v1/bot/conversation/page

Request Authentication

Please refer to the API Overview for authentication methods.

Request

Request Example

curl -X GET 'https://api-${endpoint}.gptbots.ai/v1/bot/conversation/page?page=1&conversation_type=API&start_time=1691942400000&end_time=1699868066999&page_size=50&user_id=1234567890' \ -H 'Authorization: Bearer ${API Key}' \
                      
                      curl -X GET 'https://api-${endpoint}.gptbots.ai/v1/bot/conversation/page?page=1&conversation_type=API&start_time=1691942400000&end_time=1699868066999&page_size=50&user_id=1234567890'  \
-H 'Authorization: Bearer ${API Key}' \

                    
This code block in the floating window

Request Headers

Field Type Description
Authorization Bearer ${API Key} Use Authorization: Bearer ${API Key} for authentication. Get API key from API Key page.

Request Parameters

Field Type Required Description
conversation_type string Yes Conversation ID source type. Can be set to: ALL, API, EMBED, and other source types.
user_id string No User ID. If not filled in, it is considered unrestricted.
start_time long Yes Start time of the recent conversation, in timestamp format.
end_time long Yes End time of the recent conversation, in timestamp format.
page int Yes Page number, indicating which page to request, starting from 1.
page_size int Yes Number of data entries per page, range 1-100.

Note: For the possible values of conversation_type, refer to the Conversation ID (conversation_id) Source Field Value List in the table in User Overview.

Response

Response Example

{ "list": [ { "conversation_id": "AaACmo05Yrqb6bOSTbsg", "user_id": "3", "recent_chat_time": 1694572952383, "subject": "2+3=?", "conversation_type": "API", "message_count": 2, "cost_credit": 0.01, "bot_id": "64b902a84f1ff25d1c60c10b" }, { "conversation_id": "64ec1508c9c1ed5605e6ff28", "user_id": "33", "recent_chat_time": 1693194862160, "subject": "Hello!", "conversation_type": "API", "message_count": 20, "cost_credit": 0.59, "bot_id": "64b902a84f1ff25d1c60c10b" } ], "total": 2 }
                      
                      {
  "list": [
    {
      "conversation_id": "AaACmo05Yrqb6bOSTbsg",
      "user_id": "3",
      "recent_chat_time": 1694572952383,
      "subject": "2+3=?",
      "conversation_type": "API",
      "message_count": 2,
      "cost_credit": 0.01,
      "bot_id": "64b902a84f1ff25d1c60c10b"
    },
    {
      "conversation_id": "64ec1508c9c1ed5605e6ff28",
      "user_id": "33",
      "recent_chat_time": 1693194862160,
      "subject": "Hello!",
      "conversation_type": "API",
      "message_count": 20,
      "cost_credit": 0.59,
      "bot_id": "64b902a84f1ff25d1c60c10b"
    }
  ],
  "total": 2
}

                    
This code block in the floating window

Successful Response

Field Type Description
list JSON Array List of conversations.
conversation_id string Conversation ID.
user_id string User ID.
recent_chat_time long Recent conversation time.
subject string Conversation subject.
conversation_type string Conversation type.
message_count int Total number of messages in the conversation.
cost_credit float Number of credits consumed by the conversation.
bot_id string Agent ID.
total int Number of conversations returned.

Error Response

Field Type Description
code int Error code.
message string Error details.

Error Codes

Code Message
40000 Invalid parameter
20059 Agent deleted