Analytics apiQueryConversations

Query Conversations

POST
/query/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.

selectarray<ConversationsSelection>
groupByarray<ConversationsGroupBy>
whereConversationsFilter
orderByarray<Conversations OrderBy Schema>
notesstring

Notes are not persisted, but may be useful for your debugging purposes

Maximum length: 80

Response Body

Response body for QueryConversations query endpoint

statusRequiredstring

Status of the response

Value in: "ok"
dataRequiredobject

Data object containing QueryConversations query results and pagination information

/**
 * Response body for QueryConversations query endpoint
 */
export interface Response {
  /**
   * Status of the response
   */
  status: "ok";
  data: QueryConversationsResponseData;
}
/**
 * Data object containing QueryConversations query results and pagination information
 */
export interface QueryConversationsResponseData {
  result: ConversationsResultItem[];
  /**
   * Total number of results matching the query
   */
  total: number;
  /**
   * Number of results per page
   */
  pageSize: number;
  /**
   * Number of results in the current response
   */
  count: number;
}
export interface ConversationsResultItem {
  id?: string;
  userMessageCount?: number;
  organizationId?: string | null;
  projectId?: string | null;
  integrationId?: string | null;
  firstMessageTime?: string;
  type?: ("openai" | "support_ticket" | "support_copilot") | 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;
  sum?: number;
  count?: number;
  avg?: number;
  min?: number;
  max?: number;
  id_hour?: string;
  id_day?: string;
  id_week?: string;
  id_month?: string;
  userMessageCount_hour?: string;
  userMessageCount_day?: string;
  userMessageCount_week?: string;
  userMessageCount_month?: string;
  organizationId_hour?: string;
  organizationId_day?: string;
  organizationId_week?: string;
  organizationId_month?: string;
  projectId_hour?: string;
  projectId_day?: string;
  projectId_week?: string;
  projectId_month?: string;
  integrationId_hour?: string;
  integrationId_day?: string;
  integrationId_week?: string;
  integrationId_month?: string;
  firstMessageTime_hour?: string;
  firstMessageTime_day?: string;
  firstMessageTime_week?: string;
  firstMessageTime_month?: string;
  type_hour?: string;
  type_day?: string;
  type_week?: string;
  type_month?: string;
  properties_hour?: string;
  properties_day?: string;
  properties_week?: string;
  properties_month?: string;
  userProperties_hour?: string;
  userProperties_day?: string;
  userProperties_week?: string;
  userProperties_month?: string;
  sum_id?: number;
  sum_userMessageCount?: number;
  sum_organizationId?: number;
  sum_projectId?: number;
  sum_integrationId?: number;
  sum_firstMessageTime?: number;
  sum_type?: number;
  sum_properties?: number;
  sum_userProperties?: number;
  count_id?: number;
  count_userMessageCount?: number;
  count_organizationId?: number;
  count_projectId?: number;
  count_integrationId?: number;
  count_firstMessageTime?: number;
  count_type?: number;
  count_properties?: number;
  count_userProperties?: number;
  avg_id?: number;
  avg_userMessageCount?: number;
  avg_organizationId?: number;
  avg_projectId?: number;
  avg_integrationId?: number;
  avg_firstMessageTime?: number;
  avg_type?: number;
  avg_properties?: number;
  avg_userProperties?: number;
  min_id?: number;
  min_userMessageCount?: number;
  min_organizationId?: number;
  min_projectId?: number;
  min_integrationId?: number;
  min_firstMessageTime?: number;
  min_type?: number;
  min_properties?: number;
  min_userProperties?: number;
  max_id?: number;
  max_userMessageCount?: number;
  max_organizationId?: number;
  max_projectId?: number;
  max_integrationId?: number;
  max_firstMessageTime?: number;
  max_type?: number;
  max_properties?: number;
  max_userProperties?: number;
  "sum_properties.userId"?: number;
  "sum_properties.supportAgentName"?: number;
  "sum_userProperties.userId"?: number;
  "sum_userProperties.supportAgentName"?: number;
  "count_properties.userId"?: number;
  "count_properties.supportAgentName"?: number;
  "count_userProperties.userId"?: number;
  "count_userProperties.supportAgentName"?: number;
  "countDistinct_properties.userId"?: number;
  "countDistinct_properties.supportAgentName"?: number;
  "countDistinct_userProperties.userId"?: number;
  "countDistinct_userProperties.supportAgentName"?: number;
  "avg_properties.userId"?: number;
  "avg_properties.supportAgentName"?: number;
  "avg_userProperties.userId"?: number;
  "avg_userProperties.supportAgentName"?: number;
  "min_properties.userId"?: number;
  "min_properties.supportAgentName"?: number;
  "min_userProperties.userId"?: number;
  "min_userProperties.supportAgentName"?: number;
  "max_properties.userId"?: number;
  "max_properties.supportAgentName"?: number;
  "max_userProperties.userId"?: number;
  "max_userProperties.supportAgentName"?: number;
  "properties.userId"?: string | null;
  "properties.supportAgentName"?: string | null;
  "userProperties.userId"?: string | null;
  "userProperties.supportAgentName"?: string | null;
}
 
