---
title: Query aggregated waterfall
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: Docs > API Reference > RUM Insights
---

# Query aggregated waterfall{% #query-aggregated-waterfall %}
Copy pageCopied
{% tab title="v2" %}
**Note**: This endpoint is in preview and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
| Datadog site      | API endpoint                                                                     |
| ----------------- | -------------------------------------------------------------------------------- |
| ap1.datadoghq.com | POST https://api.ap1.datadoghq.com/api/v2/rum/query/insight/aggregated_waterfall |
| ap2.datadoghq.com | POST https://api.ap2.datadoghq.com/api/v2/rum/query/insight/aggregated_waterfall |
| app.datadoghq.eu  | POST https://api.datadoghq.eu/api/v2/rum/query/insight/aggregated_waterfall      |
| app.ddog-gov.com  | POST https://api.ddog-gov.com/api/v2/rum/query/insight/aggregated_waterfall      |
| us2.ddog-gov.com  | POST https://api.us2.ddog-gov.com/api/v2/rum/query/insight/aggregated_waterfall  |
| app.datadoghq.com | POST https://api.datadoghq.com/api/v2/rum/query/insight/aggregated_waterfall     |
| us3.datadoghq.com | POST https://api.us3.datadoghq.com/api/v2/rum/query/insight/aggregated_waterfall |
| us5.datadoghq.com | POST https://api.us5.datadoghq.com/api/v2/rum/query/insight/aggregated_waterfall |

### Overview

Get aggregated network resource waterfall data for a RUM view, sampled across multiple view instances. This endpoint requires the `rum_apps_read` permission.

### Request

#### Body Data (required)



{% tab title="Model" %}

