Analytics apiQueryQuery

Query Conversations

Copy page

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>
whereobject
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

TypeScript Definitions

Use the response body type in TypeScript.

statusRequiredstring

Status of the response

Value in: "ok"
dataRequiredobject

Data object containing QueryConversations query results and pagination information

Bad Request

TypeScript Definitions

Use the response body type in TypeScript.

titleRequiredstring

A short, human-readable summary of the problem type.

statusRequirednumber

The HTTP status code.

Value in: 400
detailRequiredstring

A detailed explanation specific to this occurrence of the problem, providing context and specifics about what went wrong.

instancestring

A URI reference that identifies the specific occurrence of the problem.

requestIdstring

A unique identifier for the request, useful for troubleshooting.

codeRequiredstring

A short code indicating the error code returned.

Value in: "bad_request"
errorRequiredobject

Legacy error format for backward compatibility.

Unauthorized

TypeScript Definitions

Use the response body type in TypeScript.

titleRequiredstring

A short, human-readable summary of the problem type.

statusRequirednumber

The HTTP status code.

Value in: 401
detailRequiredstring

A detailed explanation specific to this occurrence of the problem, providing context and specifics about what went wrong.

instancestring

A URI reference that identifies the specific occurrence of the problem.

requestIdstring

A unique identifier for the request, useful for troubleshooting.

codeRequiredstring

A short code indicating the error code returned.

Value in: "unauthorized"
errorRequiredobject

Legacy error format for backward compatibility.

Forbidden

TypeScript Definitions

Use the response body type in TypeScript.

titleRequiredstring

A short, human-readable summary of the problem type.

statusRequirednumber

The HTTP status code.

Value in: 403
detailRequiredstring

A detailed explanation specific to this occurrence of the problem, providing context and specifics about what went wrong.

instancestring

A URI reference that identifies the specific occurrence of the problem.

requestIdstring

A unique identifier for the request, useful for troubleshooting.

codeRequiredstring

A short code indicating the error code returned.

Value in: "forbidden"
errorRequiredobject

Legacy error format for backward compatibility.

Unprocessable Entity

TypeScript Definitions

Use the response body type in TypeScript.

titleRequiredstring

A short, human-readable summary of the problem type.

statusRequirednumber

The HTTP status code.

Value in: 422
detailRequiredstring

A detailed explanation specific to this occurrence of the problem, providing context and specifics about what went wrong.

instancestring

A URI reference that identifies the specific occurrence of the problem.

requestIdstring

A unique identifier for the request, useful for troubleshooting.

codeRequiredstring

A short code indicating the error code returned.

Value in: "unprocessable_entity"
errorRequiredobject

Legacy error format for backward compatibility.

Internal Server Error

TypeScript Definitions

Use the response body type in TypeScript.

titleRequiredstring

A short, human-readable summary of the problem type.

statusRequirednumber

The HTTP status code.

Value in: 500
detailRequiredstring

A detailed explanation specific to this occurrence of the problem, providing context and specifics about what went wrong.

instancestring

A URI reference that identifies the specific occurrence of the problem.

requestIdstring

A unique identifier for the request, useful for troubleshooting.

codeRequiredstring

A short code indicating the error code returned.

Value in: "internal_server_error"
errorRequiredobject

Legacy error format for backward compatibility.

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"
  }'
const body = JSON.stringify({
  "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"
})

fetch("https://api.analytics.inkeep.com/query/conversations", {
  headers: {
    "Authorization": "Bearer <token>"
  },
  body
})
package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
  "strings"
)

func main() {
  url := "https://api.analytics.inkeep.com/query/conversations"
  body := strings.NewReader(`{
    "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"
  }`)
  req, _ := http.NewRequest("POST", url, body)
  req.Header.Add("Authorization", "Bearer <token>")
  req.Header.Add("Content-Type", "application/json")
  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))
}
import requests

url = "https://api.analytics.inkeep.com/query/conversations"
body = {
  "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"
}
response = requests.request("POST", url, json = body, headers = {
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
})

print(response.text)
{
  "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
  }
}
{
  "title": "Bad Request",
  "status": 400,
  "detail": "Bad Request",
  "instance": "/conversations/123",
  "requestId": "req_1234567890",
  "code": "bad_request",
  "error": {
    "code": "bad_request",
    "message": "Bad Request"
  }
}
{
  "title": "Unauthorized",
  "status": 401,
  "detail": "Unauthorized",
  "instance": "/conversations/123",
  "requestId": "req_1234567890",
  "code": "unauthorized",
  "error": {
    "code": "unauthorized",
    "message": "Unauthorized"
  }
}
{
  "title": "Forbidden",
  "status": 403,
  "detail": "Forbidden",
  "instance": "/conversations/123",
  "requestId": "req_1234567890",
  "code": "forbidden",
  "error": {
    "code": "forbidden",
    "message": "Forbidden"
  }
}
{
  "title": "Unprocessable Entity",
  "status": 422,
  "detail": "Unprocessable Entity",
  "instance": "/conversations/123",
  "requestId": "req_1234567890",
  "code": "unprocessable_entity",
  "error": {
    "code": "unprocessable_entity",
    "message": "Unprocessable Entity"
  }
}
{
  "title": "Internal Server Error",
  "status": 500,
  "detail": "Internal Server Error",
  "instance": "/conversations/123",
  "requestId": "req_1234567890",
  "code": "internal_server_error",
  "error": {
    "code": "internal_server_error",
    "message": "Internal Server Error"
  }
}