Analytics apiConversationConversations

Log Conversation

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

API Key Types: WEB, API

POST
/conversations

Authorization

AuthorizationRequiredBearer <token>

The API key for a Web integration. For more details, see authentication documentation

In: header

AuthorizationRequiredBearer <token>

The API key for an API integration. For more details, see authentication documentation

In: header

Request Body

application/jsonRequired

Note: The maximum size of the request body is 2 MB.

bodyRequiredCreateConversation

Response Body

Conversation upserted successfully

responseRequiredConversationSelect
export type ConversationSelect =
  | (BaseConversation & {
      type?: "openai";
      /**
       * The messages in the conversation. Must be at least one message.
       *
       * @minItems 1
       */
      messages?: [
        BaseMessage & {
          type?: "openai";
          role?: "system" | "user" | "assistant";
          content?: string | OpenAIContentItem[];
          tool_calls?: OpenAIToolCall[] | null;
        },
        ...(BaseMessage & {
          type?: "openai";
          role?: "system" | "user" | "assistant";
          content?: string | OpenAIContentItem[];
          tool_calls?: OpenAIToolCall[] | null;
        })[]
      ];
      messagesOpenAIFormat: MessagesOpenAIFormat;
    })
  | (BaseConversation1 & {
      type?: "support_ticket";
      /**
       * The messages in the conversation. Must be at least one message.
       *
       * @minItems 1
       */
      messages?: [
        BaseMessage1 & {
          type?: "support_ticket";
        },
        ...(BaseMessage1 & {
          type?: "support_ticket";
        })[]
      ];
    })
  | (BaseConversation2 & {
      type?: "support_copilot";
      /**
       * The messages in the conversation. Must be at least one message.
       *
       * @minItems 1
       */
      messages?: [
        BaseMessage2 & {
          type?: "support_copilot";
        },
        ...(BaseMessage2 & {
          type?: "support_copilot";
        })[]
      ];
    });
export type OpenAIImageUrlObject = {
  url: string;
  detail?: "auto" | "low" | "high";
} & null &
  OpenAIImageUrlObject;
export type MessagesOpenAIFormat = OpenAIChatCompletionMessage[];
 
