Skip to main content
GET
/
api
/
chat
/
history
cURL
curl --request GET \
  --url https://app.cotool.ai/api/chat/history \
  --header 'Authorization: Bearer <token>'
{
  "events": [
    {
      "id": "<string>",
      "type": "chat",
      "timestamp": 123,
      "chatId": "<string>",
      "sender": "user",
      "messageType": "text",
      "content": "<string>",
      "attachments": [
        {
          "fileId": "<string>",
          "fileName": "<string>",
          "mimeType": "<string>",
          "size": 123,
          "objectPath": "<string>",
          "fileType": "image",
          "previewText": "<string>"
        }
      ],
      "modelAlias": "<any>",
      "toolCalls": [
        {
          "type": "tool-call",
          "toolCallId": "<string>",
          "toolName": "<string>",
          "input": "<any>"
        }
      ]
    }
  ],
  "chat": {
    "id": "<string>",
    "userId": "<string>",
    "agentId": "<string>",
    "organizationId": "<string>",
    "title": "<string>",
    "createdAt": "2025-06-17T12:34:56.789Z",
    "updatedAt": "2025-06-17T12:34:56.789Z",
    "experience": "chat",
    "modelAlias": "<any>",
    "triggerId": "<string>",
    "triggerName": "<string>",
    "triggerSource": "<string>",
    "triggerDescription": "<string>",
    "isStreaming": true,
    "result": "<any>",
    "error": "<string>",
    "inputTokens": 123,
    "outputTokens": 123,
    "totalTokens": 123,
    "evalScore": 123,
    "evalExplanation": "<string>",
    "evalBulletSummary": [
      "<string>"
    ]
  },
  "feedbackByEvent": {}
}

Authorizations

Authorization
string
header
required

API Key authentication for programmatic access. Include your API key in the Authorization header as: Bearer your_api_key_here

Query Parameters

chatId
string<uuid>
required

Unique identifier of the chat to retrieve history for

Response

200 - application/json

Successful response

Chat history response containing events and chat metadata

events
object[]
required

Array of chat event objects

  • Option 1
  • Option 2
  • Option 3
  • Option 4
  • Option 5
  • Option 6
  • Option 7
  • Option 8
  • Option 9
  • Option 10
  • Option 11
  • Option 12
  • Option 13
  • Option 14
  • Option 15
  • Option 16
chat
object
required

Chat details or null if not found A chat conversation between a user/agent and the AI system

feedbackByEvent
object