---
title: Get a saved filter
description: Returns a saved filter by ID, including its full targeting rules, conditions, and values.
breadcrumbs: Docs > API > Get a saved filter
---

> For the complete documentation index, see [llms.txt](https://dnd37xeb23o8n.cloudfront.net/stefon.simmons/docs-astro-web-10435/llms.txt).

# Get a saved filter

## v2 (latest)

| Datadog site      | API endpoint                                                                           |
| ----------------- | -------------------------------------------------------------------------------------- |
| app.datadoghq.com | GET https://api.datadoghq.com/api/v2/feature-flags/saved-filters/{saved_filter_id}     |
| us3.datadoghq.com | GET https://api.us3.datadoghq.com/api/v2/feature-flags/saved-filters/{saved_filter_id} |
| us5.datadoghq.com | GET https://api.us5.datadoghq.com/api/v2/feature-flags/saved-filters/{saved_filter_id} |
| app.datadoghq.eu  | GET https://api.datadoghq.eu/api/v2/feature-flags/saved-filters/{saved_filter_id}      |
| ap1.datadoghq.com | GET https://api.ap1.datadoghq.com/api/v2/feature-flags/saved-filters/{saved_filter_id} |
| ap2.datadoghq.com | GET https://api.ap2.datadoghq.com/api/v2/feature-flags/saved-filters/{saved_filter_id} |
| uk1.datadoghq.com | GET https://api.uk1.datadoghq.com/api/v2/feature-flags/saved-filters/{saved_filter_id} |
| app.ddog-gov.com  | GET https://api.ddog-gov.com/api/v2/feature-flags/saved-filters/{saved_filter_id}      |
| us2.ddog-gov.com  | GET https://api.us2.ddog-gov.com/api/v2/feature-flags/saved-filters/{saved_filter_id}  |

### Overview

Returns a saved filter by ID, including its full targeting rules, conditions, and values.
Supports both saved lists and saved rules. Targeting rules are combined with OR,
and conditions within each rule are combined with AND.
Returns the stored filter definition rather than evaluating it against users or organizations.
Archived filters can be retrieved. Filters that are deleted or belong to another organization return a not found error.

This endpoint requires the `feature_flag_config_read` permission.

OAuth apps require the `feature_flag_config_read` authorization [scope](https://dnd37xeb23o8n.cloudfront.net/stefon.simmons/docs-astro-web-10435/api/latest/scopes.md#feature-flags) to access this endpoint.

### Arguments

#### Path Parameters

| Field                        | Type   | Description                 |
| ---------------------------- | ------ | --------------------------- |
| saved_filter_id [*required*] | string | The ID of the saved filter. |

### Response

{% tabs %}
{% tab label="200" %}
OK

{% tabs %}
{% tab label="Model" %}
Response containing a saved filter and its targeting rules.

| Parent field    | Field                        | Type      | Description                                                                                                                                                                                                                                                      |
| --------------- | ---------------------------- | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|                 | data [*required*]            | object    | A saved filter resource.                                                                                                                                                                                                                                         |
| data            | attributes [*required*]      | object    | Saved filter details, including the full targeting rules and conditions.                                                                                                                                                                                         |
| attributes      | archived_at                  | date-time | The time the saved filter was archived. Omitted when the filter is not archived.                                                                                                                                                                                 |
| attributes      | created_at [*required*]      | date-time | The time the saved filter was created.                                                                                                                                                                                                                           |
| attributes      | created_by [*required*]      | string    | The ID of the user who created the saved filter.                                                                                                                                                                                                                 |
| attributes      | creation_type [*required*]   | enum      | How the saved filter was authored. RULES indicates rule-based authoring and LIST indicates list import. Both types return targeting rules and conditions. Allowed enum values: `RULES`, `LIST`.                                                                  |
| attributes      | description                  | string    | A description of the saved filter. Omitted when no description is set.                                                                                                                                                                                           |
| attributes      | migration_metadata           | any       | Optional JSON metadata supplied by migration tools for tracking the source of a saved filter.                                                                                                                                                                    |
| attributes      | name [*required*]            | string    | The name of the saved filter.                                                                                                                                                                                                                                    |
| attributes      | targeting_rules [*required*] | [object]  | Targeting rules combined with OR. Conditions within each rule are combined with AND. Both saved lists and saved rules use this structure.                                                                                                                        |
| targeting_rules | conditions [*required*]      | [object]  | Conditions combined with AND within this targeting rule.                                                                                                                                                                                                         |
| conditions      | attribute [*required*]       | string    | The attribute evaluated by the condition.                                                                                                                                                                                                                        |
| conditions      | id [*required*]              | uuid      | The ID of the condition.                                                                                                                                                                                                                                         |
| conditions      | operator [*required*]        | enum      | The comparison operator used by a saved filter condition. Allowed enum values: `LT`, `LTE`, `GT`, `GTE`, `MATCHES`, `NOT_MATCHES`, `ONE_OF`, `NOT_ONE_OF`, `IS_NULL`, `EQUALS`, `SEMVER_EQ`, `SEMVER_NEQ`, `SEMVER_LT`, `SEMVER_LTE`, `SEMVER_GT`, `SEMVER_GTE`. |
| conditions      | value [*required*]           | [string]  | Values used by the condition operator.                                                                                                                                                                                                                           |
| targeting_rules | id [*required*]              | uuid      | The ID of the targeting rule.                                                                                                                                                                                                                                    |
| attributes      | updated_at [*required*]      | date-time | The time the saved filter was last updated.                                                                                                                                                                                                                      |
| data            | id [*required*]              | uuid      | The ID of the saved filter.                                                                                                                                                                                                                                      |
| data            | type [*required*]            | enum      | The saved filter resource type. Allowed enum values: `saved-filters`.                                                                                                                                                                                            |
{% /tab %}

{% tab label="Example" %}
```json
{
  "data": {
    "attributes": {
      "archived_at": "2026-01-03T12:00:00Z",
      "created_at": "2026-01-01T12:00:00Z",
      "created_by": "550e8400-e29b-41d4-a716-446655440091",
      "creation_type": "RULES",
      "description": "Users selected by email address or organization ID.",
      "migration_metadata": {
        "provider": "launchdarkly",
        "segment_key": "early-access-users"
      },
      "name": "Early access users",
      "targeting_rules": [
        {
          "conditions": [
            {
              "attribute": "email",
              "id": "550e8400-e29b-41d4-a716-446655440093",
              "operator": "ONE_OF",
              "value": [
                "user@example.com"
              ]
            }
          ],
          "id": "550e8400-e29b-41d4-a716-446655440092"
        }
      ],
      "updated_at": "2026-01-02T12:00:00Z"
    },
    "id": "550e8400-e29b-41d4-a716-446655440090",
    "type": "saved-filters"
  }
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="400" %}
Bad Request

{% tabs %}
{% tab label="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 label="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 %}
{% /tabs %}
{% /tab %}

{% tab label="403" %}
Forbidden

{% tabs %}
{% tab label="Model" %}
API error response.

| Field               | Type     | Description       |
| ------------------- | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    "Bad Request"
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="404" %}
Not Found

{% tabs %}
{% tab label="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 label="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 %}
{% /tabs %}
{% /tab %}

{% tab label="429" %}
Too many requests

{% tabs %}
{% tab label="Model" %}
API error response.

| Field               | Type     | Description       |
| ------------------- | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    "Bad Request"
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}
{% /tabs %}

### Code Example

{% tabs %}
{% tab label="Curl" %}
```bash
# Path parameters
export saved_filter_id="550e8400-e29b-41d4-a716-446655440090"

# Set your Datadog site and credentials
export DD_SITE="datadoghq.com" # Or us3.datadoghq.com, us5.datadoghq.com, datadoghq.eu, ap1.datadoghq.com, ap2.datadoghq.com, uk1.datadoghq.com, ddog-gov.com, us2.ddog-gov.com
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X GET "https://api.${DD_SITE}/api/v2/feature-flags/saved-filters/${saved_filter_id}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
```
{% /tab %}
{% /tabs %}