export interface BaseConversation {
  id: string;
  externalId: string | null;
  externalUrl: string | null;
  type: "openai" | "support_ticket" | "support_copilot";
  supportTicketConversationId: string | null;
  createdAt: string;
  updatedAt: string;
  projectId: string | null;
  integrationId: string | null;
  /**
   * A customizable collection of custom properties or attributes.
   */
  properties?: {
    [k: string]: unknown;
  } | null;
  /**
   * A customizable collection of custom properties or attributes. Some properties have first class support for the Inkeep Portal or Widget and are noted in the description.
   */
  userProperties?: {
    /**
     * The unique identifier for the user. This value is sent by the inkeep widget.
     */
    id?: string | number | null;
    /**
     * The type of identification for the user. This value is sent by the inkeep widget.
     */
    identificationType?: string | null;
    /**
     * The unique identifier for the user. This value is sent by the Inkeep Support Agent Copilot. This value is used to create the graphs on the Inkeep Portal.
     */
    userId?: string | number | null;
    /**
     * The name of the support agent assigned to the user. This value is sent by the Inkeep Support Agent Copilot. This value is used to create the graphs on the Inkeep Portal.
     */
    supportAgentName?: string | null;
    [k: string]: unknown;
  } | null;
  tags?: string[] | null;
  visibility: ("private" | "public") | null;
  /**
   * The messages in the conversation. Must be at least one message.
   *
   * @minItems 1
   */
  messages: [
    (
      | (BaseMessage & {
          type?: "openai";
          role?: "system" | "user" | "assistant";
          content?: string | OpenAIContentItem[];
          tool_calls?: OpenAIToolCall[] | null;
        })
      | (BaseMessage1 & {
          type?: "support_ticket";
        })
      | (BaseMessage2 & {
          type?: "support_copilot";
        })
    ),
    ...(
      | (BaseMessage & {
          type?: "openai";
          role?: "system" | "user" | "assistant";
          content?: string | OpenAIContentItem[];
          tool_calls?: OpenAIToolCall[] | null;
        })
      | (BaseMessage1 & {
          type?: "support_ticket";
        })
      | (BaseMessage2 & {
          type?: "support_copilot";
        })
    )[]
  ];
}
export interface BaseMessage {
  id: string;
  type: "openai" | "support_ticket" | "support_copilot";
  externalId: string | null;
  externalUrl: string | null;
  conversationId: string;
  createdAt: string;
  updatedAt: string;
  role: string;
  content: string | null;
  name?: string | null;
  links?:
    | {
        label?: string | null;
        url: string;
        title?: string | null;
        description?: string | null;
        type?:
          | (
              | "documentation"
              | "site"
              | "discourse_post"
              | "github_issue"
              | "github_discussion"
              | "stackoverflow_question"
              | "discord_forum_post"
              | "discord_message"
              | "custom_question_answer"
            )
          | string
          | null;
        breadcrumbs?: string[] | null;
      }[]
    | null;
  /**
   * A customizable collection of custom properties or attributes.
   */
  properties?: {
    [k: string]: unknown;
  } | null;
  /**
   * A customizable collection of custom properties or attributes. Some properties have first class support for the Inkeep Portal or Widget and are noted in the description.
   */
  userProperties?: {
    /**
     * The unique identifier for the user. This value is sent by the inkeep widget.
     */
    id?: string | number | null;
    /**
     * The type of identification for the user. This value is sent by the inkeep widget.
     */
    identificationType?: string | null;
    /**
     * The unique identifier for the user. This value is sent by the Inkeep Support Agent Copilot. This value is used to create the graphs on the Inkeep Portal.
     */
    userId?: string | number | null;
    /**
     * The name of the support agent assigned to the user. This value is sent by the Inkeep Support Agent Copilot. This value is used to create the graphs on the Inkeep Portal.
     */
    supportAgentName?: string | null;
    [k: string]: unknown;
  } | null;
}
export interface OpenAIContentItem {
  type: "text" | "image_url";
  text?: string | null;
  image_url?: OpenAIImageUrlObject;
}
export interface OpenAIToolCall {
  id: string;
  type: "function";
  function: OpenAIToolCallFunction;
}
export interface OpenAIToolCallFunction {
  name: string;
  arguments: string;
}
export interface BaseMessage1 {
  id: string;
  type: "openai" | "support_ticket" | "support_copilot";
  externalId: string | null;
  externalUrl: string | null;
  conversationId: string;
  createdAt: string;
  updatedAt: string;
  role: string;
  content: string | null;
  name?: string | null;
  links?:
    | {
        label?: string | null;
        url: string;
        title?: string | null;
        description?: string | null;
        type?:
          | (
              | "documentation"
              | "site"
              | "discourse_post"
              | "github_issue"
              | "github_discussion"
              | "stackoverflow_question"
              | "discord_forum_post"
              | "discord_message"
              | "custom_question_answer"
            )
          | string
          | null;
        breadcrumbs?: string[] | null;
      }[]
    | null;
  /**
   * A customizable collection of custom properties or attributes.
   */
  properties?: {
    [k: string]: unknown;
  } | null;
  /**
   * A customizable collection of custom properties or attributes. Some properties have first class support for the Inkeep Portal or Widget and are noted in the description.
   */
  userProperties?: {
    /**
     * The unique identifier for the user. This value is sent by the inkeep widget.
     */
    id?: string | number | null;
    /**
     * The type of identification for the user. This value is sent by the inkeep widget.
     */
    identificationType?: string | null;
    /**
     * The unique identifier for the user. This value is sent by the Inkeep Support Agent Copilot. This value is used to create the graphs on the Inkeep Portal.
     */
    userId?: string | number | null;
    /**
     * The name of the support agent assigned to the user. This value is sent by the Inkeep Support Agent Copilot. This value is used to create the graphs on the Inkeep Portal.
     */
    supportAgentName?: string | null;
    [k: string]: unknown;
  } | null;
}
export interface BaseMessage2 {
  id: string;
  type: "openai" | "support_ticket" | "support_copilot";
  externalId: string | null;
  externalUrl: string | null;
  conversationId: string;
  createdAt: string;
  updatedAt: string;
  role: string;
  content: string | null;
  name?: string | null;
  links?:
    | {
        label?: string | null;
        url: string;
        title?: string | null;
        description?: string | null;
        type?:
          | (
              | "documentation"
              | "site"
              | "discourse_post"
              | "github_issue"
              | "github_discussion"
              | "stackoverflow_question"
              | "discord_forum_post"
              | "discord_message"
              | "custom_question_answer"
            )
          | string
          | null;
        breadcrumbs?: string[] | null;
      }[]
    | null;
  /**
   * A customizable collection of custom properties or attributes.
   */
  properties?: {
    [k: string]: unknown;
  } | null;
  /**
   * A customizable collection of custom properties or attributes. Some properties have first class support for the Inkeep Portal or Widget and are noted in the description.
   */
  userProperties?: {
    /**
     * The unique identifier for the user. This value is sent by the inkeep widget.
     */
    id?: string | number | null;
    /**
     * The type of identification for the user. This value is sent by the inkeep widget.
     */
    identificationType?: string | null;
    /**
     * The unique identifier for the user. This value is sent by the Inkeep Support Agent Copilot. This value is used to create the graphs on the Inkeep Portal.
     */
    userId?: string | number | null;
    /**
     * The name of the support agent assigned to the user. This value is sent by the Inkeep Support Agent Copilot. This value is used to create the graphs on the Inkeep Portal.
     */
    supportAgentName?: string | null;
    [k: string]: unknown;
  } | null;
}
export interface OpenAIChatCompletionMessage {
  role: "system" | "user" | "assistant";
  name?: string | null;
  content: string | OpenAIContentItem1[];
  tool_calls?: OpenAIToolCall1[] | null;
}
export interface OpenAIContentItem1 {
  type: "text" | "image_url";
  text?: string | null;
  image_url?: OpenAIImageUrlObject;
}
export interface OpenAIToolCall1 {
  id: string;
  type: "function";
  function: OpenAIToolCallFunction;
}
export interface BaseConversation1 {
  id: string;
  externalId: string | null;
  externalUrl: string | null;
  type: "openai" | "support_ticket" | "support_copilot";
  supportTicketConversationId: string | null;
  createdAt: string;
  updatedAt: string;
  projectId: string | null;
  integrationId: string | null;
  /**
   * A customizable collection of custom properties or attributes.
   */
  properties?: {
    [k: string]: unknown;
  } | null;
  /**
   * A customizable collection of custom properties or attributes. Some properties have first class support for the Inkeep Portal or Widget and are noted in the description.
   */
  userProperties?: {
    /**
     * The unique identifier for the user. This value is sent by the inkeep widget.
     */
    id?: string | number | null;
    /**
     * The type of identification for the user. This value is sent by the inkeep widget.
     */
    identificationType?: string | null;
    /**
     * The unique identifier for the user. This value is sent by the Inkeep Support Agent Copilot. This value is used to create the graphs on the Inkeep Portal.
     */
    userId?: string | number | null;
    /**
     * The name of the support agent assigned to the user. This value is sent by the Inkeep Support Agent Copilot. This value is used to create the graphs on the Inkeep Portal.
     */
    supportAgentName?: string | null;
    [k: string]: unknown;
  } | null;
  tags?: string[] | null;
  visibility: ("private" | "public") | null;
  /**
   * The messages in the conversation. Must be at least one message.
   *
   * @minItems 1
   */
  messages: [
    (
      | (BaseMessage & {
          type?: "openai";
          role?: "system" | "user" | "assistant";
          content?: string | OpenAIContentItem[];
          tool_calls?: OpenAIToolCall[] | null;
        })
      | (BaseMessage1 & {
          type?: "support_ticket";
        })
      | (BaseMessage2 & {
          type?: "support_copilot";
        })
    ),
    ...(
      | (BaseMessage & {
          type?: "openai";
          role?: "system" | "user" | "assistant";
          content?: string | OpenAIContentItem[];
          tool_calls?: OpenAIToolCall[] | null;
        })
      | (BaseMessage1 & {
          type?: "support_ticket";
        })
      | (BaseMessage2 & {
          type?: "support_copilot";
        })
    )[]
  ];
}
export interface BaseConversation2 {
  id: string;
  externalId: string | null;
  externalUrl: string | null;
  type: "openai" | "support_ticket" | "support_copilot";
  supportTicketConversationId: string | null;
  createdAt: string;
  updatedAt: string;
  projectId: string | null;
  integrationId: string | null;
  /**
   * A customizable collection of custom properties or attributes.
   */
  properties?: {
    [k: string]: unknown;
  } | null;
  /**
   * A customizable collection of custom properties or attributes. Some properties have first class support for the Inkeep Portal or Widget and are noted in the description.
   */
  userProperties?: {
    /**
     * The unique identifier for the user. This value is sent by the inkeep widget.
     */
    id?: string | number | null;
    /**
     * The type of identification for the user. This value is sent by the inkeep widget.
     */
    identificationType?: string | null;
    /**
     * The unique identifier for the user. This value is sent by the Inkeep Support Agent Copilot. This value is used to create the graphs on the Inkeep Portal.
     */
    userId?: string | number | null;
    /**
     * The name of the support agent assigned to the user. This value is sent by the Inkeep Support Agent Copilot. This value is used to create the graphs on the Inkeep Portal.
     */
    supportAgentName?: string | null;
    [k: string]: unknown;
  } | null;
  tags?: string[] | null;
  visibility: ("private" | "public") | null;
  /**
   * The messages in the conversation. Must be at least one message.
   *
   * @minItems 1
   */
  messages: [
    (
      | (BaseMessage & {
          type?: "openai";
          role?: "system" | "user" | "assistant";
          content?: string | OpenAIContentItem[];
          tool_calls?: OpenAIToolCall[] | null;
        })
      | (BaseMessage1 & {
          type?: "support_ticket";
        })
      | (BaseMessage2 & {
          type?: "support_copilot";
        })
    ),
    ...(
      | (BaseMessage & {
          type?: "openai";
          role?: "system" | "user" | "assistant";
          content?: string | OpenAIContentItem[];
          tool_calls?: OpenAIToolCall[] | null;
        })
      | (BaseMessage1 & {
          type?: "support_ticket";
        })
      | (BaseMessage2 & {
          type?: "support_copilot";
        })
    )[]
  ];
}
 
