> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nebuly.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Interaction Multi Aggregates

You need an API key to authenticate. See [here](/embedded-pages/quickstart) for more information about the API keys.

<ParamField body="time_range" type="object" required>
  The time range to consider when computing the metrics and analytics to show.

  <Expandable title="properties">
    <ParamField path="start" type="string" default="2024-05-30T09:27:52.420Z" required>
      The start date for the time-range.
    </ParamField>

    <ParamField path="end" type="string" default="2024-05-30T09:27:52.420Z" required>
      The end date for the time-range.
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="filters" type="object[]" required>
  Filters you can use to get data based only on the interactions you are interested in.

  <Expandable title="properties">
    <ParamField path="kind" type="string" required>
      The filter kind. It can be one of the following values:

      * user\_intent
      * negative\_user\_intent
      * keyword
      * user\_feedback
      * tag
      * type\_of\_problem
      * topic
      * user
      * user\_query
    </ParamField>

    <ParamField path="tag" type="string">
      Optional field to be used only when the kind is tag. It should specify the tag name, which is the same as the key you used in the tags dictionary during the interaction submission.
    </ParamField>

    <ParamField path="values" type="string[]" required>
      The values of the selected filter you want to filter on. Note that all the values passed in
      the list are considered to be in "or" the one with the other. This means that if the kind is
      "topic" and the passed values are "value A", "value B", this is equal to `topic="value A" or topic="value B"`.
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="group_by_groups" type="object[][]">
  You can use group\_by filters to aggregate data according to your preferences. This endpoint allows you to get data aggregated in different ways with a single call.

  For example, if you want both `negative_intent` and `intents` in a single API call, you can set the `group_by_groups` value to the following list:

  ```
  [[{kind: user_intent}], [{kind: negative_user_intent}]]
  ```

  The inner lists can specify additional groupings for splitting your data. Suppose you want to get both `intent` and `negative_user_intent` further split by `topic`. In this case, your request should include the field as:

  ```
  [[{kind: user_intent}, {kind: topic}], [{kind: negative_user_intent}, {kind: topic}]]
  ```

  <Expandable title="properties">
    <ParamField path="kind" type="string" required>
      The filter kind. It can be one of the following values:

      * user\_intent
      * negative\_user\_intent
      * keyword
      * user\_feedback
      * tag
      * type\_of\_problem
      * topic
      * user
      * user\_query
    </ParamField>

    <ParamField path="tag" type="string">
      Optional field to be used only when the kind is tag. It should specify the tag name, which is the same as the key you used in the tags dictionary during the interaction submission.
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="variables" type="string[]">
  The variables for which values are required. If not specified, all available variables will be computed.
  The supported variables are

  * n\_interactions
  * n\_users
  * user\_feedback
  * cost
  * latency\_seconds
  * n\_intents
  * retention
</ParamField>

<ParamField body="limit" type="integer" required>
  Parameter needed for pagination. It indicates the number of rows per page.
</ParamField>

<ParamField body="offset" type="integer" required>
  Parameter needed for pagination. It indicates the offset to be applied to the first rows returned.
</ParamField>

# Response

<ResponseField name="total" type="integer">
  Needed for pagination. The total number of rows available.
</ResponseField>

<ResponseField name="offset" type="integer">
  Needed for pagination. It indicates the offset to be applied to the first rows returned.
</ResponseField>

<ResponseField name="limit" type="integer">
  Needed for pagination. It indicates the number of rows per page.
</ResponseField>

<ResponseField name="data" type="object[]">
  The data aggregated using the given group\_by field.

  <Expandable title="properties">
    <ResponseField name="group_name" type="string">
      The value of the group\_by filter selected as input.
    </ResponseField>

    <ResponseField name="n_interactions" type="integer">
      The total number of interaction for the selected group.
    </ResponseField>

    <ResponseField name="n_users" type="integer">
      The total number of distinct users for the selected group.
    </ResponseField>

    <ResponseField name="n_positive_implicit_user_feedback" type="integer">
      The total number of positive implicit feedback for the selected group.
    </ResponseField>

    <ResponseField name="n_negative_implicit_user_feedback" type="integer">
      The total number of negative implicit feedback for the selected group.
    </ResponseField>

    <ResponseField name="n_positive_explicit_user_feedback" type="integer">
      The total number of positive explicit feedback for the selected group.
    </ResponseField>

    <ResponseField name="n_negative_explicit_user_feedback" type="integer">
      The total number of negative explicit feedback for the selected group.
    </ResponseField>

    <ResponseField name="n_feedback" type="integer">
      The total number of feedback for the selected group.
    </ResponseField>

    <ResponseField name="cost" type="float">
      The total cost for the selected group.
    </ResponseField>

    <ResponseField name="latency_seconds" type="float">
      The average latency, i.e. time-to-response, for the selected group.
    </ResponseField>
  </Expandable>
</ResponseField>
