Get all hardcoded retention filters

GET https://api.ap1.datadoghq.com/api/v2/rum/applications/{app_id}/hardcoded_retention_filtershttps://api.ap2.datadoghq.com/api/v2/rum/applications/{app_id}/hardcoded_retention_filtershttps://api.datadoghq.eu/api/v2/rum/applications/{app_id}/hardcoded_retention_filtershttps://api.ddog-gov.com/api/v2/rum/applications/{app_id}/hardcoded_retention_filtershttps://api.us2.ddog-gov.com/api/v2/rum/applications/{app_id}/hardcoded_retention_filtershttps://api.datadoghq.com/api/v2/rum/applications/{app_id}/hardcoded_retention_filtershttps://api.us3.datadoghq.com/api/v2/rum/applications/{app_id}/hardcoded_retention_filtershttps://api.us5.datadoghq.com/api/v2/rum/applications/{app_id}/hardcoded_retention_filters

Overview

Get the list of hardcoded retention filters for a RUM application.

Arguments

Path Parameters

Name

Type

Description

app_id [required]

string

RUM application ID.

Response

OK

All hardcoded retention filters for a RUM application.

Expand All

Field

Type

Description

data

[object]

A list of hardcoded retention filters.

attributes

object

The attributes of a hardcoded retention filter.

cross_product_sampling

object

Cross-product retention settings for a hardcoded retention filter.

session_replay_enabled

boolean

Indicates whether Session Replay cross-product retention is active.

session_replay_sample_rate

double

Percentage (0–100) of retained sessions with an ingested replay whose replay data is kept.

trace_enabled

boolean

Indicates whether Trace cross-product retention is active.

trace_sample_rate

double

Percentage (0–100) of retained sessions with ingested traces whose traces are indexed.

cross_product_sampling_editability

object

Flags indicating which cross_product_sampling fields can be updated. Read-only.

session_replay_sample_rate

boolean

If true, cross_product_sampling.session_replay_sample_rate can be updated on this filter.

trace_sample_rate

boolean

If true, cross_product_sampling.trace_sample_rate can be updated on this filter.

enabled

boolean

Indicates whether the hardcoded retention filter is active. Read-only.

event_type

enum

The type of RUM events the hardcoded filter applies to. Read-only. Allowed enum values: session,view,action,error,resource,long_task,vital

name

string

The name of the hardcoded retention filter. Read-only.

query

string

The query string for the hardcoded retention filter. Read-only.

sample_rate

double

The retention sample rate (0–100) for the hardcoded filter. Read-only.

id

string

The ID of the hardcoded retention filter.

meta

object

Metadata about the hardcoded retention filter.

source

enum

The source of the last update to a hardcoded retention filter. Allowed enum values: default,ui,terraform

updated_at

int64

Unix epoch (in milliseconds) of the last update.

updated_by_handle

string

Handle of the user who last updated the filter.

type

enum

The resource type. The value must be hardcoded_retention_filters. Allowed enum values: hardcoded_retention_filters

default: hardcoded_retention_filters

{
  "data": [
    {
      "attributes": {
        "cross_product_sampling": {
          "session_replay_enabled": true,
          "session_replay_sample_rate": 50,
          "trace_enabled": true,
          "trace_sample_rate": 25
        },
        "cross_product_sampling_editability": {
          "session_replay_sample_rate": true,
          "trace_sample_rate": false
        },
        "enabled": true,
        "event_type": "session",
        "name": "Replay sessions",
        "query": "@session.has_replay:true",
        "sample_rate": 100
      },
      "id": "forced_replay_sessions",
      "meta": {
        "source": "ui",
        "updated_at": 1735689600000,
        "updated_by_handle": "jane.doe@example.com"
      },
      "type": "hardcoded_retention_filters"
    }
  ]
}

Not Authorized

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

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

Code Example

                  # Path parameters
export app_id="CHANGE_ME"
# Curl command
curl -X GET "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.us2.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/rum/applications/${app_id}/hardcoded_retention_filters" \ -H "Accept: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"