v1

latestOpenAPI 3.0.12026-07-226992320.0 KB
Chats

List Chats

Returns a paginated list of chat sessions for the account, sorted by most recently created first. Use the status parameter to filter by session state. Use page and size to navigate through results.

get/v1/chats

Query parameters

statusstring

Filter chats by their current session state. Accepted values: 'in_progress', 'ended'. Omit to return chats in all states.

pageinteger

Zero-based page number to retrieve. Use 0 for the first page. Must be 0 or greater.

sizeinteger

Number of chats to return per page. Must be 1 or greater. Defaults to 10.

Response

OK

pageinteger

Current page number (0-based index). Indicates which page of results is being returned.

sizeinteger

Number of items requested per page. Determines the maximum size of the 'data' list.

totalCountinteger

Total number of records available across all pages. Useful for calculating pagination on the client side.

totalPagesinteger

Total number of pages available based on totalCounts and size. Helps clients understand how many pages exist in total.

hasNextboolean

Indicates whether there is a next page available after the current one. Useful for implementing 'Load More' or next navigation.

hasPreviousboolean

Indicates whether there is a previous page before the current one. Useful for enabling backward navigation.

Example response

{
  "data": [
    {
      "chatId": "chat-d17T6uReChpyfFeP",
      "agent": {
        "name": "New AI Agent",
        "agentId": "agent_D5D0p7TUs66TTAEAx",
        "status": "Live"
      },
      "createdAt": "2021-04-20T10:00:00.000Z",
      "status": "ended",
      "response": [
        {
          "id": "item_G9YdhDqua0EngI1G",
          "role": "assistant",
          "type": "message",
          "content": [
            "Hello! My name is Grace, and I'm calling on behalf of SigmaMind AI. Am I speaking with Michael?"
          ]
        }
      ],
      "messages": [
        {
          "id": "item_G9YdhDqua0EngI1G",
          "role": "assistant",
          "type": "message",
          "content": [
            "Hello! My name is Grace, and I'm calling on behalf of SigmaMind AI. Am I speaking with Michael?"
          ]
        }
      ],
      "dynamicVariables": {
        "customer_name": "Michael",
        "account_id": "ACC-001"
      }
    }
  ],
  "size": 20,
  "totalCount": 125,
  "totalPages": 7,
  "hasNext": true
}