Conversations

December 15, 2025 ยท View on GitHub

Overview

Available Operations

  • log - Log Conversation
  • list - Get All Conversations
  • get - Get Conversation
  • delete - Delete Conversation

log

Logs a new conversation or updates an existing one with new messages. Always include all messages.

API Key Types: WEB, API

Example Usage

import { InkeepAnalytics } from "@inkeep/inkeep-analytics";

const inkeepAnalytics = new InkeepAnalytics();

async function run() {
  const result = await inkeepAnalytics.conversations.log({
    webIntegrationKey: process.env["INKEEPANALYTICS_WEB_INTEGRATION_KEY"] ?? "",
  }, {
    type: "support_copilot",
    messages: [
      {
        role: "<value>",
        userProperties: {
          identificationType: "COOKIED",
        },
      },
    ],
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { InkeepAnalyticsCore } from "@inkeep/inkeep-analytics/core.js";
import { conversationsLog } from "@inkeep/inkeep-analytics/funcs/conversationsLog.js";

// Use `InkeepAnalyticsCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const inkeepAnalytics = new InkeepAnalyticsCore();

async function run() {
  const res = await conversationsLog(inkeepAnalytics, {
    webIntegrationKey: process.env["INKEEPANALYTICS_WEB_INTEGRATION_KEY"] ?? "",
  }, {
    type: "support_copilot",
    messages: [
      {
        role: "<value>",
        userProperties: {
          identificationType: "COOKIED",
        },
      },
    ],
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("conversationsLog failed:", res.error);
  }
}

run();

React hooks and utilities

This method can be used in React components through the following hooks and associated utilities.

Check out this guide for information about each of the utilities below and how to get started using React hooks.

import {
  // Mutation hook for triggering the API call.
  useConversationsLogMutation
} from "@inkeep/inkeep-analytics/react-query/conversationsLog.js";

Parameters

ParameterTypeRequiredDescription
requestcomponents.CreateConversation:heavy_check_mark:The request object to use for the request.
securityoperations.LogConversationSecurity:heavy_check_mark:The security requirements to use for the request.
optionsRequestOptions:heavy_minus_sign:Used to set various options for making HTTP requests.
options.fetchOptionsRequestInit:heavy_minus_sign:Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retriesRetryConfig:heavy_minus_sign:Enables retrying HTTP requests under certain failure conditions.

Response

Promise<components.Conversation>

Errors

Error TypeStatus CodeContent Type
errors.BadRequest400application/problem+json
errors.Unauthorized401application/problem+json
errors.Forbidden403application/problem+json
errors.UnprocessableEntity422application/problem+json
errors.InternalServerError500application/problem+json
errors.APIError4XX, 5XX*/*

list

Get All Conversations

Example Usage

import { InkeepAnalytics } from "@inkeep/inkeep-analytics";

const inkeepAnalytics = new InkeepAnalytics({
  apiIntegrationKey: process.env["INKEEPANALYTICS_API_INTEGRATION_KEY"] ?? "",
});

async function run() {
  const result = await inkeepAnalytics.conversations.list({});

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { InkeepAnalyticsCore } from "@inkeep/inkeep-analytics/core.js";
import { conversationsList } from "@inkeep/inkeep-analytics/funcs/conversationsList.js";

// Use `InkeepAnalyticsCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const inkeepAnalytics = new InkeepAnalyticsCore({
  apiIntegrationKey: process.env["INKEEPANALYTICS_API_INTEGRATION_KEY"] ?? "",
});

async function run() {
  const res = await conversationsList(inkeepAnalytics, {});
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("conversationsList failed:", res.error);
  }
}

run();

React hooks and utilities

This method can be used in React components through the following hooks and associated utilities.

Check out this guide for information about each of the utilities below and how to get started using React hooks.

import {
  // Query hooks for fetching data.
  useConversationsList,
  useConversationsListSuspense,

  // Utility for prefetching data during server-side rendering and in React
  // Server Components that will be immediately available to client components
  // using the hooks.
  prefetchConversationsList,
  
  // Utilities to invalidate the query cache for this query in response to
  // mutations and other user actions.
  invalidateConversationsList,
  invalidateAllConversationsList,
} from "@inkeep/inkeep-analytics/react-query/conversationsList.js";

Parameters

ParameterTypeRequiredDescription
requestoperations.GetAllConversationRequest:heavy_check_mark:The request object to use for the request.
optionsRequestOptions:heavy_minus_sign:Used to set various options for making HTTP requests.
options.fetchOptionsRequestInit:heavy_minus_sign:Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retriesRetryConfig:heavy_minus_sign:Enables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.GetAllConversationResponseBody>

Errors

Error TypeStatus CodeContent Type
errors.BadRequest400application/problem+json
errors.Unauthorized401application/problem+json
errors.Forbidden403application/problem+json
errors.NotFound404application/problem+json
errors.UnprocessableEntity422application/problem+json
errors.InternalServerError500application/problem+json
errors.APIError4XX, 5XX*/*

get

Get Conversation

Example Usage

import { InkeepAnalytics } from "@inkeep/inkeep-analytics";

const inkeepAnalytics = new InkeepAnalytics();

async function run() {
  const result = await inkeepAnalytics.conversations.get({
    webIntegrationKey: process.env["INKEEPANALYTICS_WEB_INTEGRATION_KEY"] ?? "",
  }, {
    id: "<id>",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { InkeepAnalyticsCore } from "@inkeep/inkeep-analytics/core.js";
import { conversationsGet } from "@inkeep/inkeep-analytics/funcs/conversationsGet.js";

// Use `InkeepAnalyticsCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const inkeepAnalytics = new InkeepAnalyticsCore();

async function run() {
  const res = await conversationsGet(inkeepAnalytics, {
    webIntegrationKey: process.env["INKEEPANALYTICS_WEB_INTEGRATION_KEY"] ?? "",
  }, {
    id: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("conversationsGet failed:", res.error);
  }
}

run();

React hooks and utilities

This method can be used in React components through the following hooks and associated utilities.

Check out this guide for information about each of the utilities below and how to get started using React hooks.

import {
  // Query hooks for fetching data.
  useConversationsGet,
  useConversationsGetSuspense,

  // Utility for prefetching data during server-side rendering and in React
  // Server Components that will be immediately available to client components
  // using the hooks.
  prefetchConversationsGet,
  
  // Utilities to invalidate the query cache for this query in response to
  // mutations and other user actions.
  invalidateConversationsGet,
  invalidateAllConversationsGet,
} from "@inkeep/inkeep-analytics/react-query/conversationsGet.js";

Parameters

ParameterTypeRequiredDescription
requestoperations.GetConversationRequest:heavy_check_mark:The request object to use for the request.
securityoperations.GetConversationSecurity:heavy_check_mark:The security requirements to use for the request.
optionsRequestOptions:heavy_minus_sign:Used to set various options for making HTTP requests.
options.fetchOptionsRequestInit:heavy_minus_sign:Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retriesRetryConfig:heavy_minus_sign:Enables retrying HTTP requests under certain failure conditions.

Response

Promise<components.Conversation>

Errors

Error TypeStatus CodeContent Type
errors.BadRequest400application/problem+json
errors.Unauthorized401application/problem+json
errors.Forbidden403application/problem+json
errors.NotFound404application/problem+json
errors.UnprocessableEntity422application/problem+json
errors.InternalServerError500application/problem+json
errors.APIError4XX, 5XX*/*

delete

Delete Conversation

Example Usage

import { InkeepAnalytics } from "@inkeep/inkeep-analytics";

const inkeepAnalytics = new InkeepAnalytics();

async function run() {
  const result = await inkeepAnalytics.conversations.delete({
    webIntegrationKey: process.env["INKEEPANALYTICS_WEB_INTEGRATION_KEY"] ?? "",
  }, {
    id: "<id>",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { InkeepAnalyticsCore } from "@inkeep/inkeep-analytics/core.js";
import { conversationsDelete } from "@inkeep/inkeep-analytics/funcs/conversationsDelete.js";

// Use `InkeepAnalyticsCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const inkeepAnalytics = new InkeepAnalyticsCore();

async function run() {
  const res = await conversationsDelete(inkeepAnalytics, {
    webIntegrationKey: process.env["INKEEPANALYTICS_WEB_INTEGRATION_KEY"] ?? "",
  }, {
    id: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("conversationsDelete failed:", res.error);
  }
}

run();

React hooks and utilities

This method can be used in React components through the following hooks and associated utilities.

Check out this guide for information about each of the utilities below and how to get started using React hooks.

import {
  // Mutation hook for triggering the API call.
  useConversationsDeleteMutation
} from "@inkeep/inkeep-analytics/react-query/conversationsDelete.js";

Parameters

ParameterTypeRequiredDescription
requestoperations.DeleteConversationRequest:heavy_check_mark:The request object to use for the request.
securityoperations.DeleteConversationSecurity:heavy_check_mark:The security requirements to use for the request.
optionsRequestOptions:heavy_minus_sign:Used to set various options for making HTTP requests.
options.fetchOptionsRequestInit:heavy_minus_sign:Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retriesRetryConfig:heavy_minus_sign:Enables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.DeleteConversationResponseBody>

Errors

Error TypeStatus CodeContent Type
errors.BadRequest400application/problem+json
errors.Unauthorized401application/problem+json
errors.Forbidden403application/problem+json
errors.NotFound404application/problem+json
errors.UnprocessableEntity422application/problem+json
errors.InternalServerError500application/problem+json
errors.APIError4XX, 5XX*/*