---
title: Patch a saved filter
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: Docs > API Reference > Feature Flags
---

> For the complete documentation index, see [llms.txt](https://docs.datadoghq.com/llms.txt).

# Patch a saved filter{% #patch-a-saved-filter %}

{% tab title="v2" %}

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

### Overview

Partially updates a saved filter. Supports both `LIST` and `RULES` filters. Supply at least one of `name`, `description`, or `targeting_rules`. Omitted or null fields are preserved. Supplying `targeting_rules` replaces the entire collection and propagates changes to every feature flag that references the saved filter. Metadata-only updates do not require edit permission or approval on those feature flags. Rule updates require edit permission on all consumer flags and are rejected when approval is required, unless the caller has the `feature_flag_approvals_override` permission. The optional `last_updated_at` field detects stale updates. It does not set the update time. This endpoint requires the `feature_flag_config_write` permission.

OAuth apps require the `feature_flag_config_write` authorization [scope](https://docs.datadoghq.com/api/latest/scopes.md#feature-flags) to access this endpoint.



### Arguments

#### Path Parameters

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

### Request

#### Body Data (required)



{% tab title="Model" %}

| Parent field    | Field                        | Type      | Description                                                                                                                                                                                                                                                                                                      |
| --------------- | ---------------------------- | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|                 | data [*required*]       | object    | The saved filter fields to update.                                                                                                                                                                                                                                                                               |
| data            | attributes [*required*] | object    | Fields to update. At least one of `name`, `description`, or `targeting_rules` must have a non-null value. Omitted or null fields are preserved. The creation type cannot be changed.                                                                                                                             |
| attributes      | description                  | string    | The new description. Send an empty string to clear the description. If omitted or null, the existing description is preserved.                                                                                                                                                                                   |
| attributes      | last_updated_at              | date-time | The `updated_at` value returned by a previous read, as an RFC 3339 timestamp. If it differs from the stored update time, truncated to seconds, the request returns a 409 response. For metadata-only updates, this check does not prevent all concurrent writes. This field alone does not constitute an update. |
| attributes      | name                         | string    | The new name of the saved filter. Must not be empty.                                                                                                                                                                                                                                                             |
| attributes      | targeting_rules              | [object]  | The complete replacement targeting rules, combined with OR. Conditions within each rule are combined with AND. Replaces all existing rules. Values are not appended. Must contain at least one rule. Saved filters cannot reference other saved filters.                                                         |
| targeting_rules | conditions [*required*] | [object]  | Inline conditions combined with AND. Must contain at least one condition.                                                                                                                                                                                                                                        |
| conditions      | attribute [*required*]  | string    | The attribute evaluated by 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`                                                                                                                                                              |
| conditions      | value [*required*]      | [string]  | Values used by the condition operator. Values must satisfy the selected operator and the organization targeting limits.                                                                                                                                                                                          |
| data            | type [*required*]       | enum      | The saved filter resource type. Allowed enum values: `saved-filters`                                                                                                                                                                                                                                             |

{% /tab %}

{% tab title="Example" %}
##### 

```json
{
  "data": {
    "attributes": {
      "description": "Metadata with current timestamp.",
      "last_updated_at": "2026-10-16T20:20:29Z"
    },
    "type": "saved-filters"
  }
}
```

##### 

```json
{
  "data": {
    "attributes": {
      "last_updated_at": "2026-10-16T20:20:30Z",
      "targeting_rules": [
        {
          "conditions": [
            {
              "attribute": "user_id",
              "operator": "ONE_OF",
              "value": [
                "test-user-2"
              ]
            }
          ]
        }
      ]
    },
    "type": "saved-filters"
  }
}
```

##### 

```json
{
  "data": {
    "type": "saved-filters",
    "attributes": {
      "description": ""
    }
  }
}
```

{% /tab %}

### Response

{% tab title="200" %}
OK
{% tab title="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                |           | 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`                                         |
| 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 title="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 %}

{% /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="403" %}
Forbidden
{% tab title="Model" %}
An authentication or permission error, or a resource listing consumer flags that the caller cannot edit.

| Parent field | Field                          | Type     | Description                                                                                      |
| ------------ | ------------------------------ | -------- | ------------------------------------------------------------------------------------------------ |
|              | Option 1                       | object   | A saved filter authorization error containing at least one error message.                        |
| Option 1     | errors [*required*]       | [string] | The authorization error messages.                                                                |
|              | Option 2                       | object   | A saved filter error containing at least one JSON:API error object.                              |
| Option 2     | errors [*required*]       | [object] | The error details.                                                                               |
| 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.                                                       |
|              | Option 3                       | object   | The caller lacks edit permission on one or more feature flags that reference this saved filter.  |
| Option 3     | data [*required*]         | object   | The caller lacks edit permission on one or more feature flags that reference this saved filter.  |
| data         | attributes [*required*]   | object   | The caller lacks edit permission on one or more feature flags that reference this saved filter.  |
| attributes   | denied_flags [*required*] | [object] | Feature flags preventing this update.                                                            |
| denied_flags | id [*required*]           | uuid     | The ID of the feature flag.                                                                      |
| denied_flags | name [*required*]         | string   | The name of the feature flag.                                                                    |
| attributes   | message [*required*]      | string   | The reason the saved filter update was rejected.                                                 |
| data         | id [*required*]           | uuid     | The ID of the saved filter.                                                                      |
| data         | type [*required*]         | enum     | The resource type for this saved filter update error. Allowed enum values: `update-grace-denied` |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Forbidden",
    "Failed permission authorization checks"
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="404" %}
Not Found
{% 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="409" %}
Conflict
{% tab title="Model" %}
A stale update, duplicate name, or other conflict, or a resource listing consumer flags requiring approval.

| Parent field            | Field                                     | Type     | Description                                                                                           |
| ----------------------- | ----------------------------------------- | -------- | ----------------------------------------------------------------------------------------------------- |
|                         | Option 1                                  | object   | A saved filter error containing at least one JSON:API error object.                                   |
| Option 1                | errors [*required*]                  | [object] | The error details.                                                                                    |
| 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.                                                            |
|                         | Option 2                                  | object   | One or more feature flags that reference this saved filter require approval for the rule update.      |
| Option 2                | data [*required*]                    | object   | One or more feature flags that reference this saved filter require approval for the rule update.      |
| data                    | attributes [*required*]              | object   | One or more feature flags that reference this saved filter require approval for the rule update.      |
| attributes              | approval_required_flags [*required*] | [object] | Feature flags preventing this update.                                                                 |
| approval_required_flags | id [*required*]                      | uuid     | The ID of the feature flag.                                                                           |
| approval_required_flags | name [*required*]                    | string   | The name of the feature flag.                                                                         |
| attributes              | message [*required*]                 | string   | The reason the saved filter update was rejected.                                                      |
| data                    | id [*required*]                      | uuid     | The ID of the saved filter.                                                                           |
| data                    | type [*required*]                    | enum     | The resource type for this saved filter update error. Allowed enum values: `update-approval-conflict` |

{% /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

##### 
                          \## Rename a saved filter while preserving its description and rules
# 
 \# Path parameters export saved_filter_id="550e8400-e29b-41d4-a716-446655440090" \# Use a Personal Access Token or Service Access Token export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"  \# Curl command curl -X PATCH "https://api.datadoghq.com/api/v2/feature-flags/saved-filters/${saved_filter_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "name": "Early access users"
    },
    "type": "saved-filters"
  }
}
EOF 
## Replace the complete rules collection
# 
 \# Path parameters export saved_filter_id="550e8400-e29b-41d4-a716-446655440090" \# Use a Personal Access Token or Service Access Token export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"  \# Curl command curl -X PATCH "https://api.datadoghq.com/api/v2/feature-flags/saved-filters/${saved_filter_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "targeting_rules": [
        {
          "conditions": [
            {
              "attribute": "user_id",
              "operator": "ONE_OF",
              "value": [
                "test-user-1",
                "test-user-2"
              ]
            }
          ]
        }
      ]
    },
    "type": "saved-filters"
  }
}
EOF 

                        
##### 
                          \## Rename a saved filter while preserving its description and rules
