# Events ingestion monitoring

This page shows you how to start using the events ingestion monitoring API.

When we collect activities, we track the number of events that go through each step of the mediarithmics data pipeline.

This API is a mediarithmics [Data cube](https://developer.mediarithmics.io/resources/data-cubes) and works similarly to [Activities analytics queries API](https://developer.mediarithmics.io/querying-your-data/activities-analytics-queries).&#x20;

## Quickstart

<mark style="color:green;">`POST`</mark> `https://api.mediarithmics.com/v1/platform_monitoring/data_ingestion`

#### Request Body

| Name                                         | Type       | Description                                                                                                                                                                             |
| -------------------------------------------- | ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| metrics<mark style="color:red;">\*</mark>    | array      | Array of [Metric](https://developer.mediarithmics.io/resources/data-cubes/reference#metric) to retrieve.                                                                                |
| dimension\_filter\_clauses                   | object     | Filters to apply on dimensions before calculating the metric. For more information, see [FilterClause](https://developer.mediarithmics.io/resources/data-cubes/reference#filterclause). |
| dimensions<mark style="color:red;">\*</mark> | Dimensions | [Dimensions](https://developer.mediarithmics.io/resources/data-cubes/reference#dimension) to group metrics by.                                                                          |
| date\_ranges                                 | array      | Periods to analyze. Each date range is an object with a `start_date` and an `end_date`. See [DateRange](https://developer.mediarithmics.io/resources/data-cubes/reference#daterange).   |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

Here is a sample [report request](https://developer.mediarithmics.io/resources/data-cubes/creating-a-report#report-request) body payload with all the important properties:

<pre class="language-json"><code class="lang-json"><strong>{
</strong>    // Retrieve the data in the specified date range
    // Mandatory
    // Tip : you can use relative date formats such as "now-7d/d"
    "date_ranges": [
        {
            "start_date": "2021-10-10T00:00:00",
            "end_date": "2021-10-25T23:59:59"
        }
    ],
    // List of dimensions to retrieve
    "dimensions": [
        {
            "name": "date_time"
        },
        {
            "name": "datamart_id"
        },
        {
            "name": "pipeline_step"
        }
    ],
    // List of metrics to retrieve
    "metrics": [
        {
            "expression": "event_count"
        }
    ]
}
</code></pre>

## Available pipeline steps

We monitor the number of events that reach the given ingestion steps:&#x20;

<table><thead><tr><th>Step</th><th>Description</th></tr></thead><tbody><tr><td><pre><code>JS_TAG
</code></pre></td><td>Measure the number of events sent by the mediarithmics Javascript TAG </td></tr><tr><td><pre><code><strong>API
</strong></code></pre></td><td>Measure the number of events sent through the ingestion API<br><code>api.mediarithmics.com/v1/datamarts/{datamart_id}/user_activities</code> </td></tr><tr><td><pre><code>DOCUMENT_IMPORT
</code></pre></td><td>Measure the number of events sent through the USER_ACTIVITY imports with the <a href="../../resources/your-first-integration/make-the-first-bulk-import">document import feature</a></td></tr><tr><td><pre><code>EVENT_RULES
</code></pre></td><td>Measure the number of events that match configures rules</td></tr><tr><td><pre><code>ACTIVITY_ANALYZER
</code></pre></td><td>Measure the number of events that pass through activity analyzer plugins</td></tr><tr><td><pre><code>DOCUMENT_STORE
</code></pre></td><td>Measure the number of events that are stored in the mediarithmics platform.</td></tr></tbody></table>

## Retention

These aggregated stats are kept for 3 months.

## Supported dimensions and metrics

See [Dimensions and metrics](https://developer.mediarithmics.io/advanced-usages/platform-monitoring/events-ingestion-monitoring/dimensions-and-metrics) for the complete list of supported dimensions and metrics.

## Learning more about data cubes

This endpoint is a mediarithmics [Data cube](https://developer.mediarithmics.io/resources/data-cubes). You can find documentation on how data cubes work and which data cubes are availables in the specific documentation section.