curl -X POST "https://api.analytics.inkeep.com/query/conversations" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "select": [
      {
        "type": "aggregation",
        "aggregation": "sum",
        "field": "id",
        "path": [
          "string"
        ]
      }
    ],
    "groupBy": [
      {
        "field": "id",
        "path": [
          "string"
        ],
        "includeInSelect": true
      }
    ],
    "where": {
      "condition": {
        "field": "id",
        "operator": "eq",
        "value": "string"
      }
    },
    "orderBy": [
      {
        "field": "id",
        "direction": "asc"
      }
    ],
    "notes": "Count of support ticket conversations by integration"
  }'
{
  "status": "ok",
  "data": {
    "result": [
      {
        "id": "string",
        "userMessageCount": 0,
        "organizationId": "string",
        "projectId": "string",
        "integrationId": "string",
        "firstMessageTime": "2019-08-24T14:15:22Z",
        "type": "openai",
        "properties": {},
        "userProperties": {
          "id": "string",
          "identificationType": "COOKIED",
          "userId": "string",
          "supportAgentName": "string"
        },
        "sum": 0,
        "count": 0,
        "avg": 0,
        "min": 0,
        "max": 0,
        "id_hour": "string",
        "id_day": "string",
        "id_week": "string",
        "id_month": "string",
        "userMessageCount_hour": "string",
        "userMessageCount_day": "string",
        "userMessageCount_week": "string",
        "userMessageCount_month": "string",
        "organizationId_hour": "string",
        "organizationId_day": "string",
        "organizationId_week": "string",
        "organizationId_month": "string",
        "projectId_hour": "string",
        "projectId_day": "string",
        "projectId_week": "string",
        "projectId_month": "string",
        "integrationId_hour": "string",
        "integrationId_day": "string",
        "integrationId_week": "string",
        "integrationId_month": "string",
        "firstMessageTime_hour": "string",
        "firstMessageTime_day": "string",
        "firstMessageTime_week": "string",
        "firstMessageTime_month": "string",
        "type_hour": "string",
        "type_day": "string",
        "type_week": "string",
        "type_month": "string",
        "properties_hour": "string",
        "properties_day": "string",
        "properties_week": "string",
        "properties_month": "string",
        "userProperties_hour": "string",
        "userProperties_day": "string",
        "userProperties_week": "string",
        "userProperties_month": "string",
        "sum_id": 0,
        "sum_userMessageCount": 0,
        "sum_organizationId": 0,
        "sum_projectId": 0,
        "sum_integrationId": 0,
        "sum_firstMessageTime": 0,
        "sum_type": 0,
        "sum_properties": 0,
        "sum_userProperties": 0,
        "count_id": 0,
        "count_userMessageCount": 0,
        "count_organizationId": 0,
        "count_projectId": 0,
        "count_integrationId": 0,
        "count_firstMessageTime": 0,
        "count_type": 0,
        "count_properties": 0,
        "count_userProperties": 0,
        "avg_id": 0,
        "avg_userMessageCount": 0,
        "avg_organizationId": 0,
        "avg_projectId": 0,
        "avg_integrationId": 0,
        "avg_firstMessageTime": 0,
        "avg_type": 0,
        "avg_properties": 0,
        "avg_userProperties": 0,
        "min_id": 0,
        "min_userMessageCount": 0,
        "min_organizationId": 0,
        "min_projectId": 0,
        "min_integrationId": 0,
        "min_firstMessageTime": 0,
        "min_type": 0,
        "min_properties": 0,
        "min_userProperties": 0,
        "max_id": 0,
        "max_userMessageCount": 0,
        "max_organizationId": 0,
        "max_projectId": 0,
        "max_integrationId": 0,
        "max_firstMessageTime": 0,
        "max_type": 0,
        "max_properties": 0,
        "max_userProperties": 0,
        "sum_properties.userId": 0,
        "sum_properties.supportAgentName": 0,
        "sum_userProperties.userId": 0,
        "sum_userProperties.supportAgentName": 0,
        "count_properties.userId": 0,
        "count_properties.supportAgentName": 0,
        "count_userProperties.userId": 0,
        "count_userProperties.supportAgentName": 0,
        "countDistinct_properties.userId": 0,
        "countDistinct_properties.supportAgentName": 0,
        "countDistinct_userProperties.userId": 0,
        "countDistinct_userProperties.supportAgentName": 0,
        "avg_properties.userId": 0,
        "avg_properties.supportAgentName": 0,
        "avg_userProperties.userId": 0,
        "avg_userProperties.supportAgentName": 0,
        "min_properties.userId": 0,
        "min_properties.supportAgentName": 0,
        "min_userProperties.userId": 0,
        "min_userProperties.supportAgentName": 0,
        "max_properties.userId": 0,
        "max_properties.supportAgentName": 0,
        "max_userProperties.userId": 0,
        "max_userProperties.supportAgentName": 0,
        "properties.userId": "string",
        "properties.supportAgentName": "string",
        "userProperties.userId": "string",
        "userProperties.supportAgentName": "string"
      }
    ],
    "total": 0,
    "pageSize": 0,
    "count": 0
  }
}