> ## 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 Aggregates V2

This endpoint returns the same grouped interaction metrics as [Get Interaction Aggregates](https://docs.nebuly.com/embedded-pages/interactions/get-interaction-aggregates.md), with a shorter response. The request body is the same: `time_range`, `filters`, `group_by`, `additional_group_bys`, `variables`, `order_by`, `limit`, and `offset`. If `variables` is omitted, the API computes `n_interactions`, `n_users`, `cost`, and `latency_seconds`. Any variable you do not request is null.

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

```python Request theme={null}
import requests

url = "https://backend.nebuly.com/api/external/get-interaction-aggregates-v2"
headers = {
    "Authorization": "Bearer <YOUR_API_KEY>"
}
payload = {
    "time_range": {
        "start": "2024-05-01T00:00:00Z",
        "end": "2024-05-31T23:59:59Z",
    },
    "filters": [],
    "variables": ["n_interactions", "aifi_score"],
}

response = requests.post(url, headers=headers, json=payload)
print(response.json())
```

```json Response theme={null}
{
  "data": [
    {
      "group_name": "total",
      "n_interactions": 120,
      "aifi_proficiency_score": 45.0
    }
  ],
  "total": 1,
  "limit": 10,
  "offset": 0
}
```

**total** `integer`

The total number of groups.

**offset** `integer`

The offset used for pagination.

**limit** `integer`

The maximum number of groups returned.

**data** `object[]`

Aggregated values for each group.

**properties**

**group\_name** `string`

The group name.

**additional\_groups** `string[]`

Names for the additional group-by dimensions, when requested.

**n\_interactions** `integer`

The number of interactions in the group.

**n\_interactions\_prev** `integer`

The number of interactions in the previous period.

**n\_users** `integer`

The number of users in the group.

**n\_users\_prev** `integer`

The number of users in the previous period.

**n\_feedback** `integer`

The number of feedback events in the group.

**n\_feedback\_prev** `integer`

The number of feedback events in the previous period.

**n\_positive\_implicit\_user\_feedback** `integer`

Positive implicit feedback in the group.

**n\_negative\_implicit\_user\_feedback** `integer`

Negative implicit feedback in the group.

**n\_positive\_explicit\_user\_feedback** `integer`

Positive explicit feedback in the group.

**n\_negative\_explicit\_user\_feedback** `integer`

Negative explicit feedback in the group.

**n\_positive\_implicit\_user\_feedback\_prev** `integer`

Positive implicit feedback in the previous period.

**n\_negative\_implicit\_user\_feedback\_prev** `integer`

Negative implicit feedback in the previous period.

**n\_positive\_explicit\_user\_feedback\_prev** `integer`

Positive explicit feedback in the previous period.

**n\_negative\_explicit\_user\_feedback\_prev** `integer`

Negative explicit feedback in the previous period.

**n\_intents** `integer`

The number of intents in the group.

**n\_intents\_prev** `integer`

The number of intents in the previous period.

**cost** `float`

The total cost for the group.

**latency\_seconds** `float`

The average latency for the group, in seconds.

**retention** `float`

Retention for the group.

**session\_length** `float`

Average session length for the group.

**session\_time** `float`

Average session time for the group.

**n\_sessions** `integer`

The number of sessions in the group.

**n\_sessions\_prev** `integer`

The number of sessions in the previous period.

**n\_segments** `integer`

The number of segments in the group.

**n\_segments\_prev** `integer`

The number of segments in the previous period.

**topics** `string[]`

Topics present in the group.

**input\_length** `float`

Average input length for the group.

**input\_length\_prev** `float`

Average input length in the previous period.

**input\_tokens** `integer`

Input tokens for the group.

**input\_tokens\_prev** `integer`

Input tokens in the previous period.

**output\_tokens** `integer`

Output tokens for the group.

**output\_tokens\_prev** `integer`

Output tokens in the previous period.

**aifi\_proficiency\_score** `float`

AI Proficiency for the selected group, with two digits after the decimal. Null when the group has no proficiency score.

**aifi\_proficiency\_score\_prev** `float`

AI Proficiency for the selected group in the previous period. Null when the group has no proficiency score.

**aifi\_proficiency\_task\_clarity\_score** `float`

Task clarity component of AI Proficiency, with two digits after the decimal. Null when the group has no score.

**aifi\_proficiency\_context\_provision\_score** `float`

Context provision component of AI Proficiency, with two digits after the decimal. Null when the group has no score.

**aifi\_proficiency\_output\_specification\_score** `float`

Output specification component of AI Proficiency, with two digits after the decimal. Null when the group has no score.

**aifi\_proficiency\_prompt\_length\_score** `float`

Prompt length component of AI Proficiency, with two digits after the decimal. Null when the group has no score.

**aifi\_proficiency\_conversation\_efficiency\_score** `float`

Conversation efficiency component of AI Proficiency, with two digits after the decimal. Null when the group has no score.

**aifi\_proficiency\_constraint\_specification\_score** `float`

Constraint specification component of AI Proficiency, with two digits after the decimal. Null when the group has no score.

**aifi\_proficiency\_moved\_up** `integer`

Users in the group whose AI Proficiency moved up. Null when it was not requested.

**aifi\_proficiency\_slipped\_back** `integer`

Users in the group whose AI Proficiency slipped back. Null when it was not requested.

**aifi\_proficiency\_stayed** `integer`

Users in the group whose AI Proficiency stayed the same. Null when it was not requested.

**roi\_hours\_saved** `float`

Hours saved for the selected group when ROI is enabled. Null when ROI is off.

**roi\_hours\_saved\_prev** `float`

Hours saved for the selected group in the previous period. Null when ROI is off.

**roi\_value\_saved** `float`

Value saved for the selected group when ROI is enabled. Null when ROI is off.

**roi\_value\_saved\_prev** `float`

Value saved for the selected group in the previous period. Null when ROI is off.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.