Analytics apiQuery

Query Events

POST
/query/events

Authorization

AuthorizationRequiredBearer <token>

The API key for a Web integration

In: header

AuthorizationRequiredBearer <token>

The API key for an API integration

In: header

Request Body

application/jsonRequired

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

selectarray<EventsSelection>
groupByarray<EventsGroupBy>
whereEventsFilter
orderByarray<Events OrderBy Schema>
notesstring

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

Maximum length: 80
curl -X POST "https://api.analytics.inkeep.com/query/events" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "select": [
      {
        "type": "aggregation",
        "aggregation": "sum",
        "field": "id"
      }
    ],
    "groupBy": [
      {
        "field": "id",
        "includeInSelect": true
      }
    ],
    "where": {
      "condition": {
        "field": "id",
        "operator": "eq",
        "value": "string"
      }
    },
    "orderBy": [
      {
        "field": "id",
        "direction": "asc"
      }
    ],
    "notes": "Count of events by type"
  }'

Query results

{
  "status": "ok",
  "data": {
    "result": [
      {
        "id": "string",
        "organizationId": "string",
        "messageId": "string",
        "conversationId": "string",
        "createdAt": "string",
        "projectId": "string",
        "integrationId": "string",
        "eventType": "string",
        "type": "string",
        "searchQuery": "string",
        "properties": {
          "property1": "string",
          "property2": "string"
        },
        "userProperties": {
          "property1": "string",
          "property2": "string"
        },
        "sum": 0,
        "count": 0,
        "avg": 0,
        "min": 0,
        "max": 0,
        "id_hour": "string",
        "id_day": "string",
        "id_week": "string",
        "id_month": "string",
        "organizationId_hour": "string",
        "organizationId_day": "string",
        "organizationId_week": "string",
        "organizationId_month": "string",
        "messageId_hour": "string",
        "messageId_day": "string",
        "messageId_week": "string",
        "messageId_month": "string",
        "conversationId_hour": "string",
        "conversationId_day": "string",
        "conversationId_week": "string",
        "conversationId_month": "string",
        "createdAt_hour": "string",
        "createdAt_day": "string",
        "createdAt_week": "string",
        "createdAt_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",
        "eventType_hour": "string",
        "eventType_day": "string",
        "eventType_week": "string",
        "eventType_month": "string",
        "type_hour": "string",
        "type_day": "string",
        "type_week": "string",
        "type_month": "string",
        "searchQuery_hour": "string",
        "searchQuery_day": "string",
        "searchQuery_week": "string",
        "searchQuery_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_organizationId": 0,
        "sum_messageId": 0,
        "sum_conversationId": 0,
        "sum_createdAt": 0,
        "sum_projectId": 0,
        "sum_integrationId": 0,
        "sum_eventType": 0,
        "sum_type": 0,
        "sum_searchQuery": 0,
        "sum_properties": 0,
        "sum_userProperties": 0,
        "count_id": 0,
        "count_organizationId": 0,
        "count_messageId": 0,
        "count_conversationId": 0,
        "count_createdAt": 0,
        "count_projectId": 0,
        "count_integrationId": 0,
        "count_eventType": 0,
        "count_type": 0,
        "count_searchQuery": 0,
        "count_properties": 0,
        "count_userProperties": 0,
        "avg_id": 0,
        "avg_organizationId": 0,
        "avg_messageId": 0,
        "avg_conversationId": 0,
        "avg_createdAt": 0,
        "avg_projectId": 0,
        "avg_integrationId": 0,
        "avg_eventType": 0,
        "avg_type": 0,
        "avg_searchQuery": 0,
        "avg_properties": 0,
        "avg_userProperties": 0,
        "min_id": 0,
        "min_organizationId": 0,
        "min_messageId": 0,
        "min_conversationId": 0,
        "min_createdAt": 0,
        "min_projectId": 0,
        "min_integrationId": 0,
        "min_eventType": 0,
        "min_type": 0,
        "min_searchQuery": 0,
        "min_properties": 0,
        "min_userProperties": 0,
        "max_id": 0,
        "max_organizationId": 0,
        "max_messageId": 0,
        "max_conversationId": 0,
        "max_createdAt": 0,
        "max_projectId": 0,
        "max_integrationId": 0,
        "max_eventType": 0,
        "max_type": 0,
        "max_searchQuery": 0,
        "max_properties": 0,
        "max_userProperties": 0
      }
    ],
    "total": 0,
    "pageSize": 0,
    "count": 0
  }
}