> For the complete documentation index, see [llms.txt](https://docs.xenioo.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.xenioo.com/xenioo-api/globa-platform-api/statistics/runtime-data.md).

# Account Statistics Data

This endpoint can be used to retrieve statistics data for your account or a specific chatbot. It differs from the specific bot statistics data endpoint as it can be used to obtain data for all of the bots associated to an account.

The data you can retrieve with this API endpoint is identical to the data available in live [dashboards](/analytics/dashboards.md).

{% hint style="info" %}
Account Statistics calls are throttled at 1 call per account per hour. Trying to access this endpoint before the expired hour will result in an error.
{% endhint %}

### Request

The following request will retrieve statistics data:

```bash
curl --location --request GET 
'https://publicapi.xenioo.com/analytics/statistics/account/<APIKEY>/<TYPES>/<GROUPMODE>/<DAYS>' \
--header 'Authorization: Bearer <ACCOUNT_AUTH_TOKEN>' \
--header 'Content-Type: application/json'
```

### Parameters

The following parameters are expected on the endpoint:

| Parameter | Description                                                                                                                                |
| --------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
| APIKEY    | The API key of the bot for which you would like to filter the data. If you want the data of all of the bots, use a \* (wildcard) as value. |
| TYPES     | A comma separated list of all the possible types of analytic endpoints available. See belo table and example.                              |
| GROUPMODE | The time group mode for the returned values. Sett below table for possible values                                                          |
| DAYS      | The amount of history days to return. Acceptable values go from 1 to 30 days of history.                                                   |

Supported types are as follows:

| Type                        | Code |
| --------------------------- | ---- |
| New User                    | 0    |
| Returning User              | 1    |
| Active User                 | 2    |
| Messages                    | 3    |
| Action Messages             | 4    |
| Fallback Reply              | 5    |
| NLP Detected                | 6    |
| NLP Missed                  | 7    |
| Conversation Length         | 8    |
| Time To Pick Up             | 9    |
| Takeover Rate               | 10   |
| Support Conversation Length | 11   |
| Goal Reached                | 12   |
| Incoming Message            | 13   |
| API Request                 | 14   |
| API Request Error           | 15   |
| Time To First Message       | 16   |
| Operator Message            | 17   |

Time grouping modes can be instead one of the following:

| Value | Description             |
| ----- | ----------------------- |
| hour  | Group entries by hours  |
| day   | Group entries by days   |
| month | Group entries by months |
| year  | Group entries by years  |

### Response

If successful, the response will contain a detailed array of statistical data.

```javascript
[
   {
      "GroupLabel":"...",
      "BotName":"...",
      "ChannelName":"...",
      "EventLabel":"...",
      "IsPreviousPeriod":false,
      "GoalId":"...",
      "GoalName":"...",
      "ReferenceValue":0,
   } 
]
```

### Response Codes

This endpoint will reply with the following standard HTTP codes.

| Code | Meaning                                                      |
| ---- | ------------------------------------------------------------ |
| 200  | Ok. The request has been successfully fulfilled.             |
| 404  | Not Found. The specified  account or bot has not been found. |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.xenioo.com/xenioo-api/globa-platform-api/statistics/runtime-data.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