curl -X POST "https://api.analytics.inkeep.com/conversations" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "id": "string",
    "externalId": "string",
    "externalUrl": "string",
    "type": "openai",
    "supportTicketConversationId": "string",
    "createdAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z",
    "projectId": "string",
    "integrationId": "string",
    "properties": {},
    "userProperties": {
      "id": "string",
      "identificationType": "COOKIED",
      "userId": "string",
      "supportAgentName": "string"
    },
    "tags": [
      "string"
    ],
    "visibility": "private",
    "messages": [
      {
        "id": "string",
        "type": "openai",
        "externalId": "string",
        "externalUrl": "string",
        "createdAt": "2019-08-24T14:15:22Z",
        "updatedAt": "2019-08-24T14:15:22Z",
        "role": "system",
        "content": "string",
        "name": "string",
        "links": [
          {
            "label": "string",
            "url": "string",
            "title": "string",
            "description": "string",
            "type": "documentation",
            "breadcrumbs": [
              "string"
            ]
          }
        ],
        "properties": {},
        "userProperties": {
          "id": "string",
          "identificationType": "COOKIED",
          "userId": "string",
          "supportAgentName": "string"
        },
        "tool_calls": [
          {
            "id": "string",
            "type": "function",
            "function": {
              "name": "string",
              "arguments": "string"
            }
          }
        ]
      }
    ]
  }'
{
  "id": "string",
  "externalId": "string",
  "externalUrl": "string",
  "type": "openai",
  "supportTicketConversationId": "string",
  "createdAt": "string",
  "updatedAt": "string",
  "projectId": "string",
  "integrationId": "string",
  "properties": {},
  "userProperties": {
    "id": "string",
    "identificationType": "COOKIED",
    "userId": "string",
    "supportAgentName": "string"
  },
  "tags": [
    "string"
  ],
  "visibility": "private",
  "messages": [
    {
      "id": "string",
      "type": "openai",
      "externalId": "string",
      "externalUrl": "string",
      "conversationId": "string",
      "createdAt": "string",
      "updatedAt": "string",
      "role": "system",
      "content": "string",
      "name": "string",
      "links": [
        {
          "label": "string",
          "url": "string",
          "title": "string",
          "description": "string",
          "type": "documentation",
          "breadcrumbs": [
            "string"
          ]
        }
      ],
      "properties": {},
      "userProperties": {
        "id": "string",
        "identificationType": "COOKIED",
        "userId": "string",
        "supportAgentName": "string"
      },
      "tool_calls": [
        {
          "id": "string",
          "type": "function",
          "function": {
            "name": "string",
            "arguments": "string"
          }
        }
      ]
    }
  ],
  "messagesOpenAIFormat": [
    {
      "role": "system",
      "name": "string",
      "content": "string",
      "tool_calls": [
        {
          "id": "string",
          "type": "function",
          "function": {
            "name": "string",
            "arguments": "string"
          }
        }
      ]
    }
  ]
}