| Parent field | Field                            | Type    | Description                                                                                                                                                                  |
| ------------ | -------------------------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|              | data [*required*]           | object  | Data envelope for an aggregated waterfall request.                                                                                                                           |
| data         | attributes [*required*]     | object  | Attributes for an aggregated waterfall query.                                                                                                                                |
| attributes   | application_id [*required*] | string  | The RUM application ID to analyze.                                                                                                                                           |
| attributes   | criteria                         | object  | Performance criteria to filter view instances by a metric threshold.                                                                                                         |
| criteria     | max                              | double  | Maximum threshold in seconds (inclusive).                                                                                                                                    |
| criteria     | metric [*required*]         | enum    | Performance metric used to filter view instances by threshold. Allowed enum values: `loading_time,largest_contentful_paint,first_contentful_paint,interaction_to_next_paint` |
| criteria     | min                              | double  | Minimum threshold in seconds (inclusive).                                                                                                                                    |
| attributes   | filter                           | string  | RUM query string to filter events (for example, @session.type:user @geo.country:US).                                                                                         |
| attributes   | from [*required*]           | int64   | Start of the time range as a Unix timestamp in seconds.                                                                                                                      |
| attributes   | include_global_appearance        | boolean | When true, enriches each resource with cross-view appearance statistics.                                                                                                     |
| attributes   | sample_size [*required*]    | int32   | Number of view instances to sample, between 1 and 500.                                                                                                                       |
| attributes   | to [*required*]             | int64   | End of the time range as a Unix timestamp in seconds.                                                                                                                        |
| attributes   | view_name [*required*]      | string  | The RUM view name to analyze (for example, /account/login).                                                                                                                  |
| data         | type [*required*]           | enum    | The JSON:API type for aggregated waterfall requests. Allowed enum values: `aggregated_waterfall`                                                                             |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "application_id": "ccbc53b1-74f2-496b-bdd7-9a8fa7b7376b",
      "criteria": {
        "max": 5,
        "metric": "largest_contentful_paint",
        "min": 2.5
      },
      "filter": "@session.type:user",
      "from": 1762437564,
      "include_global_appearance": false,
      "sample_size": 20,
      "to": 1762523964,
      "view_name": "/account/login(/:type)"
    },
    "type": "aggregated_waterfall"
  }
}
```

{% /tab %}

### Response

{% tab title="201" %}
Successful response
{% tab title="Model" %}
Response body for the aggregated waterfall endpoint.

| Parent field     | Field                                      | Type     | Description                                                                                                                                                                  |
| ---------------- | ------------------------------------------ | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|                  | data [*required*]                     | object   | Data envelope for an aggregated waterfall response.                                                                                                                          |
| data             | attributes [*required*]               | object   | Attributes of an aggregated waterfall response.                                                                                                                              |
| attributes       | application_id [*required*]           | string   | The RUM application ID that was analyzed.                                                                                                                                    |
| attributes       | criteria                                   | object   | Performance criteria to filter view instances by a metric threshold.                                                                                                         |
| criteria         | max                                        | double   | Maximum threshold in seconds (inclusive).                                                                                                                                    |
| criteria         | metric [*required*]                   | enum     | Performance metric used to filter view instances by threshold. Allowed enum values: `loading_time,largest_contentful_paint,first_contentful_paint,interaction_to_next_paint` |
| criteria         | min                                        | double   | Minimum threshold in seconds (inclusive).                                                                                                                                    |
| attributes       | from [*required*]                     | int64    | Start of the analyzed time range as a Unix timestamp in seconds.                                                                                                             |
| attributes       | resources [*required*]                | [object] | Network resources in chronological waterfall order.                                                                                                                          |
| resources        | avg_duration_ms [*required*]          | double   | Average total duration in milliseconds.                                                                                                                                      |
| resources        | avg_start_time_ms [*required*]        | double   | Average start time relative to view start in milliseconds.                                                                                                                   |
| resources        | cache_hit_rate_pct [*required*]       | double   | Cache hit rate as a percentage.                                                                                                                                              |
| resources        | cached_count [*required*]             | int32    | Number of requests served from cache.                                                                                                                                        |
| resources        | downloaded_count [*required*]         | int32    | Number of requests downloaded from the network.                                                                                                                              |
| resources        | global_p75_duration_ms                     | double   | 75th percentile duration across all view names in the application, present when include_global_appearance is true.                                                           |
| resources        | global_view_name_count                     | int32    | Number of distinct view names in the application that load this resource, present when include_global_appearance is true.                                                    |
| resources        | global_view_name_pct                       | double   | Percentage of distinct view names in the application that load this resource, present when include_global_appearance is true.                                                |
| resources        | http_method [*required*]              | string   | HTTP method for the resource request.                                                                                                                                        |
| resources        | load_frequency_pct [*required*]       | double   | Percentage of sampled view instances that loaded this resource.                                                                                                              |
| resources        | max_duration_ms [*required*]          | double   | Maximum duration in milliseconds.                                                                                                                                            |
| resources        | median_duration_ms [*required*]       | double   | Median duration in milliseconds.                                                                                                                                             |
| resources        | min_duration_ms [*required*]          | double   | Minimum duration in milliseconds.                                                                                                                                            |
| resources        | p75_duration_ms [*required*]          | double   | 75th percentile duration in milliseconds.                                                                                                                                    |
| resources        | p95_duration_ms [*required*]          | double   | 95th percentile duration in milliseconds.                                                                                                                                    |
| resources        | resource_type [*required*]            | string   | Resource type (JS, CSS, image, fetch, XHR, document, and so on).                                                                                                             |
| resources        | resource_url_path_group [*required*]  | string   | URL path group used to aggregate similar resources.                                                                                                                          |
| resources        | timing_breakdown [*required*]         | object   | Average timing breakdown per network phase for a resource.                                                                                                                   |
| timing_breakdown | avg_connect_ms [*required*]           | double   | Average TCP connect duration in milliseconds.                                                                                                                                |
| timing_breakdown | avg_dns_ms [*required*]               | double   | Average DNS resolution duration in milliseconds.                                                                                                                             |
| timing_breakdown | avg_download_ms [*required*]          | double   | Average download phase duration in milliseconds.                                                                                                                             |
| timing_breakdown | avg_first_byte_ms [*required*]        | double   | Average time to first byte in milliseconds.                                                                                                                                  |
| timing_breakdown | avg_redirect_ms [*required*]          | double   | Average redirect phase duration in milliseconds.                                                                                                                             |
| timing_breakdown | avg_ssl_ms [*required*]               | double   | Average SSL handshake duration in milliseconds.                                                                                                                              |
| resources        | total_requests [*required*]           | int32    | Total number of requests for this resource across all sampled views.                                                                                                         |
| resources        | views_with_resource [*required*]      | int32    | Number of sampled view instances that loaded this resource.                                                                                                                  |
| attributes       | sampled_view_ids [*required*]         | [string] | List of RUM view IDs sampled for this aggregation, capped at 50.                                                                                                             |
| attributes       | to [*required*]                       | int64    | End of the analyzed time range as a Unix timestamp in seconds.                                                                                                               |
| attributes       | total_cache_hit_rate_pct [*required*] | double   | Overall cache hit rate across all sampled views.                                                                                                                             |
| attributes       | view_count [*required*]               | int32    | Number of view instances included in the analysis.                                                                                                                           |
| attributes       | view_name [*required*]                | string   | The RUM view name that was analyzed.                                                                                                                                         |
| data             | id [*required*]                       | string   | Hash-based unique identifier for this aggregation.                                                                                                                           |
| data             | type [*required*]                     | enum     | The JSON:API type for aggregated waterfall requests. Allowed enum values: `aggregated_waterfall`                                                                             |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "application_id": "ccbc53b1-74f2-496b-bdd7-9a8fa7b7376b",
      "criteria": {
        "max": 5,
        "metric": "largest_contentful_paint",
        "min": 2.5
      },
      "from": 1762437564,
      "resources": [
        {
          "avg_duration_ms": 839.1,
          "avg_start_time_ms": 1486.3,
          "cache_hit_rate_pct": 100,
          "cached_count": 27,
          "downloaded_count": 0,
          "global_p75_duration_ms": 500,
          "global_view_name_count": 3,
          "global_view_name_pct": 30,
          "http_method": "GET",
          "load_frequency_pct": 54,
          "max_duration_ms": 945.6,
          "median_duration_ms": 836.2,
          "min_duration_ms": 812.7,
          "p75_duration_ms": 844.1,
          "p95_duration_ms": 861.8,
          "resource_type": "fetch",
          "resource_url_path_group": "/api/gallery",
          "timing_breakdown": {
            "avg_connect_ms": 20,
            "avg_dns_ms": 10,
            "avg_download_ms": 135,
            "avg_first_byte_ms": 30,
            "avg_redirect_ms": 0,
            "avg_ssl_ms": 5
          },
          "total_requests": 27,
          "views_with_resource": 27
        }
      ],
      "sampled_view_ids": [
        "6fbf69b6-9455-436a-b894-a6bf64126d40",
        "dfe318df-4ae5-44b8-9fe2-4107885e1a46"
      ],
      "to": 1762523964,
      "total_cache_hit_rate_pct": 0.677,
      "view_count": 50,
      "view_name": "/account/login(/:type)"
    },
    "id": "2f0b3455",
    "type": "aggregated_waterfall"
  }
}
```

