The Conversation History API allows authorized clients to retrieve conversation history for a specific webchat session. This is essential for accessing past interactions, enabling use cases such as conversation continuity, auditing, and analytics integration.
1. Creating an Application
In order to utilize the Webchat History API, an application with dataservice_external scope must be created. This application enables secure authentication and authorization of client requests.
📄 For setup instructions, please refer to the official guide.
2. Getting an Access Token
To authenticate API requests, an access token must be obtained using the credentials of your registered application.
📄 For getting an access token, please refer to the official guide.
The retrieved token must be included in the Authorization header as a Bearer token in all API requests.
3. Webchat History API
Endpoint:
- Method: GET
- URL:
{{BaseUrl}}/api/external/conversations/webchat-history?projectName={{projectName}}&tenantName={{tenantName}}&channelId={{channelId}}&externalConversationId={{externalConversationId}}&clientId={{clientId}}
Conversation history can also be retrieved directly using only the external conversation ID:
- URL:
{{BaseUrl}}/api/external/conversations/webchat-history/{{externalConversationId}}
This simplified endpoint requires only the externalConversationId as a path parameter.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
| projectName | string | The name of the project associated with the conversation. |
| channelId | string | The channel identifier. |
| externalConversationId | string | The unique external conversation identifier. |
| clientId | string | The client/customer identifier. |
The clientId and externalConversationId parameters are mutually exclusive. If both are provided in the same request, the API will return a 403 Forbidden error.
Responses
| Status Code | Description |
|---|---|
| 200 | OK – report found and returned in requested format successfully |
| 400 | Bad Request – invalid Date |
| 401 | Unauthorized – missing or invalid token |
| 403 | Forbidden – insufficient tenant permissions |
| 404 | Not Found |
| 500 | Internal server error |
| 501 | Not Implemented |
3.1. Example Request & Response
Here's an example of a request:
curl --location {{BaseUrl}}/api/external/conversations/webchat-history
--header 'Authorization: Bearer {{Token}}'
Here's an example of a response:
{
{
"text": "Hello, I am Knovvu Virtual Agent. How may I help you?",
"messageType": "bot",
"dialogTime": "2026-01-20T09:42:10.419Z",
"contentType": 0,
"storagePath": null,
"jsonContent": "{\"type\":\"message\",\"id\":\"00000000-0000-0000-0000-0b75c5156c8b\"}"
},
{
"text": "I want to check my account balance",
"messageType": "user",
"dialogTime": "2026-01-20T09:42:25.123Z",
"contentType": 0,
"storagePath": null,
"jsonContent": "{\"type\":\"message\",\"id\":\"00000000-0000-0000-0000-1c86d6267d9c\"}"
},
{
"text": "Your current account balance is $1,250.00. Is there anything else I can help you with?",
"messageType": "bot",
"dialogTime": "2026-01-20T09:42:28.456Z",
"contentType": 0,
"storagePath": null,
"jsonContent": "{\"type\":\"message\",\"id\":\"00000000-0000-0000-0000-2d97e7378e0d\"}"
}
}
3.2. Response Field Definitions
| Field | Type | Description |
|---|---|---|
| text | string | The message content in plain text format. |
| messageType | string | Indicates the source/type of the message. |
| dialogTime | string | ISO 8601 formatted timestamp of when the message was sent (UTC). |
| contentType | number | The format of the message content. |
| storagePath | string | Path to stored media file, if applicable. |
| jsonContent | string | Raw JSON representation of the message with additional metadata. |