# 
 \# Path parameters export saved_filter_id="550e8400-e29b-41d4-a716-446655440090" \# Use a Personal Access Token or Service Access Token export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"  \# Curl command curl -X PATCH "https://api.datadoghq.com/api/v2/feature-flags/saved-filters/${saved_filter_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "name": "Early access users"
    },
    "type": "saved-filters"
  }
}
EOF 
## Replace the complete rules collection
# 
 \# Path parameters export saved_filter_id="550e8400-e29b-41d4-a716-446655440090" \# Use a Personal Access Token or Service Access Token export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"  \# Curl command curl -X PATCH "https://api.datadoghq.com/api/v2/feature-flags/saved-filters/${saved_filter_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "targeting_rules": [
        {
          "conditions": [
            {
              "attribute": "user_id",
              "operator": "ONE_OF",
              "value": [
                "test-user-1",
                "test-user-2"
              ]
            }
          ]
        }
      ]
    },
    "type": "saved-filters"
  }
}
EOF 

                        
##### 
                          \## Rename a saved filter while preserving its description and rules
# 
 \# Path parameters export saved_filter_id="550e8400-e29b-41d4-a716-446655440090" \# Use a Personal Access Token or Service Access Token export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"  \# Curl command curl -X PATCH "https://api.datadoghq.com/api/v2/feature-flags/saved-filters/${saved_filter_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "name": "Early access users"
    },
    "type": "saved-filters"
  }
}
EOF 
## Replace the complete rules collection
# 
 \# Path parameters export saved_filter_id="550e8400-e29b-41d4-a716-446655440090" \# Use a Personal Access Token or Service Access Token export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"  \# Curl command curl -X PATCH "https://api.datadoghq.com/api/v2/feature-flags/saved-filters/${saved_filter_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "targeting_rules": [
        {
          "conditions": [
            {
              "attribute": "user_id",
              "operator": "ONE_OF",
              "value": [
                "test-user-1",
                "test-user-2"
              ]
            }
          ]
        }
      ]
    },
    "type": "saved-filters"
  }
}
EOF 

                        
{% /tab %}