{% /tab %}

{% /tab %}

{% tab title="400" %}
Bad Request
{% tab title="Model" %}
API error response.

| Parent field | Field                    | Type     | Description                                                                     |
| ------------ | ------------------------ | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| errors       | detail                   | string   | A human-readable explanation specific to this occurrence of the error.          |
| errors       | meta                     | object   | Non-standard meta-information about the error                                   |
| errors       | source                   | object   | References to the source of the error.                                          |
| source       | header                   | string   | A string indicating the name of a single request header which caused the error. |
| source       | parameter                | string   | A string indicating which URI query parameter caused the error.                 |
| source       | pointer                  | string   | A JSON pointer to the value in the request document that caused the error.      |
| errors       | status                   | string   | Status code of the response.                                                    |
| errors       | title                    | string   | Short human-readable summary of the error.                                      |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="401" %}
Unauthorized
{% tab title="Model" %}
API error response.

| Parent field | Field                    | Type     | Description                                                                     |
| ------------ | ------------------------ | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| errors       | detail                   | string   | A human-readable explanation specific to this occurrence of the error.          |
| errors       | meta                     | object   | Non-standard meta-information about the error                                   |
| errors       | source                   | object   | References to the source of the error.                                          |
| source       | header                   | string   | A string indicating the name of a single request header which caused the error. |
| source       | parameter                | string   | A string indicating which URI query parameter caused the error.                 |
| source       | pointer                  | string   | A JSON pointer to the value in the request document that caused the error.      |
| errors       | status                   | string   | Status code of the response.                                                    |
| errors       | title                    | string   | Short human-readable summary of the error.                                      |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="429" %}
Too many requests
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Bad Request"
  ]
}
```

{% /tab %}

{% /tab %}

### Code Example

##### 
                  \## default
# 
 \# Curl command curl -X POST "https://api.datadoghq.com/api/v2/rum/query/insight/aggregated_waterfall" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "application_id": "ccbc53b1-74f2-496b-bdd7-9a8fa7b7376b",
      "criteria": {
        "metric": "largest_contentful_paint",
        "min": 0.3
      },
      "from": 1762437564,
      "sample_size": 20,
      "to": 1762523964,
      "view_name": "/account/login(/:type)"
    },
    "type": "aggregated_waterfall"
  }
}
EOF 
                
{% /tab %}
