---
title: "Aggregate RUM events"
method: POST
path: "/api/v2/rum/analytics/aggregate"
tags: ["RUM"]
---

# Aggregate RUM events

`POST /api/v2/rum/analytics/aggregate`

The API endpoint to aggregate RUM events into buckets of computed metrics and timeseries.

## Request body

- RUMAggregateRequest — The object sent with the request to retrieve aggregation buckets of RUM events from your organization.
  - `compute` RUMCompute[] — The list of metrics or timeseries to compute for the retrieved buckets.
    - `aggregation` 'count' | 'cardinality' | 'pc75' | 'pc90' | 'pc95' | 'pc98' | 'pc99' | 'sum' | 'min' | 'max' | 'avg' | 'median', required — An aggregation function.
    - `interval` string — The time buckets' size (only used for type=timeseries) Defaults to a resolution of 150 points.
    - `metric` string — The metric to use.
    - `type` 'timeseries' | 'total' — The type of compute.
  - `filter` RUMQueryFilter — The search and filter query settings.
    - `from` string — The minimum time for the requested events; supports date (in [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format with full date, hours, minutes, and the `Z` UTC indicator - seconds and fractional seconds are optional), math, and regular timestamps (in milliseconds).
    - `query` string — The search query following the RUM search syntax.
    - `to` string — The maximum time for the requested events; supports date (in [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format with full date, hours, minutes, and the `Z` UTC indicator - seconds and fractional seconds are optional), math, and regular timestamps (in milliseconds).
  - `group_by` RUMGroupBy[] — The rules for the group by.
    - `facet` string, required — The name of the facet to use (required).
    - `histogram` RUMGroupByHistogram — Used to perform a histogram computation (only for measure facets). Note: At most 100 buckets are allowed, the number of buckets is (max - min)/interval.
      - `interval` number, double, required — The bin size of the histogram buckets.
      - `max` number, double, required — The maximum value for the measure used in the histogram (values greater than this one are filtered out).
      - `min` number, double, required — The minimum value for the measure used in the histogram (values smaller than this one are filtered out).
    - `limit` integer — The maximum buckets to return for this group-by.
    - `missing` union — The value to use for logs that don't have the facet used to group by.
      - string — The missing value to use if there is string valued facet.
      - number, double — The missing value to use if there is a number valued facet.
    - `sort` RUMAggregateSort — A sort rule.
      - `aggregation` 'count' | 'cardinality' | 'pc75' | 'pc90' | 'pc95' | 'pc98' | 'pc99' | 'sum' | 'min' | 'max' | 'avg' | 'median' — An aggregation function.
      - `metric` string — The metric to sort by (only used for `type=measure`).
      - `order` 'asc' | 'desc' — The order to use, ascending or descending.
      - `type` 'alphabetical' | 'measure' — The type of sorting algorithm.
    - `total` union — A resulting object to put the given computes in over all the matching records.
      - boolean — If set to true, creates an additional bucket labeled "$facet_total".
      - string — A string to use as the key value for the total bucket.
      - number, double — A number to use as the key value for the total bucket.
  - `options` RUMQueryOptions — Global query options that are used during the query. Note: Only supply timezone or time offset, not both. Otherwise, the query fails.
    - `time_offset` integer — The time offset (in seconds) to apply to the query.
    - `timezone` string — The timezone can be specified as GMT, UTC, an offset from UTC (like UTC+1), or as a Timezone Database identifier (like America/New_York).
  - `page` RUMQueryPageOptions — Paging attributes for listing events.
    - `cursor` string — List following results with a cursor provided in the previous query.
    - `limit` integer — Maximum number of events in the response.

## Response `200`

OK

- RUMAnalyticsAggregateResponse — The response object for the RUM events aggregate API endpoint.
  - `data` RUMAggregationBucketsResponse — The query results.
    - `buckets` RUMBucketResponse[] — The list of matching buckets, one item per bucket.
      - `by` object — The key-value pairs for each group-by.
      - `computes` object — A map of the metric name to value for regular compute, or a list of values for a timeseries.
  - `links` RUMResponseLinks — Links attributes.
    - `next` string — Link for the next set of results. Note that the request can also be made using the POST endpoint.
  - `meta` RUMResponseMetadata — The metadata associated with a request.
    - `elapsed` integer — The time elapsed in milliseconds.
    - `page` RUMResponsePage — Paging attributes.
      - `after` string — The cursor to use to get the next results, if any. To make the next request, use the same parameters with the addition of `page[cursor]`.
    - `request_id` string — The identifier of the request.
    - `status` 'done' | 'timeout' — The status of the response.
    - `warnings` RUMWarning[] — A list of warnings (non-fatal errors) encountered. Partial results may return if warnings are present in the response.
      - `code` string — A unique code for this type of warning.
      - `detail` string — A detailed explanation of this specific warning.
      - `title` string — A short human-readable summary of the warning.

## Other responses

- `400` — Bad Request
- `403` — Not Authorized
- `429` — Too many requests

---

[API](https://skmtc.net/datadog/apis/api-v2.md) · [All operations](https://skmtc.net/datadog/apis/api-v2/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/datadog/api-v2/versions/da68bf029e4c/schema)
